File tree 1 file changed +26
-0
lines changed 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,32 @@ export class CodeServerPage {
282
282
this . codeServer . logger . debug ( "Editor is ready!" )
283
283
}
284
284
285
+ /**
286
+ * Checks if the test extension has loaded
287
+ *
288
+ * Reload until both checks pass
289
+ */
290
+ async reloadUntilTestExtensionIsLoaded ( ) {
291
+ this . codeServer . logger . debug ( "Waiting for test extenion to load..." )
292
+
293
+ const extensionIsLoaded = await this . isTestExtensionLoaded ( )
294
+ let reloadCount = 0
295
+
296
+ while ( ! extensionIsLoaded ) {
297
+ await this . page . waitForLoadState ( "load" )
298
+ // Give it an extra second just in case it's feeling extra slow
299
+ await this . page . waitForTimeout ( 1000 )
300
+ reloadCount += 1
301
+ if ( await this . isTestExtensionLoaded ( ) ) {
302
+ this . codeServer . logger . debug ( `test extension loaded after ${ reloadCount } reloads` )
303
+ break
304
+ }
305
+ await this . page . reload ( )
306
+ }
307
+
308
+ this . codeServer . logger . debug ( "Test extenion has loaded!" )
309
+ }
310
+
285
311
/**
286
312
* Checks if the editor is visible
287
313
*/
You can’t perform that action at this time.
0 commit comments