mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
smoke: trust dialog should appear in 5 seconds, and we can ignore if it doesn't
This commit is contained in:
parent
5b642616ef
commit
541a5d4fa7
|
@ -71,11 +71,7 @@ export class Application {
|
|||
async start(expectWalkthroughPart = true): Promise<any> {
|
||||
await this._start();
|
||||
await this.code.waitForElement('.explorer-folders-view');
|
||||
|
||||
if (!this.options.web) {
|
||||
// Dismiss workspace trust dialog
|
||||
await this.code.waitAndClick(`.monaco-workbench .dialog-buttons-row a:nth-child(1)`, 10, 10);
|
||||
}
|
||||
await this.dismissTrustDialog();
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/118748
|
||||
// if (expectWalkthroughPart) {
|
||||
|
@ -88,10 +84,19 @@ export class Application {
|
|||
await new Promise(c => setTimeout(c, 1000));
|
||||
await this._start(options.workspaceOrFolder, options.extraArgs);
|
||||
await this.code.waitForElement('.explorer-folders-view');
|
||||
await this.dismissTrustDialog();
|
||||
}
|
||||
|
||||
if (!this.options.web) {
|
||||
// Dismiss workspace trust dialog
|
||||
await this.code.waitAndClick(`.monaco-workbench .dialog-buttons-row a:nth-child(1)`, 10, 10);
|
||||
private async dismissTrustDialog(): Promise<void> {
|
||||
if (this.options.web) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Dismiss workspace trust dialog, if found
|
||||
await this.code.waitAndClick(`.monaco-workbench .dialog-buttons-row a:nth-child(1)`, 10, 10, 50);
|
||||
} catch {
|
||||
// there musn't be any trust dialog, maybe workspace is trusted?
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -307,9 +307,9 @@ export class Code {
|
|||
);
|
||||
}
|
||||
|
||||
async waitAndClick(selector: string, xoffset?: number, yoffset?: number): Promise<void> {
|
||||
async waitAndClick(selector: string, xoffset?: number, yoffset?: number, retryCount: number = 200): Promise<void> {
|
||||
const windowId = await this.getActiveWindowId();
|
||||
await poll(() => this.driver.click(windowId, selector, xoffset, yoffset), () => true, `click '${selector}'`);
|
||||
await poll(() => this.driver.click(windowId, selector, xoffset, yoffset), () => true, `click '${selector}'`, retryCount);
|
||||
}
|
||||
|
||||
async waitAndDoubleClick(selector: string): Promise<void> {
|
||||
|
|
Loading…
Reference in a new issue