Add NUnit + Reqnroll + Playwright BrowserStack SDK sample#2
Open
saraswati-padmawar wants to merge 3 commits into
Open
Add NUnit + Reqnroll + Playwright BrowserStack SDK sample#2saraswati-padmawar wants to merge 3 commits into
saraswati-padmawar wants to merge 3 commits into
Conversation
C# sample mirroring xunit-reqnroll-playwright-browserstack, swapped to the NUnit runner. Sample.feature (bstackdemo add-to-cart) + LocalSample.feature (BrowserStack Local via bs-local.com:45454), step definitions with NUnit assertions, Playwright hooks, browserstack.yml (framework: nunit), .sln/.csproj, sanity workflow, and README. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The BrowserStack .NET SDK's auto-generated BrowserStackPatch.cs references the Microsoft.Playwright.NUnit namespace; without the package the build fails with CS0234 'NUnit does not exist in namespace Microsoft.Playwright'. The NUnit+PW reference repo (csharp-playwright-browserstack) includes it too. Verified: 2/2 platforms (Win11/chrome, OSX/webkit) pass real BrowserStack sessions on .NET 8 / arm64. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rohannagariya1
approved these changes
Jul 1, 2026
Rohannagariya1
left a comment
Collaborator
There was a problem hiding this comment.
LGTM ✅ — solid NUnit/Reqnroll adaptation, both scenarios verified. Approving.
A few low-risk, optional cleanups (non-blocking):
System.Net.Http 4.3.4andSystem.Text.RegularExpressions 4.3.1in the.csprojare in-box on net8.0 and unnecessary — safe to drop (and they're the kind of legacy refs Semgrep/dependabot tend to flag).browserstack.ymlis missingtestReporting: true(+ the reporting comment block) that both Node siblings include — minor cross-sample consistency.- The workflow's "completed" step calls
checks.createagain rather than updating the in-progress run, so you get one stuckin_progress+ onecompletedcheck. Copied from the xunit reference, so low priority. [id="\31 "]works but is inconsistent with the plain[id="1"]attribute selector used in the JS samples — purely cosmetic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Populates this customer-facing sample repo (previously skeleton: README + CODEOWNERS + Semgrep only) with a working NUnit + Reqnroll + Playwright (C#) sample driven by the BrowserStack .NET SDK.
What's included
Features/Sample.feature+StepDefinitions/SampleSteps.cs— public bstackdemo.com add-to-cart scenarioFeatures/LocalSample.feature+StepDefinitions/LocalSampleSteps.cs— BrowserStack Local scenario (bs-local.com:45454)Hooks/PlaywrightHooks.cs— createsIPageper scenario (SDK routesChromium.LaunchAsync())browserstack.yml— credentials, platforms, Local toggle,framework: nunit.sln/.csproj(Reqnroll.NUnit + NUnit + Microsoft.Playwright.NUnit + BrowserStack.TestAdapter),.gitignore,sanity-workflow.yml, READMEReferences
browserstack/xunit-reqnroll-playwright-browserstack, swapping the xUnit runner for NUnit (packages +Assert.Thatassertions +framework: nunit)browserstack/csharp-playwright-browserstackVerified on BrowserStack ✅
Built and ran both scenarios end-to-end against BrowserStack Automate (.NET 8, arm64), passing on the configured platforms (Windows 11/chrome, OS X Ventura/playwright-webkit):
dotnet test --filter ~BStackDemoCarte42c67df4402e6c1e6f997209241f07536535e08)bs-local.com:45454)dotnet test --filter ~BStackLocalSampleReqnroll generated the NUnit tests from the
.featurefiles. Project: BrowserStack Samples.🤖 Generated with Claude Code