From 2616f4e43e3fc4202449fff0921a749f03a08254 Mon Sep 17 00:00:00 2001 From: Allie Mims Date: Tue, 4 Feb 2025 10:15:16 -0500 Subject: [PATCH] Add temporary atomic debug reporter --- tests/e2e-pw/atomic-debug-reporter.ts | 34 +++++++++++++++++++++++++++ tests/e2e-pw/playwright.config.ts | 1 + 2 files changed, 35 insertions(+) create mode 100644 tests/e2e-pw/atomic-debug-reporter.ts diff --git a/tests/e2e-pw/atomic-debug-reporter.ts b/tests/e2e-pw/atomic-debug-reporter.ts new file mode 100644 index 00000000000..200c24e3743 --- /dev/null +++ b/tests/e2e-pw/atomic-debug-reporter.ts @@ -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; diff --git a/tests/e2e-pw/playwright.config.ts b/tests/e2e-pw/playwright.config.ts index 45c2e86fd1f..3a24a85ee10 100644 --- a/tests/e2e-pw/playwright.config.ts +++ b/tests/e2e-pw/playwright.config.ts @@ -62,6 +62,7 @@ export default defineConfig( { [ 'github' ], [ 'json', { outputFile: 'results.json' } ], [ 'html' ], + [ './atomic-debug-reporter.ts' ], ] : [ [ 'html', { open: 'never' } ] ], outputDir: './test-results',