smoke - fix electron window timeout (#176012)

This commit is contained in:
Benjamin Pasero
2023-03-03 08:28:18 +01:00
committed by GitHub
parent b1948ed414
commit 8bd4a421c0
+3 -5
View File
@@ -17,12 +17,12 @@ export async function launch(options: LaunchOptions): Promise<{ electronProcess:
args.push('--enable-smoke-test-driver');
// Launch electron via playwright
const { electron, context, page, windowLoadedPromise } = await launchElectron({ electronPath, args, env }, options);
const { electron, context, page } = await launchElectron({ electronPath, args, env }, options);
const electronProcess = electron.process();
return {
electronProcess,
driver: new PlaywrightDriver(electron, context, page, undefined /* no server process */, windowLoadedPromise, options)
driver: new PlaywrightDriver(electron, context, page, undefined /* no server process */, Promise.resolve() /* Window is open already */, options)
};
}
@@ -35,8 +35,6 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
env: configuration.env as { [key: string]: string }
}), 'playwright-electron#launch', logger);
const windowLoadedPromise = electron.waitForEvent('window');
const window = await measureAndLog(() => electron.firstWindow(), 'playwright-electron#firstWindow', logger);
const context = window.context();
@@ -74,5 +72,5 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
}
});
return { electron, context, page: window, windowLoadedPromise };
return { electron, context, page: window };
}