diff --git a/test/smoke/src/areas/common.ts b/test/smoke/src/areas/common.ts index 33127905ec6..96515d7ca49 100644 --- a/test/smoke/src/areas/common.ts +++ b/test/smoke/src/areas/common.ts @@ -19,7 +19,7 @@ export class CommonActions { public async getWindowTitle(): Promise { return this.spectron.client.getTitle(); } - + public enter(): Promise { return this.spectron.client.keys(['Enter', 'NULL']); } @@ -34,7 +34,7 @@ export class CommonActions { await this.spectron.wait(); return this.saveOpenedFile(); } - + public async newUntitledFile(): Promise { await this.spectron.command('workbench.action.files.newUntitledFile'); return this.spectron.wait(); @@ -45,12 +45,14 @@ export class CommonActions { } public async getTab(tabName: string, active?: boolean): Promise { + await this.spectron.command('workbench.action.closeMessages'); // close any notification messages that could overlap tabs + let tabSelector = active ? '.tab.active' : 'div'; let el = await this.spectron.client.element(`.tabs-container ${tabSelector}[aria-label="${tabName}, tab"]`); if (el.status === 0) { return el; } - + return undefined; } @@ -118,7 +120,7 @@ export class CommonActions { selector += ' explorer-item'; } selector += '"]'; - + await this.spectron.waitFor(this.spectron.client.doubleClick, selector); return this.spectron.wait(); } @@ -132,7 +134,7 @@ export class CommonActions { } else if (extension === 'md') { return 'md-ext-file-icon markdown-lang-file-icon'; } - + throw new Error('No class defined for this file extension'); } @@ -142,7 +144,7 @@ export class CommonActions { if (Array.isArray(span)) { return span[0]; } - + return span; } catch (e) { return undefined; diff --git a/test/smoke/src/tests/data-migration.ts b/test/smoke/src/tests/data-migration.ts index 4b8e627bcfe..68c4f698b7e 100644 --- a/test/smoke/src/tests/data-migration.ts +++ b/test/smoke/src/tests/data-migration.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; -import { SpectronApplication, USER_DIR, STABLE_PATH, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { SpectronApplication, USER_DIR, STABLE_PATH, LATEST_PATH, WORKSPACE_PATH, EXTENSIONS_DIR } from "../spectron/application"; import { CommonActions } from '../areas/common'; let app: SpectronApplication; @@ -20,11 +20,12 @@ export function testDataMigration() { afterEach(async function () { await app.stop(); - return await common.removeDirectory(USER_DIR) + await common.removeDirectory(USER_DIR); + return await common.removeDirectory(EXTENSIONS_DIR); }); function setupSpectron(context: Mocha.ITestCallbackContext, appPath: string, workspace?: string[]): void { - app = new SpectronApplication(appPath, context.test.fullTitle(), context.test.currentRetry(), workspace, [`--user-data-dir=${USER_DIR}`]); + app = new SpectronApplication(appPath, context.test.fullTitle(), context.test.currentRetry(), workspace, [`--user-data-dir=${USER_DIR}`, `--extensions-dir=${EXTENSIONS_DIR}`]); common = new CommonActions(app); }