@@ -23,11 +23,49 @@ const Codecept = require(process.env.CODECEPT_CLASS_PATH || '../../codecept')
23
23
const { options, tests, testRoot, workerIndex, poolMode } = workerData
24
24
25
25
// hide worker output
26
- if ( ! options . debug && ! options . verbose )
26
+ // In pool mode, only suppress output if debug is NOT enabled
27
+ // In regular mode, hide result output but allow step output in verbose/debug
28
+ if ( poolMode && ! options . debug ) {
29
+ // In pool mode without debug, suppress only result summaries and failures, but allow Scenario Steps
30
+ const originalWrite = process . stdout . write
31
+ process . stdout . write = string => {
32
+ // Always allow Scenario Steps output
33
+ if ( string . includes ( 'Scenario Steps:' ) ) {
34
+ return originalWrite . call ( process . stdout , string )
35
+ }
36
+ if ( string . includes ( ' FAIL |' ) || string . includes ( ' OK |' ) || string . includes ( '-- FAILURES:' ) || string . includes ( 'AssertionError:' ) || string . includes ( '◯ File:' ) ) {
37
+ return true
38
+ }
39
+ return originalWrite . call ( process . stdout , string )
40
+ }
41
+ } else if ( ! poolMode && ! options . debug && ! options . verbose ) {
27
42
process . stdout . write = string => {
28
43
stdout += string
29
44
return true
30
45
}
46
+ } else {
47
+ // In verbose/debug mode for test/suite modes, show step details
48
+ // but suppress individual worker result summaries to avoid duplicate output
49
+ const originalWrite = process . stdout . write
50
+ const originalConsoleLog = console . log
51
+
52
+ process . stdout . write = string => {
53
+ // Suppress individual worker result summaries and failure reports
54
+ if ( string . includes ( ' FAIL |' ) || string . includes ( ' OK |' ) || string . includes ( '-- FAILURES:' ) || string . includes ( 'AssertionError:' ) || string . includes ( '◯ File:' ) || string . includes ( '◯ Scenario Steps:' ) ) {
55
+ return true
56
+ }
57
+ return originalWrite . call ( process . stdout , string )
58
+ }
59
+
60
+ // Override console.log to catch result summaries
61
+ console . log = ( ...args ) => {
62
+ const fullMessage = args . join ( ' ' )
63
+ if ( fullMessage . includes ( ' FAIL |' ) || fullMessage . includes ( ' OK |' ) || fullMessage . includes ( '-- FAILURES:' ) ) {
64
+ return
65
+ }
66
+ return originalConsoleLog . apply ( console , args )
67
+ }
68
+ }
31
69
32
70
const overrideConfigs = tryOrDefault ( ( ) => JSON . parse ( options . override ) , { } )
33
71
0 commit comments