Skip to content

Commit

Permalink
Add temporary atomic debug reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
allie500 committed Feb 4, 2025
1 parent ecfe6c3 commit 2616f4e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/e2e-pw/atomic-debug-reporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable no-console */
/**
* External dependencies
*/
import type {
FullConfig,
FullResult,
Reporter,
Suite,
TestCase,
TestResult,
} from '@playwright/test/reporter';

class AtomicDebugReporter implements Reporter {
onBegin( config: FullConfig, suite: Suite ) {
console.log(
`Starting the run with ${ suite.allTests().length } tests`
);
}

onTestBegin( test: TestCase ) {
console.log( `Starting test ${ test.title }` );
}

onTestEnd( test: TestCase, result: TestResult ) {
console.log( `Finished test ${ test.title }: ${ result.status }` );
}

onEnd( result: FullResult ) {
console.log( `Finished the run: ${ result.status }` );
}
}

export default AtomicDebugReporter;
1 change: 1 addition & 0 deletions tests/e2e-pw/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default defineConfig( {
[ 'github' ],
[ 'json', { outputFile: 'results.json' } ],
[ 'html' ],
[ './atomic-debug-reporter.ts' ],
]
: [ [ 'html', { open: 'never' } ] ],
outputDir: './test-results',
Expand Down

0 comments on commit 2616f4e

Please sign in to comment.