File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
extensions/test-extension Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ function runTestExtensionTests() {
88 test ( "should have access to VSCODE_PROXY_URI" , async ( { codeServerPage } ) => {
99 const address = await getMaybeProxiedCodeServer ( codeServerPage )
1010
11+ await codeServerPage . waitForTestExtensionLoaded ( )
1112 await codeServerPage . executeCommandViaMenus ( "code-server: Get proxy URI" )
1213
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 ( )
1416 // Remove end slash in address
1517 const normalizedAddress = address . replace ( / \/ + $ / , "" )
16- expect ( text ) . toBe ( `${ normalizedAddress } /proxy/{{port}}` )
18+ expect ( text ) . toBe ( `Info: proxyUri: ${ normalizedAddress } /proxy/{{port}}` )
1719 } )
1820}
1921
Original file line number Diff line number Diff line change 11import * as vscode from "vscode"
22
33export function activate ( context : vscode . ExtensionContext ) {
4+ vscode . window . showInformationMessage ( "test extension loaded" )
45 context . subscriptions . push (
56 vscode . commands . registerCommand ( "codeServerTest.proxyUri" , ( ) => {
67 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 } ` )
89 } else {
910 vscode . window . showErrorMessage ( "No proxy URI was set" )
1011 }
Original file line number Diff line number Diff line change 44 "version" : " 0.0.1" ,
55 "publisher" : " coder" ,
66 "activationEvents" : [
7- " onCommand:codeServerTest.proxyUri "
7+ " onStartupFinished "
88 ],
99 "engines" : {
1010 "vscode" : " ^1.56.0"
Original file line number Diff line number Diff line change @@ -296,6 +296,16 @@ export class CodeServerPage {
296296 return visible
297297 }
298298
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+
299309 /**
300310 * Focuses the integrated terminal by navigating through the command palette.
301311 *
You can’t perform that action at this time.
0 commit comments