-
Notifications
You must be signed in to change notification settings - Fork 292
feat: add support for xUnit.v3 #3097
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
Conversation
085215a to
0d4ec90
Compare
5a3a99a to
82650e0
Compare
|
Can I plus one this with ever fibre of my being. Having just looked over the wrap sheet for v3... I'd really like to be able to take screenshots and have them attached to the test results. |
|
Hacky, but I cannot think about a better way to do this. |
82650e0 to
994b6e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for xUnit.v3, which uses the Microsoft Testing Protocol (MTP) with separate processes for test discovery and execution. To enable settings sharing between processes, the implementation serializes settings as an environment variable that reaches the execution process.
- Adds xUnit.v3 support with MTP compatibility
- Implements environment variable-based settings serialization for cross-process communication
- Creates new xUnit.v3 test classes mirroring the existing xUnit v2 structure
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| AssertionsBase.cs | Adds InternalsVisibleTo attribute for the new xUnit.v3 assembly |
| Playwright.sln | Includes the new Playwright.Xunit.v3 project in the solution |
| Playwright.Xunit.v3/*.cs | New xUnit.v3 test base classes (WorkerAwareTest, PlaywrightTest, PageTest, etc.) |
| Playwright.Xunit.v3.csproj | Project configuration for the xUnit.v3 package |
| PlaywrightSettingsProvider.cs | Adds environment variable-based settings serialization for MTP support |
| PlaywrightSettingsXml.cs | Changes properties from private setters to public setters for serialization |
| TestingHarnessTest files | Test infrastructure updates and comprehensive test coverage for xUnit.v3 |
Comments suppressed due to low confidence (1)
src/Playwright.TestingHarnessTest/Playwright.TestingHarnessTest.csproj:32
- The xunit.v3 package version "2.0.0" may not exist. Based on available information, xUnit v3 is still in development and stable releases typically follow semantic versioning. Consider verifying this version exists or using a pre-release version like "2.0.0-pre.1" if available.
<PackageReference Include="xunit.v3" Version="2.0.0" Condition="'$(TEST_MODE)' == 'xunit.v3'" />
994b6e8 to
7a890c6
Compare
|
@mxschmitt I noticed the NuGet package for this hasn't been pushed yet. Do you have an ETA of when that is taking place? |
You should be able to use the pre-release |
This PR adds support for xUnit.v3. The difference is that by default it uses MTP (Microsoft Testing Protocol) which means test discovery and execution are in two different processes. In order to workaround this we are serialising the settings as an environment variable which reaches the execution process later on. This seems like an acceptable workaround for now as per @nohwnd.
Context:
Fixes #3093