From aa07f0733910ac048fafbc7137f4ac0748274963 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 25 Feb 2023 06:17:19 +0100 Subject: [PATCH] smoke - update `didFinishLoad` solution (#175409) --- test/automation/src/application.ts | 2 +- test/automation/src/playwrightDriver.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/automation/src/application.ts b/test/automation/src/application.ts index e6e149dd0fe..83e7a76ace7 100644 --- a/test/automation/src/application.ts +++ b/test/automation/src/application.ts @@ -117,7 +117,7 @@ export class Application { private async checkWindowReady(code: Code): Promise { // 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 diff --git a/test/automation/src/playwrightDriver.ts b/test/automation/src/playwrightDriver.ts index 3425d11a74c..1e4c14e415e 100644 --- a/test/automation/src/playwrightDriver.ts +++ b/test/automation/src/playwrightDriver.ts @@ -84,11 +84,8 @@ export class PlaywrightDriver { return this.page.waitForLoadState('load'); } - // Desktop: via `window` event - return new Promise(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 {