Archived
1
0

fix(testing): reduce flakiness in extension e2e tests (#5481)

This commit is contained in:
Joe Previte
2022-08-22 12:47:36 -07:00
committed by GitHub
parent 33ee184ed7
commit 8352a22e33
4 changed files with 17 additions and 4 deletions

View File

@ -8,12 +8,14 @@ function runTestExtensionTests() {
test("should have access to VSCODE_PROXY_URI", async ({ codeServerPage }) => {
const address = await getMaybeProxiedCodeServer(codeServerPage)
await codeServerPage.waitForTestExtensionLoaded()
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
const text = await codeServerPage.page.locator(".notification-list-item-message").textContent()
await codeServerPage.page.waitForSelector("text=proxyUri", { timeout: 3000 })
const text = await codeServerPage.page.locator("text=proxyUri").first().textContent()
// Remove end slash in address
const normalizedAddress = address.replace(/\/+$/, "")
expect(text).toBe(`${normalizedAddress}/proxy/{{port}}`)
expect(text).toBe(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}`)
})
}