@@ -57,26 +57,32 @@ module.exports = {
5757 // If it's an object, try to extract a numeric value or use empty string
5858 processValue = process . id || process . index || process . worker || ''
5959 }
60-
61- const processNum = parseInt ( processValue , 10 )
62- const processStr = ! isNaN ( processNum ) ? String ( processNum ) . padStart ( 2 , '0' ) : String ( processValue ) . padStart ( 2 , '0' )
63-
64- // Assign different colors to different workers for better identification
65- const workerColors = [
66- colors . cyan , // Worker 01 - Cyan
67- colors . magenta , // Worker 02 - Magenta
68- colors . green , // Worker 03 - Green
69- colors . yellow , // Worker 04 - Yellow
70- colors . blue , // Worker 05 - Blue
71- colors . red , // Worker 06 - Red
72- colors . white , // Worker 07 - White
73- colors . gray , // Worker 08 - Gray
74- ]
75- const workerIndex = ! isNaN ( processNum ) ? processNum - 1 : - 1
76- const colorFn = workerIndex >= 0 && workerColors [ workerIndex % workerColors . length ]
77- ? workerColors [ workerIndex % workerColors . length ]
78- : colors . cyan
79- outputProcess = colorFn . bold ( `[Worker ${ processStr } ]` )
60+
61+ // Check if this is a run-multiple process (contains : or .)
62+ // Format: "1.runName:browserName" from run-multiple
63+ if ( String ( processValue ) . includes ( ':' ) || ( String ( processValue ) . includes ( '.' ) && String ( processValue ) . split ( '.' ) . length > 1 ) ) {
64+ // Keep original format for run-multiple
65+ outputProcess = colors . cyan . bold ( `[${ processValue } ]` )
66+ } else {
67+ // Standard worker format for run-workers
68+ const processNum = parseInt ( processValue , 10 )
69+ const processStr = ! isNaN ( processNum ) ? String ( processNum ) . padStart ( 2 , '0' ) : String ( processValue ) . padStart ( 2 , '0' )
70+
71+ // Assign different colors to different workers for better identification
72+ const workerColors = [
73+ colors . cyan , // Worker 01 - Cyan
74+ colors . magenta , // Worker 02 - Magenta
75+ colors . green , // Worker 03 - Green
76+ colors . yellow , // Worker 04 - Yellow
77+ colors . blue , // Worker 05 - Blue
78+ colors . red , // Worker 06 - Red
79+ colors . white , // Worker 07 - White
80+ colors . gray , // Worker 08 - Gray
81+ ]
82+ const workerIndex = ! isNaN ( processNum ) ? processNum - 1 : - 1
83+ const colorFn = workerIndex >= 0 && workerColors [ workerIndex % workerColors . length ] ? workerColors [ workerIndex % workerColors . length ] : colors . cyan
84+ outputProcess = colorFn . bold ( `[Worker ${ processStr } ]` )
85+ }
8086 }
8187 return outputProcess
8288 } ,
@@ -176,14 +182,16 @@ module.exports = {
176182 * @param {Mocha.Test } test
177183 */
178184 started ( test ) {
179- const featureName = test . parent ?. title ? `${ colors . cyan . bold ( test . parent . title ) } › ` : ''
185+ // Only show feature name in workers mode (when outputProcess is set)
186+ const featureName = outputProcess && test . parent ?. title ? `${ colors . cyan . bold ( test . parent . title ) } › ` : ''
180187 print ( ` ${ featureName } ${ colors . magenta . bold ( test . title ) } ` )
181188 } ,
182189 /**
183190 * @param {Mocha.Test } test
184191 */
185192 passed ( test ) {
186- const featureName = test . parent ?. title ? `${ colors . cyan ( test . parent . title ) } › ` : ''
193+ // Only show feature name in workers mode (when outputProcess is set)
194+ const featureName = outputProcess && test . parent ?. title ? `${ colors . cyan ( test . parent . title ) } › ` : ''
187195 const scenarioName = colors . bold ( test . title )
188196 const executionTime = colors . cyan ( `in ${ test . duration } ms` )
189197 print ( ` ${ colors . green . bold ( figures . tick ) } ${ featureName } ${ scenarioName } ${ executionTime } ` )
@@ -192,7 +200,8 @@ module.exports = {
192200 * @param {Mocha.Test } test
193201 */
194202 failed ( test ) {
195- const featureName = test . parent ?. title ? `${ colors . yellow ( test . parent . title ) } › ` : ''
203+ // Only show feature name in workers mode (when outputProcess is set)
204+ const featureName = outputProcess && test . parent ?. title ? `${ colors . yellow ( test . parent . title ) } › ` : ''
196205 const scenarioName = colors . bold ( test . title )
197206 const executionTime = colors . yellow ( `in ${ test . duration } ms` )
198207 print ( ` ${ colors . red . bold ( figures . cross ) } ${ featureName } ${ scenarioName } ${ executionTime } ` )
@@ -201,7 +210,8 @@ module.exports = {
201210 * @param {Mocha.Test } test
202211 */
203212 skipped ( test ) {
204- const featureName = test . parent ?. title ? `${ colors . gray ( test . parent . title ) } › ` : ''
213+ // Only show feature name in workers mode (when outputProcess is set)
214+ const featureName = outputProcess && test . parent ?. title ? `${ colors . gray ( test . parent . title ) } › ` : ''
205215 const scenarioName = colors . bold ( test . title )
206216 print ( ` ${ colors . yellow . bold ( 'S' ) } ${ featureName } ${ scenarioName } ` )
207217 } ,
0 commit comments