smoke - update didFinishLoad solution (#175409)

This commit is contained in:
Benjamin Pasero
2023-02-25 06:17:19 +01:00
committed by GitHub
parent 42bfe4f68d
commit aa07f07339
2 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ export class Application {
private async checkWindowReady(code: Code): Promise<void> {
// We need a rendered workbench
// await measureAndLog(() => code.didFinishLoad(), 'Application#checkWindowReady: wait for navigation to be committed', this.logger); // TODO this seems to fail ever since utility process is on by default
await measureAndLog(() => code.didFinishLoad(), 'Application#checkWindowReady: wait for navigation to be committed', this.logger);
await measureAndLog(() => code.waitForElement('.monaco-workbench'), 'Application#checkWindowReady: wait for .monaco-workbench element', this.logger);
// Remote but not web: wait for a remote connection state change
+2 -5
View File
@@ -84,11 +84,8 @@ export class PlaywrightDriver {
return this.page.waitForLoadState('load');
}
// Desktop: via `window` event
return new Promise<void>(resolve => {
// https://playwright.dev/docs/api/class-electronapplication#electron-application-event-window
(this.application as playwright.ElectronApplication).on('window', () => resolve());
});
// Desktop: already loaded when `electron.firstWindow()` returns
return;
}
private async takeScreenshot(name: string): Promise<void> {