Describe the bug
I'm using the Junit-logger with Playwright Dotnet, and my file-attachments are not added to the test-results directory. The references to file-attachments in my junit test-report are absolute paths based on the harddrive of my machine, and for that reason can't be packaged up and used for test-results in systems like Azure Pipelines.
-
Test Framework (choose one): MSTest
-
.NET project version, sdk version (choose applicable): net8.0/net9.0
-
Command line used (please share the test run command):
- create project:
dotnet new mstest-playwright -n test-pw-junit
- add screenshot-code to test-example:
await Page.ScreenshotAsync(new(){Path = "stuff.jpeg"});TestContext.AddResultFile("stuff.jpeg");
- run tests:
dotnet test --logger:junit --results-directory ./test-results
-
OS: Windows
Expected behavior
I expect Stuff.jpeg to be added to the test-results-directory, and the reference from the junit-report to have a relative path to that file.
Other details
Additional context
If the commands are confusing or strange, I can create an SSCCE

Describe the bug
I'm using the Junit-logger with Playwright Dotnet, and my file-attachments are not added to the test-results directory. The references to file-attachments in my junit test-report are absolute paths based on the harddrive of my machine, and for that reason can't be packaged up and used for test-results in systems like Azure Pipelines.
Test Framework (choose one): MSTest
.NET project version, sdk version (choose applicable): net8.0/net9.0
Command line used (please share the test run command):
dotnet new mstest-playwright -n test-pw-junitawait Page.ScreenshotAsync(new(){Path = "stuff.jpeg"});TestContext.AddResultFile("stuff.jpeg");dotnet test --logger:junit --results-directory ./test-resultsOS: Windows
Expected behavior
I expect
Stuff.jpegto be added to thetest-results-directory, and the reference from the junit-report to have a relative path to that file.Other details
dotnet test --diag:log.txtto the issue. Please redact any confidential info from the logs before attaching. See https://github.com/spekt/testlogger/wiki/Collecting-vstest-logsAdditional context
If the commands are confusing or strange, I can create an SSCCE