diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 0c340e52f52..31dbaf71149 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -17,7 +17,7 @@ const testDataPath = tmpDir.name; process.once('exit', () => rimraf.sync(testDataPath)); const [, , ...args] = process.argv; -const opts = minimist(args, { string: ['build', 'stable-build', 'screenshots'] }); +const opts = minimist(args, { string: ['build', 'stable-build', 'screenshots', 'wait-time'] }); opts.screenshots = opts.screenshots === '' ? path.join(testDataPath, 'screenshots') : opts.screenshots; @@ -99,6 +99,7 @@ process.env.SMOKETEST_REPO = testRepoLocalDir; process.env.VSCODE_WORKSPACE_PATH = workspacePath; process.env.VSCODE_KEYBINDINGS_PATH = keybindingsPath; process.env.SCREENSHOTS_DIR = opts.screenshots || ''; +process.env.WAIT_TIME = opts['wait-time'] || '20'; if (process.env.VSCODE_DEV === '1') { process.env.VSCODE_EDITION = 'dev'; diff --git a/test/smoke/src/spectron/application.ts b/test/smoke/src/spectron/application.ts index 3003ad88773..77ef6fd4207 100644 --- a/test/smoke/src/spectron/application.ts +++ b/test/smoke/src/spectron/application.ts @@ -20,6 +20,7 @@ export const USER_DIR = process.env.VSCODE_USER_DIR as string; export const EXTENSIONS_DIR = process.env.VSCODE_EXTENSIONS_DIR as string; export const VSCODE_EDITION = process.env.VSCODE_EDITION as string; export const SCREENSHOTS_DIR = process.env.SCREENSHOTS_DIR as string; +export const WAIT_TIME = parseInt(process.env.WAIT_TIME as string); export enum VSCODE_BUILD { DEV, diff --git a/test/smoke/src/spectron/client.ts b/test/smoke/src/spectron/client.ts index 7450ff9375b..66c32d1794d 100644 --- a/test/smoke/src/spectron/client.ts +++ b/test/smoke/src/spectron/client.ts @@ -5,7 +5,7 @@ import { Application } from 'spectron'; import { RawResult, Element } from 'webdriverio'; -import { SpectronApplication } from './application'; +import { SpectronApplication, WAIT_TIME } from './application'; /** * Abstracts the Spectron's WebdriverIO managed client property on the created Application instances. @@ -14,10 +14,11 @@ export class SpectronClient { // waitFor calls should not take more than 200 * 100 = 20 seconds to complete, excluding // the time it takes for the actual retry call to complete - private readonly retryCount = 200; + private readonly retryCount; private readonly retryDuration = 100; // in milliseconds constructor(public spectron: Application, private application: SpectronApplication) { + this.retryCount = (WAIT_TIME * 1000) / this.retryDuration; } public windowByIndex(index: number): Promise {