Skip to content

Attachments are saved to build-dir, not test-results #201

@asgr-sydbank

Description

@asgr-sydbank

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

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions