test(junit): expect native classname path separators (#44232)

The fileRoot test assumed forward slashes in `classname`, but JUnit preserves the native suite path. Use `path.join` for that assertion and keep the normalized `file` expectations unchanged. The existing test covers both direct and merged reports.

Fixes https://github.com/microsoft/playwright/issues/44225

<sub>Triaged on Windows by the Playwright bot - [agent run](https://github.com/microsoft/devops.playwright.dev/actions/runs/44562945812)</sub>

Co-authored-by: microsoft-playwright-automation[bot] <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
This commit is contained in:
microsoft-playwright-automation[bot]
2026-11-19 10:04:23 -07:00
committed by GitHub
parent 9db10d458f
commit e528ef8ccd
+5 -2
View File
@@ -348,7 +348,10 @@ for (const useIntermediateMergeReport of [false, true] as const) {
});
test('should add file attribute relative to fileRoot', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/44099' },
annotation: [
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/44099' },
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/44225' },
],
}, async ({ runInlineTest }) => {
const files = {
'packages/foo/playwright.config.ts': `
@@ -371,7 +374,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
};
const byDefault = await run({});
expect(byDefault['classname']).toBe('auth/a.test.js');
expect(byDefault['classname']).toBe(path.join('auth', 'a.test.js'));
expect(byDefault['file']).toBe('src/auth/a.test.js');
// The option is relative to the config directory.