File tree 3 files changed +54
-1
lines changed 3 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ jobs:
554
554
- run : pnpm playwright:install
555
555
working-directory : site
556
556
557
- - run : pnpm playwright:test
557
+ - run : pnpm playwright:test --workers 1
558
558
env :
559
559
DEBUG : pw:api
560
560
working-directory : site
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from "@playwright/test"
2
2
import path from "path"
3
3
import { defaultPort , gitAuth } from "./constants"
4
+ import CoderReporter from "./reporter"
4
5
5
6
export const port = process . env . CODER_E2E_PORT
6
7
? Number ( process . env . CODER_E2E_PORT )
@@ -30,6 +31,7 @@ export default defineConfig({
30
31
timeout : 60000 ,
31
32
} ,
32
33
] ,
34
+ reporter : [ [ "./reporter.ts" ] ] ,
33
35
use : {
34
36
baseURL : `http://localhost:${ port } ` ,
35
37
video : "retain-on-failure" ,
Original file line number Diff line number Diff line change
1
+ import type {
2
+ Reporter ,
3
+ FullConfig ,
4
+ Suite ,
5
+ TestCase ,
6
+ TestResult ,
7
+ FullResult ,
8
+ } from "@playwright/test/reporter"
9
+
10
+ class CoderReporter implements Reporter {
11
+ onBegin ( config : FullConfig , suite : Suite ) {
12
+ // eslint-disable-next-line no-console -- Helpful for debugging
13
+ console . log ( `Starting the run with ${ suite . allTests ( ) . length } tests` )
14
+ }
15
+
16
+ onTestBegin ( test : TestCase ) {
17
+ // eslint-disable-next-line no-console -- Helpful for debugging
18
+ console . log ( `Starting test ${ test . title } ` )
19
+ }
20
+
21
+ onStdOut ( chunk : string , test : TestCase , _ : TestResult ) : void {
22
+ // eslint-disable-next-line no-console -- Helpful for debugging
23
+ console . log (
24
+ `[stdout] [${ test ? test . title : "unknown" } ]: ${ chunk . replace (
25
+ / \n $ / g,
26
+ "" ,
27
+ ) } `,
28
+ )
29
+ }
30
+
31
+ onStdErr ( chunk : string , test : TestCase , _ : TestResult ) : void {
32
+ // eslint-disable-next-line no-console -- Helpful for debugging
33
+ console . log (
34
+ `[stderr] [${ test ? test . title : "unknown" } ]: ${ chunk . replace (
35
+ / \n $ / g,
36
+ "" ,
37
+ ) } `,
38
+ )
39
+ }
40
+
41
+ onTestEnd ( test : TestCase , result : TestResult ) {
42
+ // eslint-disable-next-line no-console -- Helpful for debugging
43
+ console . log ( `Finished test ${ test . title } : ${ result . status } ` )
44
+ }
45
+
46
+ onEnd ( result : FullResult ) {
47
+ // eslint-disable-next-line no-console -- Helpful for debugging
48
+ console . log ( `Finished the run: ${ result . status } ` )
49
+ }
50
+ }
51
+ export default CoderReporter
You can’t perform that action at this time.
0 commit comments