diff --git a/test/automation/src/code.ts b/test/automation/src/code.ts index e8ad52540b5..4d0a74da4a8 100644 --- a/test/automation/src/code.ts +++ b/test/automation/src/code.ts @@ -254,6 +254,10 @@ export class Code { return this.driver.getLogs(); } + wait(millis: number): Promise { + return new Promise((resolve, reject) => setTimeout(resolve, millis)); + } + private async poll( fn: () => Promise, acceptFn: (result: T) => boolean, diff --git a/test/automation/src/quickaccess.ts b/test/automation/src/quickaccess.ts index 116f58b7747..a04ee52395c 100644 --- a/test/automation/src/quickaccess.ts +++ b/test/automation/src/quickaccess.ts @@ -171,15 +171,47 @@ export class QuickAccess { } async runCommand(commandId: string, keepOpen?: boolean): Promise { + let retries = 0; + let error; - // open commands picker - await this.openQuickAccessWithRetry(QuickAccessKind.Commands, `>${commandId}`); + while (true) { - // wait for best choice to be focused - await this.quickInput.waitForQuickInputElementFocused(); + if (++retries > 5) { + throw error ?? new Error(`Command: ${commandId} Not found`); + } + + // open commands picker + await this.openQuickAccessWithRetry(QuickAccessKind.Commands, `>${commandId}`); + + // wait for best choice to be focused + await this.quickInput.waitForQuickInputElementFocused(); + + // Retry for as long as the command not found + const text = await this.quickInput.waitForQuickInputElementText(); + if (text === 'No matching commands') { + this.code.logger.log(`QuickAccess: No matching commands, will retry...`); + await this.quickInput.closeQuickInput(); + await this.code.wait(1000); + continue; + } + + try { + // wait and click on best choice + await this.quickInput.selectQuickInputElement(0, keepOpen); + } catch (err) { + if (keepOpen) { + throw err; + } else { + error = err; + this.code.logger.log(`QuickAccess: Probably no matching commands, will retry...`); + await this.quickInput.closeQuickInput(); + continue; + } + } + + break; + } - // wait and click on best choice - await this.quickInput.selectQuickInputElement(0, keepOpen); } async openQuickOutline(): Promise { diff --git a/test/smoke/src/areas/extensions/extensions.test.ts b/test/smoke/src/areas/extensions/extensions.test.ts index bc65a8631c4..c78cbe87089 100644 --- a/test/smoke/src/areas/extensions/extensions.test.ts +++ b/test/smoke/src/areas/extensions/extensions.test.ts @@ -7,7 +7,7 @@ import { Application, Logger } from '../../../../automation'; import { installAllHandlers } from '../../utils'; export function setup(logger: Logger) { - describe.skip('Extensions', () => { + describe('Extensions', () => { // Shared before/after handling installAllHandlers(logger); diff --git a/test/smoke/src/areas/workbench/localization.test.ts b/test/smoke/src/areas/workbench/localization.test.ts index 865add9ae79..12e49ce549e 100644 --- a/test/smoke/src/areas/workbench/localization.test.ts +++ b/test/smoke/src/areas/workbench/localization.test.ts @@ -8,7 +8,7 @@ import { installAllHandlers } from '../../utils'; export function setup(logger: Logger) { - describe.skip('Localization', () => { + describe('Localization', () => { // Shared before/after handling installAllHandlers(logger);