bug(artifacts) Fix generic screenshot paths causing collisions in multi-sharded DevOps builds
Append the sanitized test name to the automatic screenshot mechanism of Playwright.
Why?
Currently the names are very generic and cause conflicts in CI/CD Systems like Azure Devops when we have multiple jobs failing with the same generic name:
It's also not very clear which number responds to which testcase when we are able to upload:
Fix!
Added the sanitized file name, a good example of how this looks like are the fixed unit tests :
Test results for "tests 1"
10 failed :x: [playwright-test] › reporter-junit.spec.ts:310:9 › created › should render existing attachments, but not missing ones @macos-latest-node18-1 :x: [playwright-test] › reporter-junit.spec.ts:337:9 › created › should render attachment paths relative to report file when report file name is specified @macos-latest-node18-1 :x: [playwright-test] › reporter-junit.spec.ts:310:9 › created › should render existing attachments, but not missing ones @ubuntu-latest-node18-1 :x: [playwright-test] › reporter-junit.spec.ts:337:9 › created › should render attachment paths relative to report file when report file name is specified @ubuntu-latest-node18-1 :x: [playwright-test] › reporter-junit.spec.ts:310:9 › created › should render existing attachments, but not missing ones @ubuntu-latest-node20-1 :x: [playwright-test] › reporter-junit.spec.ts:337:9 › created › should render attachment paths relative to report file when report file name is specified @ubuntu-latest-node20-1 :x: [playwright-test] › reporter-junit.spec.ts:310:9 › created › should render existing attachments, but not missing ones @ubuntu-latest-node22-1 :x: [playwright-test] › reporter-junit.spec.ts:337:9 › created › should render attachment paths relative to report file when report file name is specified @ubuntu-latest-node22-1 :x: [playwright-test] › reporter-junit.spec.ts:310:9 › created › should render existing attachments, but not missing ones @windows-latest-node18-1 :x: [playwright-test] › reporter-junit.spec.ts:337:9 › created › should render attachment paths relative to report file when report file name is specified @windows-latest-node18-1
1 flaky
:warning: [playwright-test] › ui-mode-test-setup.spec.ts:98:5 › should show errors in config @macos-latest-node18-135951 passed, 624 skipped :heavy_check_mark::heavy_check_mark::heavy_check_mark:
Merge workflow run.
@mastrzyz Could you please file an issue first? I've got a bunch of questions, and we prefer to discuss things in an issue rather than in a PR, for better discoverability in the future. Thank you!
Closing as per above - lets continue the discussion in https://github.com/microsoft/playwright/issues/33143 for now.