smoke - remove timeout from launches (#177204)

This commit is contained in:
Benjamin Pasero 2023-03-15 13:35:17 +01:00 committed by GitHub
parent ce5c586128
commit 2c3a648d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 18 deletions

View file

@ -25,10 +25,6 @@ export class BrowserWindowDriver implements IWindowDriver {
inputElement.dispatchEvent(event);
}
async getTitle(): Promise<string> {
return document.title;
}
async isActiveElement(selector: string): Promise<boolean> {
const element = document.querySelector(selector);
@ -198,14 +194,6 @@ export class BrowserWindowDriver implements IWindowDriver {
return { x, y };
}
click(selector: string, xoffset?: number, yoffset?: number): Promise<void> {
// This is actually not used in the playwright drivers
// that can implement `click` natively via the driver
throw new Error('Method not implemented.');
}
async exitApplication(): Promise<void> {
// No-op in web
}

View file

@ -28,9 +28,7 @@ export interface ILocalizedStrings {
}
export interface IWindowDriver {
click(selector: string, xoffset?: number | undefined, yoffset?: number | undefined): Promise<void>;
setValue(selector: string, text: string): Promise<void>;
getTitle(): Promise<string>;
isActiveElement(selector: string): Promise<boolean>;
getElements(selector: string, recursive: boolean): Promise<IElement[]>;
getElementXY(selector: string, xoffset?: number, yoffset?: number): Promise<{ x: number; y: number }>;

View file

@ -88,7 +88,11 @@ async function launchServer(options: LaunchOptions) {
async function launchBrowser(options: LaunchOptions, endpoint: string) {
const { logger, workspacePath, tracing, headless } = options;
const browser = await measureAndLog(() => playwright[options.browser ?? 'chromium'].launch({ headless: headless ?? false }), 'playwright#launch', logger);
const browser = await measureAndLog(() => playwright[options.browser ?? 'chromium'].launch({
headless: headless ?? false,
timeout: 0
}), 'playwright#launch', logger);
browser.on('disconnected', () => logger.log(`Playwright: browser disconnected`));
const context = await measureAndLog(() => browser.newContext(), 'browser.newContext', logger);

View file

@ -171,7 +171,7 @@ export class PlaywrightDriver {
}
async getTitle() {
return this.evaluateWithDriver(([driver]) => driver.getTitle());
return this.page.title();
}
async isActiveElement(selector: string) {

View file

@ -32,7 +32,8 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
const electron = await measureAndLog(() => playwright._electron.launch({
executablePath: configuration.electronPath,
args: configuration.args,
env: configuration.env as { [key: string]: string }
env: configuration.env as { [key: string]: string },
timeout: 0
}), 'playwright-electron#launch', logger);
const window = await measureAndLog(() => electron.firstWindow(), 'playwright-electron#firstWindow', logger);

View file

@ -35,7 +35,7 @@ export class Search extends Viewlet {
async clearSearchResults(): Promise<void> {
await retry(
() => this.code.waitAndClick(`.sidebar .codicon-search-clear-results`),
() => this.code.waitAndClick(`.sidebar .title-actions .codicon-search-clear-results`),
() => this.waitForNoResultText(10));
}