Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test(test runner): check custom reporter with .only tests (#7862)

Dmitry Gozmancb978848d9a6
diff --git a/tests/playwright-test/reporter.spec.ts b/tests/playwright-test/reporter.spec.ts
index 23b23d8a89..ef153fb88c 100644
--- a/tests/playwright-test/reporter.spec.ts
+++ b/tests/playwright-test/reporter.spec.ts
@@ -84,7 +84,11 @@ test('should work with custom reporter', async ({ runInlineTest }) => {
`,
'a.test.ts': `
const { test } = pwt;
- test('pass', async ({}) => {
+ test('not run', async ({}) => {
+ console.log('log');
+ console.error('error');
+ });
+ test.only('is run', async ({}) => {
console.log('log');
console.error('error');
});
@@ -94,18 +98,18 @@ test('should work with custom reporter', async ({ runInlineTest }) => {
expect(result.exitCode).toBe(0);
expect(result.output.split('\n').filter(line => line.startsWith('%%'))).toEqual([
'%%reporter-begin-begin%%',
- '%%reporter-testbegin-pass-foo%%',
+ '%%reporter-testbegin-is run-foo%%',
'%%reporter-stdout%%',
'%%reporter-stderr%%',
- '%%reporter-testend-pass-foo%%',
- '%%reporter-testbegin-pass-foo%%',
+ '%%reporter-testend-is run-foo%%',
+ '%%reporter-testbegin-is run-foo%%',
'%%reporter-stdout%%',
'%%reporter-stderr%%',
- '%%reporter-testend-pass-foo%%',
- '%%reporter-testbegin-pass-bar%%',
+ '%%reporter-testend-is run-foo%%',
+ '%%reporter-testbegin-is run-bar%%',
'%%reporter-stdout%%',
'%%reporter-stderr%%',
- '%%reporter-testend-pass-bar%%',
+ '%%reporter-testend-is run-bar%%',
'%%reporter-end-end%%',
]);
});