Smoke tests: take wait time as argument

This commit is contained in:
Sandeep Somavarapu
2017-10-04 15:07:35 +02:00
parent aaf3c31b6f
commit 1d080314ef
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -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';
+1
View File
@@ -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,
+3 -2
View File
@@ -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<any> {