Use host preparation for TURN connection settings

This commit is contained in:
vorotamoroz
2026-09-16 03:43:09 +00:00
parent a565070809
commit 11a07b26af
33 changed files with 654 additions and 961 deletions
@@ -53,7 +53,7 @@ Deno.test({
assertEquals(await page.getByPlaceholder("Enter TURN credential").inputValue(), "browser-turn-credential");
assertEquals(await page.getByRole("button", { name: "Connect", exact: true }).isVisible(), true);
await page.getByLabel("TURN configuration", { exact: true }).selectOption("cloudflare");
await page.getByLabel("TURN configuration", { exact: true }).selectOption("CF");
assertEquals(await saveTurn.isDisabled(), true);
await page.getByLabel("TURN Key ID", { exact: true }).fill("browser-turn-key");
const tokenField = page.getByLabel("TURN Key API Token", { exact: true });
@@ -66,13 +66,21 @@ Deno.test({
await page.getByRole("heading", { name: "Peer to Peer Replicator", exact: true }).waitFor();
assertEquals(await page.getByPlaceholder("anything-you-like").inputValue(), "browser-e2e-room");
await page.getByText("Optional TURN server settings", { exact: true }).click();
assertEquals(await page.getByLabel("TURN configuration", { exact: true }).inputValue(), "cloudflare");
assertEquals(await page.getByLabel("TURN configuration", { exact: true }).inputValue(), "CF");
assertEquals(await page.getByLabel("TURN Key ID", { exact: true }).inputValue(), "browser-turn-key");
assertEquals(
await page.getByLabel("TURN Key API Token", { exact: true }).inputValue(),
"browser-api-token"
);
await page.getByLabel("TURN configuration", { exact: true }).selectOption("manual");
await page.getByPlaceholder("iphone-16").fill("browser-e2e-peer-renamed");
await save.click();
await waitFor(async () => await save.isDisabled(), "WebPeer did not save its updated device name");
assertEquals(await page.getByLabel("TURN configuration", { exact: true }).inputValue(), "CF");
assertEquals(
await page.getByLabel("TURN Key API Token", { exact: true }).inputValue(),
"browser-api-token"
);
await page.getByLabel("TURN configuration", { exact: true }).selectOption("");
assertEquals(await page.getByPlaceholder("Enter TURN username").inputValue(), "browser-turn-user");
assertEquals(await page.getByPlaceholder("Enter TURN credential").inputValue(), "browser-turn-credential");
assertNoPageFailures();