Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add support for running parallel .Net tests with xUnit v >= 2.8 #2977

Closed
ebjornset opened this issue Aug 6, 2024 · 2 comments
Closed
Assignees
Labels

Comments

@ebjornset
Copy link

🚀 Feature Request

From the docks it seems that Playwright does not support running tests in parallel with xUnit, due to limitations in the xUnit framework, https://playwright.dev/dotnet/docs/test-runners#xunit-support

xUnit 2.8 has added support for only starting the specified number of test when running test in parallel, using the "conservative" algorithm, see https://xunit.net/docs/running-tests-in-parallel#algorithms for details.

I guess this xUnit feature has removed the limitation mentioned in the docs, and that it's now possible to support running Playwright tests in parallel with xUnit?

Example

I suppose the docs would need to be updated to describe that running tests in parallel requires the xUnit "conservative" parallelism algorithm, and maybe Playwright it self would need some configuration to enable/disable parallelism?

When parallelism is configured Playwright should just "do its magic under the hoods". When its turned off the tests should run in sequence.

Motivation

It would make using Playwright with xUnit a better tool set, since a Playwright xUnit test suite can give faster feedback.

@mxschmitt
Copy link
Member

mxschmitt commented Nov 25, 2024

We have implemented the needed functionality and it gets released as part of v1.50. There is a pre-release version if someone wants to try:

Docs:

Example:

dotnet new xunit -n PlaywrightTests
cd PlaywrightTests
dotnet add package xunit --version 2.8.0
dotnet add package --prerelease Microsoft.Playwright.Xunit
dotnet build
pwsh bin/Debug/net8.0/playwright.ps1 install
dotnet test

@mxschmitt
Copy link
Member

Closing since it has been implemented and gets released as part of v1.50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants