Skip to content

Commit ed3541a

Browse files
Address review: ppp=1, local=true, Category filters
Align with nunit-browserstack (Selenium) sample conventions: - browserstack.yml: parallelsPerPlatform 2 -> 1, browserstackLocal false -> true - Tag fixtures with [Category("sample-test")] / [Category("sample-local-test")] so `dotnet test --filter "Category=..."` scopes the run (matches nunit-browserstack/SampleTest.cs and SampleLocalTest.cs) - README: swap FullyQualifiedName filters for Category= filters; drop the now-redundant "flip the toggle" step; update parallelism narrative to ppp=1 (4 platforms x 1 x 2 NUnit-parallel fixtures = still 8 concurrent sessions) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ce21957 commit ed3541a

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

NunitPlaywrightBrowserstack.Tests/BStackDemoCartTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace NunitPlaywrightBrowserstack.Tests;
22

33
[TestFixture]
4+
[Category("sample-test")]
45
[Parallelizable(ParallelScope.Self)]
56
public class BStackDemoCartTest : PlaywrightFixtureBase
67
{

NunitPlaywrightBrowserstack.Tests/BStackLocalSampleTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace NunitPlaywrightBrowserstack.Tests;
33
// Requires browserstack.yml has `browserstackLocal: true` and a local HTTP server
44
// is serving a page with title containing "BrowserStack Local" on port 45454.
55
[TestFixture]
6+
[Category("sample-local-test")]
67
[Parallelizable(ParallelScope.Self)]
78
public class BStackLocalSampleTest : PlaywrightFixtureBase
89
{

NunitPlaywrightBrowserstack.Tests/browserstack.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ platforms:
6464
#
6565
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
6666
#
67-
# This sample sets parallelsPerPlatform: 2 to demonstrate NUnit's fixture-level
67+
# This sample sets parallelsPerPlatform: 1 to demonstrate NUnit's fixture-level
6868
# parallelism on top of the SDK's per-platform fan-out: 4 platforms x 2 fixtures
6969
# (BStackDemoCart + BStackLocalSample) = 8 concurrent sessions per `dotnet test`.
70-
parallelsPerPlatform: 2
70+
parallelsPerPlatform: 1
7171

7272
# ==========================================
7373
# BrowserStack Local
7474
# (For localhost, staging/private websites)
7575
# ==========================================
7676
# Set browserstackLocal to true if your website under test is not accessible publicly over the internet
7777
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
78-
browserstackLocal: false # <boolean> (Default false)
78+
browserstackLocal: true # <boolean> (Default false)
7979

8080
# Options to be passed to BrowserStack local in-case of advanced configurations
8181
# browserStackLocalOptions:

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This sample shows how to run [NUnit](https://nunit.org/) + [Playwright](https://
1515

1616
```sh
1717
cd NunitPlaywrightBrowserstack.Tests
18-
dotnet test --filter "FullyQualifiedName~BStackDemoCart"
18+
dotnet test --filter "Category=sample-test"
1919
```
2020

2121
The sample runs `BStackDemoCartTest` across all four platforms declared in `browserstack.yml` (Windows 11 / Chrome, macOS / WebKit, Windows 11 / Firefox, Windows 11 / Edge) in parallel.
@@ -24,7 +24,7 @@ Understand how many parallel sessions you need by using our [Parallel Test Calcu
2424

2525
### Testing a private host (BrowserStack Local)
2626

27-
If your app lives on `localhost`, a staging host, or behind a firewall, set `browserstackLocal: true` in `browserstack.yml` and run the local fixture:
27+
If your app lives on `localhost`, a staging host, or behind a firewall, run the local fixture (`browserstackLocal: true` is already set in `browserstack.yml`):
2828

2929
```sh
3030
# 1. Stand up a tiny static page locally on port 45454 (any HTTP server works)
@@ -36,11 +36,9 @@ cat > index.html <<'HTML'
3636
HTML
3737
python3 -m http.server 45454 &
3838

39-
# 2. Flip the toggle in browserstack.yml: browserstackLocal: true
40-
41-
# 3. Run the local fixture
39+
# 2. Run the local fixture
4240
cd ../NunitPlaywrightBrowserstack.Tests
43-
dotnet test --filter "FullyQualifiedName~BStackLocalSample"
41+
dotnet test --filter "Category=sample-local-test"
4442
```
4543

4644
The SDK starts and stops the BrowserStack Local tunnel for you -- no manual binary download or lifecycle management. The cloud browser reaches your local server through `http://bs-local.com:<port>/`.
@@ -74,7 +72,7 @@ This sample stacks two layers of parallelism:
7472
| SDK platform fan-out | `browserstack.yml` -> `platforms` + `parallelsPerPlatform` | The SDK spawns one NUnit run per `(platform x parallelsPerPlatform)` cell |
7573
| NUnit fixture-level parallelism | `AssemblyInfo.cs` -> `[assembly: Parallelizable(ParallelScope.Fixtures)]` | Within each NUnit run, `[TestFixture]` classes execute concurrently |
7674

77-
With the shipped defaults (4 platforms x `parallelsPerPlatform: 2`, 2 fixtures: `BStackDemoCartTest` + `BStackLocalSampleTest`), a single `dotnet test` produces **up to 8 concurrent BrowserStack sessions**. Tune `parallelsPerPlatform` and `LevelOfParallelism` in `AssemblyInfo.cs` to match your BrowserStack plan.
75+
With the shipped defaults (4 platforms x `parallelsPerPlatform: 1`, 2 fixtures: `BStackDemoCartTest` + `BStackLocalSampleTest` running in parallel via NUnit), a single `dotnet test` produces **up to 8 concurrent BrowserStack sessions**. Tune `parallelsPerPlatform` and `LevelOfParallelism` in `AssemblyInfo.cs` to match your BrowserStack plan.
7876

7977
## Repo layout
8078

0 commit comments

Comments
 (0)