diff --git a/test/smoke/src/application.ts b/test/smoke/src/application.ts index d7505a0816e..02b0f051f9f 100644 --- a/test/smoke/src/application.ts +++ b/test/smoke/src/application.ts @@ -17,7 +17,6 @@ export const enum Quality { export interface ApplicationOptions extends SpawnOptions { quality: Quality; workspacePath: string; - workspaceFilePath: string; waitTime: number; } @@ -56,10 +55,6 @@ export class Application { return this.options.userDataDir; } - get workspaceFilePath(): string { - return this.options.workspaceFilePath; - } - async start(): Promise { await this._start(); await this.code.waitForElement('.explorer-folders-view'); diff --git a/test/smoke/src/areas/multiroot/multiroot.test.ts b/test/smoke/src/areas/multiroot/multiroot.test.ts index 86449f54858..c2e26abaa08 100644 --- a/test/smoke/src/areas/multiroot/multiroot.test.ts +++ b/test/smoke/src/areas/multiroot/multiroot.test.ts @@ -3,17 +3,44 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; +import * as path from 'path'; import { Application } from '../../application'; +function toUri(path: string): string { + if (process.platform === 'win32') { + return `${path.replace(/\\/g, '/')}`; + } + + return `${path}`; +} + +async function createWorkspaceFile(workspacePath: string): Promise { + const workspaceFilePath = path.join(path.dirname(workspacePath), 'smoketest.code-workspace'); + const workspace = { + folders: [ + { path: toUri(path.join(workspacePath, 'public')) }, + { path: toUri(path.join(workspacePath, 'routes')) }, + { path: toUri(path.join(workspacePath, 'views')) } + ] + }; + + fs.writeFileSync(workspaceFilePath, JSON.stringify(workspace, null, '\t')); + + return workspaceFilePath; +} + export function setup() { describe('Multiroot', () => { before(async function () { const app = this.app as Application; + const workspaceFilePath = await createWorkspaceFile(app.workspacePath); + // restart with preventing additional windows from restoring // to ensure the window after restart is the multi-root workspace - await app.restart({ workspaceOrFolder: app.workspaceFilePath, extraArgs: ['--disable-restore-windows'] }); + await app.restart({ workspaceOrFolder: workspaceFilePath, extraArgs: ['--disable-restore-windows'] }); }); it('shows results from all folders', async function () { diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index dd17406a724..339a284ab1f 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -51,7 +51,6 @@ const opts = minimist(args, { } }); -const workspaceFilePath = path.join(testDataPath, 'smoketest.code-workspace'); const testRepoUrl = 'https://github.com/Microsoft/vscode-smoketest-express'; const workspacePath = path.join(testDataPath, 'vscode-smoketest-express'); const extensionsPath = path.join(testDataPath, 'extensions-dir'); @@ -141,37 +140,6 @@ if (process.env.VSCODE_DEV === '1') { quality = Quality.Stable; } -function toUri(path: string): string { - if (process.platform === 'win32') { - return `${path.replace(/\\/g, '/')}`; - } - - return `${path}`; -} - -async function createWorkspaceFile(): Promise { - if (fs.existsSync(workspaceFilePath)) { - return; - } - - console.log('*** Creating workspace file...'); - const workspace = { - folders: [ - { - path: toUri(path.join(workspacePath, 'public')) - }, - { - path: toUri(path.join(workspacePath, 'routes')) - }, - { - path: toUri(path.join(workspacePath, 'views')) - } - ] - }; - - fs.writeFileSync(workspaceFilePath, JSON.stringify(workspace, null, '\t')); -} - async function setupRepository(): Promise { if (opts['test-repo']) { console.log('*** Copying test project repository:', opts['test-repo']); @@ -198,7 +166,6 @@ async function setup(): Promise { console.log('*** Test data:', testDataPath); console.log('*** Preparing smoketest setup...'); - await createWorkspaceFile(); await setupRepository(); console.log('*** Smoketest setup done!\n'); @@ -224,7 +191,6 @@ function createApp(quality: Quality): Application { workspacePath, userDataDir, extensionsPath, - workspaceFilePath, waitTime: parseInt(opts['wait-time'] || '0') || 20, logger: new MultiLogger(loggers), verbose: opts.verbose,