Skip to content

Add NUnit + Reqnroll + Playwright BrowserStack SDK sample#2

Open
saraswati-padmawar wants to merge 3 commits into
mainfrom
add-nunit-reqnroll-playwright-sample
Open

Add NUnit + Reqnroll + Playwright BrowserStack SDK sample#2
saraswati-padmawar wants to merge 3 commits into
mainfrom
add-nunit-reqnroll-playwright-sample

Conversation

@saraswati-padmawar

@saraswati-padmawar saraswati-padmawar commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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 scenario
  • Features/LocalSample.feature + StepDefinitions/LocalSampleSteps.cs — BrowserStack Local scenario (bs-local.com:45454)
  • Hooks/PlaywrightHooks.cs — creates IPage per scenario (SDK routes Chromium.LaunchAsync())
  • browserstack.yml — credentials, platforms, Local toggle, framework: nunit
  • .sln / .csproj (Reqnroll.NUnit + NUnit + Microsoft.Playwright.NUnit + BrowserStack.TestAdapter), .gitignore, sanity-workflow.yml, README

References

  • Direct adaptation of browserstack/xunit-reqnroll-playwright-browserstack, swapping the xUnit runner for NUnit (packages + Assert.That assertions + framework: nunit)
  • NUnit package set aligned with browserstack/csharp-playwright-browserstack
  • Follows the standardized Automate sample template (Confluence: SDK Sample Repo Generator, R1–R4)

Verified 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):

Scenario Command Result
Public (bstackdemo add-to-cart) dotnet test --filter ~BStackDemoCart ✅ passed (build e42c67df4402e6c1e6f997209241f07536535e08)
BrowserStack Local (bs-local.com:45454) dotnet test --filter ~BStackLocalSample ✅ passed (SDK tunnel; title assertion passed)

Reqnroll generated the NUnit tests from the .feature files. Project: BrowserStack Samples.

Note from verification: the SDK's auto-generated patch references the Microsoft.Playwright.NUnit namespace, so Microsoft.Playwright.NUnit is required in the .csproj (without it dotnet build fails CS0234) — added in this PR.

🤖 Generated with Claude Code

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>
@saraswati-padmawar saraswati-padmawar requested a review from a team as a code owner June 30, 2026 08:17
saraswati-padmawar and others added 2 commits June 30, 2026 15:44
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant