File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,16 @@ const test = pwTest.extend<{
6767
6868 await testControl . page . pause ( ) ;
6969
70- const lastStep = await testControl . page
71- . locator ( "#stepsList li:last-of-type" )
72- . textContent ( ) ;
73-
7470 // If last step failed, throw error
75- if ( lastStep ! . includes ( "❌" ) ) {
76- throw new TestFailedError ( lastStep as string ) ;
71+ const hasFailed = await testControl . page . evaluate ( ( ) => {
72+ if ( ( window as any ) . testUtils . hasFailed ) {
73+ delete ( window as any ) . testUtils . hasFailed ;
74+ return true ;
75+ }
76+ return false ;
77+ } ) ;
78+ if ( hasFailed ) {
79+ throw new TestFailedError ( stepName as string ) ;
7780 }
7881 } ,
7982 { box : true }
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export default function TestControls() {
3434 className = "btn-danger"
3535 onClick = { ( ) => {
3636 dispatch ( { type : 'FAIL_STEP' , payload : failureReason || 'No failure reason provided' } ) ;
37+ ( window as any ) . testUtils . hasFailed = true ;
3738 ( window as any ) . playwright ?. resume ( ) ;
3839 setFailureReason ( '' ) ;
3940 trackButtonClick ( 'fail_step' ) ;
You can’t perform that action at this time.
0 commit comments