From 041e4d9b1f5b7af61b5f4435e0a799f079bdf668 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 23 Feb 2021 19:04:47 +0100 Subject: [PATCH] fix smoke tests with stable build (fix #117420) --- test/automation/src/application.ts | 7 ++++++- test/automation/src/code.ts | 6 +++++- test/automation/src/settings.ts | 2 +- test/automation/tsconfig.json | 2 +- test/smoke/src/areas/workbench/data-migration.test.ts | 4 +++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/test/automation/src/application.ts b/test/automation/src/application.ts index 35ee19cc0c5..809b3c2b2e4 100644 --- a/test/automation/src/application.ts +++ b/test/automation/src/application.ts @@ -73,7 +73,12 @@ export class Application { await this.code.waitForElement('.explorer-folders-view'); if (expectWalkthroughPart) { - await this.code.waitForElement(`.editor-instance > div > div.welcomePageFocusElement[tabIndex="0"]`); + if (this.quality === Quality.Stable) { + // TODO@bpasero remove me in March 2021 + await this.code.waitForActiveElement(`.editor-instance[data-editor-id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`); + } else { + await this.code.waitForElement(`.editor-instance > div > div.welcomePageFocusElement[tabIndex="0"]`); + } } } diff --git a/test/automation/src/code.ts b/test/automation/src/code.ts index 719598b188e..a89fc10e88a 100644 --- a/test/automation/src/code.ts +++ b/test/automation/src/code.ts @@ -145,6 +145,10 @@ export async function spawn(options: SpawnOptions): Promise { '--driver', handle ]; + if (process.platform === 'linux') { + args.push('--disable-gpu'); // Linux has trouble in VMs to render properly with GPU enabled + } + if (options.remote) { // Replace workspace path with URI args[0] = `--${options.workspacePath.endsWith('.code-workspace') ? 'file' : 'folder'}-uri=vscode-remote://test+test/${URI.file(options.workspacePath).path}`; @@ -199,7 +203,7 @@ async function copyExtension(extensionsPath: string, extId: string): Promise ncp(orig, dest, err => err ? e(err) : c())); + await new Promise((c, e) => ncp(orig, dest, err => err ? e(err) : c())); } } diff --git a/test/automation/src/settings.ts b/test/automation/src/settings.ts index 914cb8113c2..1e5e586cf5f 100644 --- a/test/automation/src/settings.ts +++ b/test/automation/src/settings.ts @@ -25,7 +25,7 @@ export class SettingsEditor { async clearUserSettings(): Promise { const settingsPath = path.join(this.userDataPath, 'User', 'settings.json'); - await new Promise((c, e) => fs.writeFile(settingsPath, '{\n}', 'utf8', err => err ? e(err) : c())); + await new Promise((c, e) => fs.writeFile(settingsPath, '{\n}', 'utf8', err => err ? e(err) : c())); await this.openSettings(); await this.editor.waitForEditorContents('settings.json', c => c === '{}'); diff --git a/test/automation/tsconfig.json b/test/automation/tsconfig.json index 24deb99ddf8..a923ad396f9 100644 --- a/test/automation/tsconfig.json +++ b/test/automation/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es2016", + "target": "es2017", "strict": true, "noUnusedParameters": false, "noUnusedLocals": true, diff --git a/test/smoke/src/areas/workbench/data-migration.test.ts b/test/smoke/src/areas/workbench/data-migration.test.ts index 8186847be96..7b8e86c7785 100644 --- a/test/smoke/src/areas/workbench/data-migration.test.ts +++ b/test/smoke/src/areas/workbench/data-migration.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Application, ApplicationOptions } from '../../../../automation'; +import { Application, ApplicationOptions, Quality } from '../../../../automation'; import { join } from 'path'; export function setup(stableCodePath: string, testDataPath: string) { @@ -19,6 +19,7 @@ export function setup(stableCodePath: string, testDataPath: string) { const stableOptions: ApplicationOptions = Object.assign({}, this.defaultOptions); stableOptions.codePath = stableCodePath; stableOptions.userDataDir = userDataDir; + stableOptions.quality = Quality.Stable; const stableApp = new Application(stableOptions); await stableApp!.start(); @@ -58,6 +59,7 @@ export function setup(stableCodePath: string, testDataPath: string) { const stableOptions: ApplicationOptions = Object.assign({}, this.defaultOptions); stableOptions.codePath = stableCodePath; stableOptions.userDataDir = userDataDir; + stableOptions.quality = Quality.Stable; const stableApp = new Application(stableOptions); await stableApp!.start();