File tree 4 files changed +17
-4
lines changed
extensions/test-extension
4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ function runTestExtensionTests() {
8
8
test ( "should have access to VSCODE_PROXY_URI" , async ( { codeServerPage } ) => {
9
9
const address = await getMaybeProxiedCodeServer ( codeServerPage )
10
10
11
+ await codeServerPage . waitForTestExtensionLoaded ( )
11
12
await codeServerPage . executeCommandViaMenus ( "code-server: Get proxy URI" )
12
13
13
- const text = await codeServerPage . page . locator ( ".notification-list-item-message" ) . textContent ( )
14
+ await codeServerPage . page . waitForSelector ( "text=proxyUri" , { timeout : 3000 } )
15
+ const text = await codeServerPage . page . locator ( "text=proxyUri" ) . first ( ) . textContent ( )
14
16
// Remove end slash in address
15
17
const normalizedAddress = address . replace ( / \/ + $ / , "" )
16
- expect ( text ) . toBe ( `${ normalizedAddress } /proxy/{{port}}` )
18
+ expect ( text ) . toBe ( `Info: proxyUri: ${ normalizedAddress } /proxy/{{port}}` )
17
19
} )
18
20
}
19
21
Original file line number Diff line number Diff line change 1
1
import * as vscode from "vscode"
2
2
3
3
export function activate ( context : vscode . ExtensionContext ) {
4
+ vscode . window . showInformationMessage ( "test extension loaded" )
4
5
context . subscriptions . push (
5
6
vscode . commands . registerCommand ( "codeServerTest.proxyUri" , ( ) => {
6
7
if ( process . env . VSCODE_PROXY_URI ) {
7
- vscode . window . showInformationMessage ( process . env . VSCODE_PROXY_URI )
8
+ vscode . window . showInformationMessage ( `proxyUri: ${ process . env . VSCODE_PROXY_URI } ` )
8
9
} else {
9
10
vscode . window . showErrorMessage ( "No proxy URI was set" )
10
11
}
Original file line number Diff line number Diff line change 4
4
"version" : " 0.0.1" ,
5
5
"publisher" : " coder" ,
6
6
"activationEvents" : [
7
- " onCommand:codeServerTest.proxyUri "
7
+ " onStartupFinished "
8
8
],
9
9
"engines" : {
10
10
"vscode" : " ^1.56.0"
Original file line number Diff line number Diff line change @@ -296,6 +296,16 @@ export class CodeServerPage {
296
296
return visible
297
297
}
298
298
299
+ /**
300
+ * Checks if the test extension loaded
301
+ */
302
+ async waitForTestExtensionLoaded ( ) : Promise < void > {
303
+ const selector = "text=test extension loaded"
304
+ this . codeServer . logger . debug ( "Waiting for test extension to load..." )
305
+
306
+ await this . page . waitForSelector ( selector )
307
+ }
308
+
299
309
/**
300
310
* Focuses the integrated terminal by navigating through the command palette.
301
311
*
You can’t perform that action at this time.
0 commit comments