mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
docs(dotnet): document unsupported parallelism attributes in NUnit/MSTest (#16471)
Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
3dc1920ce8
commit
13f210a1e8
@ -24,9 +24,11 @@ Playwright provides base classes to write tests with NUnit via the [`Microsoft.P
|
||||
# Create a new project
|
||||
dotnet new nunit -n PlaywrightTests
|
||||
cd PlaywrightTests
|
||||
|
||||
# Add the required reference
|
||||
dotnet add package Microsoft.Playwright.NUnit
|
||||
dotnet build
|
||||
|
||||
# Install the required browsers and operating system dependencies
|
||||
pwsh bin\Debug\netX\playwright.ps1 install --with-deps
|
||||
```
|
||||
@ -104,7 +106,8 @@ dotnet test --filter "Name~Slogan"
|
||||
|
||||
### Running NUnit tests in Parallel
|
||||
|
||||
By default NUnit will run all test files in parallel, while running tests inside each file sequentially. It will create as many processes as there are cores on the host system. You can adjust this behavior using the NUnit.NumberOfTestWorkers parameter.
|
||||
By default NUnit will run all test files in parallel, while running tests inside each file sequentially (`ParallelScope.Self`). It will create as many processes as there are cores on the host system. You can adjust this behavior using the NUnit.NumberOfTestWorkers parameter.
|
||||
Running test in parallel using `ParallelScope.All` or `ParallelScope.Fixtures` is not supported.
|
||||
|
||||
For CPU-bound tests, we recommend using as many workers as there are cores on your system, divided by 2. For IO-bound tests you can use as many workers as you have cores.
|
||||
|
||||
@ -224,9 +227,11 @@ Playwright provides base classes to write tests with MSTest via the [`Microsoft.
|
||||
# Create a new project
|
||||
dotnet new mstest -n PlaywrightTests
|
||||
cd PlaywrightTests
|
||||
|
||||
# Add the required reference
|
||||
dotnet add package Microsoft.Playwright.MSTest
|
||||
dotnet build
|
||||
|
||||
# Install the required browsers and operating system dependencies
|
||||
pwsh bin\Debug\netX\playwright.ps1 install --with-deps
|
||||
```
|
||||
@ -304,7 +309,8 @@ dotnet test --filter "Name~Slogan"
|
||||
|
||||
### Running MSTest tests in Parallel
|
||||
|
||||
By default MSTest will run all classes in parallel, while running tests inside each class sequentially. It will create as many processes as there are cores on the host system. You can adjust this behavior by using the following CLI parameter or using a `.runsettings` file, see below.
|
||||
By default MSTest will run all classes in parallel, while running tests inside each class sequentially (`ExecutionScope.ClassLevel`). It will create as many processes as there are cores on the host system. You can adjust this behavior by using the following CLI parameter or using a `.runsettings` file, see below.
|
||||
Running tests in parallel at the method level (`ExecutionScope.MethodLevel`) is not supported.
|
||||
|
||||
```bash
|
||||
dotnet test --settings:.runsettings -- MSTest.Parallelize.Workers=4
|
||||
@ -389,7 +395,7 @@ For example, to specify the amount of workers (`MSTest.Parallelize.Workers`), yo
|
||||
|
||||
```xml
|
||||
<RunSettings>
|
||||
<!-- MSTest adapter -->
|
||||
<!-- MSTest adapter -->
|
||||
<MSTest>
|
||||
<Parallelize>
|
||||
<Workers>4</Workers>
|
||||
|
Loading…
Reference in New Issue
Block a user