@@ -15,7 +15,7 @@ import * as optimistLib from 'optimist';
15
15
import { StdioOptions } from 'node:child_process' ;
16
16
17
17
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' )
19
19
. describe ( 'extensionDevelopmentPath' , 'path to the extension to test' ) . string ( 'extensionDevelopmentPath' )
20
20
. describe ( 'extensionTestsPath' , 'path to the extension tests' ) . string ( 'extensionTestsPath' )
21
21
. describe ( 'debug' , 'do not run browsers headless' ) . boolean ( 'debug' )
@@ -45,10 +45,13 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
45
45
const testExtensionUri = url . format ( { pathname : URI . file ( path . resolve ( optimist . argv . extensionDevelopmentPath ) ) . path , protocol, host, slashes : true } ) ;
46
46
const testFilesUri = url . format ( { pathname : URI . file ( path . resolve ( optimist . argv . extensionTestsPath ) ) . path , protocol, host, slashes : true } ) ;
47
47
48
- const folderParam = testWorkspaceUri ;
49
48
const payloadParam = `[["extensionDevelopmentPath","${ testExtensionUri } "],["extensionTestsPath","${ testFilesUri } "],["enableProposedApi",""],["webviewExternalEndpointCommit","5319757634f77a050b49c10162939bfe60970c29"],["skipWelcome","true"]]` ;
50
49
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
+ }
52
55
53
56
await page . exposeFunction ( 'codeAutomationLog' , ( type : string , args : any [ ] ) => {
54
57
console [ type ] ( ...args ) ;
0 commit comments