1
+ function getTimestamp ( ) {
2
+ return ( process . env . CI || process . env . VERBOSE )
3
+ ? new Date ( ) . toLocaleTimeString ( 'en-US' , { hour12 : false } )
4
+ : '' ;
5
+ }
6
+
7
+ function logStamp ( ...args ) {
8
+ console . log ( getTimestamp ( ) , ...args ) ;
9
+ }
10
+
1
11
class CleanReporter {
2
12
onBegin ( config , suite ) {
3
13
console . log ( `\n🎭 Running ${ suite . allTests ( ) . length } tests...\n` ) ;
@@ -15,9 +25,9 @@ class CleanReporter {
15
25
. trim ( ) ;
16
26
17
27
if ( result . status === "passed" ) {
18
- console . log ( `✅ ${ cleanSuite } : ${ testName } ` ) ;
28
+ logStamp ( `✅ ${ cleanSuite } : ${ testName } ` ) ;
19
29
} else if ( result . status === "failed" ) {
20
- console . log ( `❌ ${ cleanSuite } : ${ testName } ` ) ;
30
+ logStamp ( `❌ ${ cleanSuite } : ${ testName } ` ) ;
21
31
22
32
// Extract the most relevant error info
23
33
const error = result . error || result . errors ?. [ 0 ] ;
@@ -60,15 +70,17 @@ class CleanReporter {
60
70
61
71
onEnd ( result ) {
62
72
console . log ( "\n" + "=" . repeat ( 60 ) ) ;
63
- console . log ( `📊 TEST SUMMARY` ) ;
73
+ logStamp ( `📊 TEST SUMMARY` ) ;
64
74
console . log ( "=" . repeat ( 60 ) ) ;
65
75
66
76
console . log ( `\n🔍 FAILURE ANALYSIS:` ) ;
67
77
console . log ( `• Most failures appear to be AI service related` ) ;
68
78
console . log ( `• Check API keys and service availability` ) ;
69
- console . log (
70
- `• Run 'pnpm exec playwright show-report' for detailed HTML report`
71
- ) ;
79
+ if ( ! process . env . CI ) {
80
+ console . log (
81
+ `• Run 'pnpm exec playwright show-report' for detailed HTML report`
82
+ ) ;
83
+ }
72
84
73
85
console . log ( "=" . repeat ( 60 ) + "\n" ) ;
74
86
}
0 commit comments