mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-07 11:46:42 +03:00
fix(test-runner): don't add slow annotation twice (#31414)
This commit is contained in:
parent
2b12f53332
commit
47fb9a080d
@ -261,7 +261,7 @@ export class WorkerMain extends ProcessRunner {
|
||||
testInfo.expectedStatus = 'failed';
|
||||
break;
|
||||
case 'slow':
|
||||
testInfo.slow();
|
||||
testInfo._timeoutManager.slow();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
@ -690,3 +690,28 @@ test('static modifiers should be added in serial mode', async ({ runInlineTest }
|
||||
expect(result.report.suites[0].specs[2].tests[0].annotations).toEqual([{ type: 'skip' }]);
|
||||
expect(result.report.suites[0].specs[3].tests[0].annotations).toEqual([]);
|
||||
});
|
||||
|
||||
test('should contain only one slow modifier', async ({ runInlineTest }) => {
|
||||
const result = await runInlineTest({
|
||||
'slow.test.ts': `
|
||||
import { test } from '@playwright/test';
|
||||
test.slow();
|
||||
test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {});
|
||||
`,
|
||||
'skip.test.ts': `
|
||||
import { test } from '@playwright/test';
|
||||
test.skip();
|
||||
test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {});
|
||||
`,
|
||||
'fixme.test.ts': `
|
||||
import { test } from '@playwright/test';
|
||||
test.fixme();
|
||||
test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {});
|
||||
`,
|
||||
});
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.passed).toBe(1);
|
||||
expect(result.report.suites[0].specs[0].tests[0].annotations).toEqual([{ type: 'fixme' }, { type: 'issue', description: 'my-value' }]);
|
||||
expect(result.report.suites[1].specs[0].tests[0].annotations).toEqual([{ type: 'skip' }, { type: 'issue', description: 'my-value' }]);
|
||||
expect(result.report.suites[2].specs[0].tests[0].annotations).toEqual([{ type: 'slow' }, { type: 'issue', description: 'my-value' }]);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user