@@ -84,19 +84,19 @@ test.describe('Preflight Script Modal', () => {
8484 test ( 'logs show console/error information' , async ( { page, laboratory } ) => {
8585 await laboratory . setMonacoEditorContents ( 'preflight-editor' , script ) ;
8686 await page . locator ( '[data-cy="run-preflight"]' ) . click ( ) ;
87- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
88- 'log: Hello_world (1:1)' ,
89- ) ;
87+ await expect
88+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
89+ . toContain ( 'log: Hello_world (1:1)' ) ;
9090
9191 await laboratory . setMonacoEditorContents (
9292 'preflight-editor' ,
9393 `console.info(1); console.warn(true); console.error('Fatal'); throw new TypeError('Test')` ,
9494 ) ;
9595
9696 await page . locator ( '[data-cy="run-preflight"]' ) . click ( ) ;
97- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
98- 'log: Hello_world (1:1)' ,
99- ) ;
97+ await expect
98+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
99+ . toContain ( 'log: Hello_world (1:1)' ) ;
100100 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText ( 'info: 1' ) ;
101101 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText ( 'warn: true' ) ;
102102 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText ( 'error: Fatal' ) ;
@@ -107,9 +107,9 @@ test.describe('Preflight Script Modal', () => {
107107 await laboratory . setMonacoEditorContents ( 'preflight-editor' , script ) ;
108108
109109 await page . locator ( '[data-cy="run-preflight"]' ) . click ( ) ;
110- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
111- 'log: Hello_world (1:1)' ,
112- ) ;
110+ await expect
111+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
112+ . toContain ( 'log: Hello_world (1:1)' ) ;
113113
114114 await laboratory . setMonacoEditorContents (
115115 'preflight-editor' ,
@@ -122,19 +122,19 @@ test.describe('Preflight Script Modal', () => {
122122 ( form as HTMLFormElement ) . requestSubmit ( ) ;
123123 } ) ;
124124
125- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
126- 'log: Hello_world (1:1)' ,
127- ) ;
125+ await expect
126+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
127+ . toContain ( 'log: Hello_world (1:1)' ) ;
128128 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText ( 'info: test-username' ) ;
129129 } ) ;
130130
131131 test ( 'prompt and cancel' , async ( { page, laboratory } ) => {
132132 await laboratory . setMonacoEditorContents ( 'preflight-editor' , script ) ;
133133
134134 await page . locator ( '[data-cy="run-preflight"]' ) . click ( ) ;
135- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
136- 'log: Hello_world (1:1)' ,
137- ) ;
135+ await expect
136+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
137+ . toContain ( 'log: Hello_world (1:1)' ) ;
138138
139139 await laboratory . setMonacoEditorContents (
140140 'preflight-editor' ,
@@ -145,9 +145,9 @@ test.describe('Preflight Script Modal', () => {
145145 await page . locator ( '[data-cy="prompt"] input' ) . fill ( 'test-username' ) ;
146146 await page . locator ( '[data-cy="prompt-cancel"]' ) . click ( ) ;
147147
148- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
149- 'log: Hello_world (1:1)' ,
150- ) ;
148+ await expect
149+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
150+ . toContain ( 'log: Hello_world (1:1)' ) ;
151151 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText ( 'info: null' ) ;
152152 } ) ;
153153
@@ -167,9 +167,9 @@ test.describe('Preflight Script Modal', () => {
167167 'console.log(lab.CryptoJS.SHA256("test"))' ,
168168 ) ;
169169 await page . locator ( '[data-cy="run-preflight"]' ) . click ( ) ;
170- await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
171- 'info: Using crypto-js version:' ,
172- ) ;
170+ await expect
171+ . poll ( ( ) => page . locator ( '[data-cy="console-output"]' ) . textContent ( ) )
172+ . toContain ( 'info: Using crypto-js version:' ) ;
173173 await expect ( page . locator ( '[data-cy="console-output"]' ) ) . toContainText (
174174 'log: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' ,
175175 ) ;
0 commit comments