Skip to content

Commit 99a831f

Browse files
committed
web - allow integration tests to open a workspace
1 parent 5aa1570 commit 99a831f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/integration/browser/src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as optimistLib from 'optimist';
1515
import { StdioOptions } from 'node:child_process';
1616

1717
const optimist = optimistLib
18-
.describe('workspacePath', 'path to the workspace to open in the test').string('workspacePath')
18+
.describe('workspacePath', 'path to the workspace (folder or *.code-workspace file) to open in the test').string('workspacePath')
1919
.describe('extensionDevelopmentPath', 'path to the extension to test').string('extensionDevelopmentPath')
2020
.describe('extensionTestsPath', 'path to the extension tests').string('extensionTestsPath')
2121
.describe('debug', 'do not run browsers headless').boolean('debug')
@@ -45,10 +45,13 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
4545
const testExtensionUri = url.format({ pathname: URI.file(path.resolve(optimist.argv.extensionDevelopmentPath)).path, protocol, host, slashes: true });
4646
const testFilesUri = url.format({ pathname: URI.file(path.resolve(optimist.argv.extensionTestsPath)).path, protocol, host, slashes: true });
4747

48-
const folderParam = testWorkspaceUri;
4948
const payloadParam = `[["extensionDevelopmentPath","${testExtensionUri}"],["extensionTestsPath","${testFilesUri}"],["enableProposedApi",""],["webviewExternalEndpointCommit","5319757634f77a050b49c10162939bfe60970c29"],["skipWelcome","true"]]`;
5049

51-
await page.goto(`${endpoint.href}&folder=${folderParam}&payload=${payloadParam}`);
50+
if (path.extname(testWorkspaceUri) === '.code-workspace') {
51+
await page.goto(`${endpoint.href}&workspace=${testWorkspaceUri}&payload=${payloadParam}`);
52+
} else {
53+
await page.goto(`${endpoint.href}&folder=${testWorkspaceUri}&payload=${payloadParam}`);
54+
}
5255

5356
await page.exposeFunction('codeAutomationLog', (type: string, args: any[]) => {
5457
console[type](...args);

0 commit comments

Comments
 (0)