Skip to content

Commit b5591dc

Browse files
committed
fix: extensions e2e
1 parent 65fec1f commit b5591dc

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

test/e2e/extensions.test.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as path from "path"
2-
import { describe, test } from "./baseFixture"
2+
import { test as base } from "@playwright/test"
3+
import { describe, test, expect } from "./baseFixture"
34

45
function runTestExtensionTests() {
56
// This will only work if the test extension is loaded into code-server.
@@ -8,7 +9,10 @@ function runTestExtensionTests() {
89

910
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
1011

11-
await codeServerPage.page.waitForSelector(`text=${address}/proxy/{{port}}`)
12+
const text = await codeServerPage.page.locator(".notification-list-item-message").textContent()
13+
// Remove end slash in address
14+
const normalizedAddress = address.replace(/\/+$/, "")
15+
expect(text).toBe(`${normalizedAddress}/proxy/{{port}}`)
1216
})
1317
}
1418

@@ -18,6 +22,14 @@ describe("Extensions", flags, {}, () => {
1822
runTestExtensionTests()
1923
})
2024

21-
describe("Extensions with --cert", [...flags, "--cert"], {}, () => {
22-
runTestExtensionTests()
23-
})
25+
if (process.env.USE_PROXY !== "1") {
26+
describe("Extensions with --cert", [...flags, "--cert"], {}, () => {
27+
runTestExtensionTests()
28+
})
29+
} else {
30+
base.describe("Extensions with --cert", () => {
31+
base.skip("skipped because USE_PROXY is set", () => {
32+
// Playwright will not show this without a function.
33+
})
34+
})
35+
}

0 commit comments

Comments
 (0)