{"id":51528777,"url":"https://github.com/browserstack/xunit-reqnroll-playwright-browserstack","last_synced_at":"2026-07-09T00:31:50.950Z","repository":{"id":355555897,"uuid":"1228567187","full_name":"browserstack/xunit-reqnroll-playwright-browserstack","owner":"browserstack","description":"Sample repo for customers","archived":false,"fork":false,"pushed_at":"2026-05-04T06:38:34.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T08:27:02.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-04T06:38:30.000Z","updated_at":"2026-05-04T06:38:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/browserstack/xunit-reqnroll-playwright-browserstack","commit_stats":null,"previous_names":["browserstack/xunit-reqnroll-playwright-browserstack"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/browserstack/xunit-reqnroll-playwright-browserstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fxunit-reqnroll-playwright-browserstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fxunit-reqnroll-playwright-browserstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fxunit-reqnroll-playwright-browserstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fxunit-reqnroll-playwright-browserstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/xunit-reqnroll-playwright-browserstack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fxunit-reqnroll-playwright-browserstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35282897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-09T00:31:50.088Z","updated_at":"2026-07-09T00:31:50.936Z","avatar_url":"https://github.com/browserstack.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# xunit-reqnroll-playwright-browserstack\n\nThis sample shows how to run [xUnit](https://xunit.net/) + [Reqnroll](https://reqnroll.net/) + [Playwright](https://playwright.dev/dotnet) tests on BrowserStack using the [BrowserStack .NET SDK](https://www.nuget.org/packages/BrowserStack.TestAdapter). The SDK reads `browserstack.yml`, fans your scenarios out across the platforms listed there, starts and stops BrowserStack Local automatically, and reports test status to the BrowserStack dashboard. Your test code stays pure `Microsoft.Playwright` + Reqnroll -- no manual `ConnectAsync`, no caps in code.\n\n![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)\n\n## Run Sample Build\n\n* Clone the repo\n* Open the solution `XunitReqnrollPlaywrightBrowserstack.sln` in Visual Studio (or your IDE of choice)\n* Build the solution (`dotnet build`)\n* Replace the `userName` and `accessKey` placeholders in `browserstack.yml` with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings). Alternatively, remove those two lines from the yml and set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables -- the SDK falls back to env vars only when the yml fields are absent\n\n### Running your tests from CLI\n\n```sh\ncd XunitReqnrollPlaywrightBrowserstack.Tests\ndotnet test\n```\n\nThe sample runs across both platforms declared in `browserstack.yml` (Windows 11 / Chrome and macOS / WebKit) in parallel.\n\nUnderstand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github).\n\n### Testing a private host (BrowserStack Local)\n\nIf your app lives on `localhost`, a staging host, or behind a firewall, set `browserstackLocal: true` in `browserstack.yml` and rerun `dotnet test`. The SDK starts and stops the BrowserStack Local tunnel for you -- no manual binary download or lifecycle management. Then point your scenarios at `http://bs-local.com:\u003cport\u003e/` (a hostname BrowserStack Local resolves to your machine) instead of a public URL.\n\n## Integrate your test suite\n\nThis repository uses the BrowserStack SDK to run tests on BrowserStack. To wire the SDK into your own test suite:\n\n* Create a `browserstack.yml` at the project root with your BrowserStack credentials and platform list (see this repo for a working template)\n* Add the `BrowserStack.TestAdapter` NuGet package:\n\n  ```sh\n  dotnet add package BrowserStack.TestAdapter\n  ```\n\n* Build the project (`dotnet build`); the SDK installs the `browserstack-sdk` dotnet tool and patches the test assembly so Playwright launches are routed to BrowserStack at runtime\n\n## How the SDK changes things\n\n- **One `browserstack.yml`** declares platforms, parallelism, the Local toggle, and reporting; the SDK picks them up automatically\n- **The SDK runs platforms in parallel for you** -- one xUnit run per `(platform x parallelsPerPlatform)` cell, no per-platform branching needed\n- **The SDK rewrites Playwright launches** -- `Hooks/PlaywrightHooks.cs` calls `pw.Chromium.LaunchAsync()` and the SDK transparently redirects to the per-platform browser configured in the yml (`chrome` / `playwright-webkit` / `playwright-firefox` / etc.). No `Chromium.ConnectAsync(wss_url)` plumbing\n- **The SDK starts and stops BrowserStack Local** when `browserstackLocal: true` -- no manual tunnel lifecycle management\n- **Reqnroll generates xUnit test classes** from `.feature` files at build time, so behaviour-driven scenarios run as standard xUnit tests under `dotnet test`\n\n## Repo layout\n\n```\n.\n├── XunitReqnrollPlaywrightBrowserstack.sln\n└── XunitReqnrollPlaywrightBrowserstack.Tests/\n    ├── XunitReqnrollPlaywrightBrowserstack.Tests.csproj\n    ├── browserstack.yml          # SDK config: credentials, platforms, Local toggle, reporting\n    ├── Features/\n    │   └── Sample.feature        # bstackdemo add-to-cart scenario\n    ├── StepDefinitions/\n    │   └── SampleSteps.cs\n    └── Hooks/\n        └── PlaywrightHooks.cs    # creates IPage per scenario; SDK routes the launch\n```\n\n## Notes\n\n* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)\n* To test on a different set of browsers, see our [list of supported browsers and platforms](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate)\n* You can export the environment variables for the Username and Access Key of your BrowserStack account:\n\n  * For Unix-like or Mac machines:\n  ```sh\n  export BROWSERSTACK_USERNAME=\u003cbrowserstack-username\u003e \u0026\u0026\n  export BROWSERSTACK_ACCESS_KEY=\u003cbrowserstack-access-key\u003e\n  ```\n  * For Windows Cmd:\n  ```cmd\n  set BROWSERSTACK_USERNAME=\u003cbrowserstack-username\u003e\n  set BROWSERSTACK_ACCESS_KEY=\u003cbrowserstack-access-key\u003e\n  ```\n  * For Windows Powershell:\n  ```powershell\n  $env:BROWSERSTACK_USERNAME=\u003cbrowserstack-username\u003e\n  $env:BROWSERSTACK_ACCESS_KEY=\u003cbrowserstack-access-key\u003e\n  ```\n\n## Further Reading\n\n- [xUnit](https://xunit.net/)\n- [Reqnroll](https://reqnroll.net/)\n- [Playwright .NET](https://playwright.dev/dotnet/)\n- [BrowserStack documentation for Playwright in C#](https://www.browserstack.com/docs/automate/playwright/getting-started/c-sharp)\n- [BrowserStack.TestAdapter on NuGet](https://www.nuget.org/packages/BrowserStack.TestAdapter)\n- [NUnit reference sample](https://github.com/browserstack/csharp-playwright-browserstack)\n\nHappy Testing!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fxunit-reqnroll-playwright-browserstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fxunit-reqnroll-playwright-browserstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fxunit-reqnroll-playwright-browserstack/lists"}