diff --git a/packages/playwright-test/src/reporters/junit.ts b/packages/playwright-test/src/reporters/junit.ts index ec13e87e9d..32eaa21b78 100644 --- a/packages/playwright-test/src/reporters/junit.ts +++ b/packages/playwright-test/src/reporters/junit.ts @@ -191,11 +191,10 @@ class JUnitReporter implements Reporter { if (!attachment.path) continue; try { - const attachmentPath = path.relative(this.config.rootDir, attachment.path); - if (fs.existsSync(attachmentPath)) - contents = fs.readFileSync(attachmentPath, { encoding: 'base64' }); + if (fs.existsSync(attachment.path)) + contents = fs.readFileSync(attachment.path, { encoding: 'base64' }); else - systemErr.push(`\nWarning: attachment ${attachmentPath} is missing`); + systemErr.push(`\nWarning: attachment ${attachment.path} is missing`); } catch (e) { } }