Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 2a183c7

Browse files
authored
Ensure no race condition between page load and waitForRequest set up (#109)
Fixes element-hq/element-web#27572 Signed-off-by: Michael Telatynski <[email protected]>
1 parent 2da5d9b commit 2a183c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

playwright/e2e/oidc/oidc-native.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
88

99
import { test, expect, registerAccountMas } from ".";
1010
import { isDendrite } from "../../plugins/homeserver/dendrite";
11+
import { ElementAppPage } from "../../pages/ElementAppPage.ts";
1112

1213
test.describe("OIDC Native", () => {
1314
test.skip(isDendrite, "does not yet support MAS");
@@ -17,7 +18,7 @@ test.describe("OIDC Native", () => {
1718
labsFlags: ["feature_oidc_native_flow"],
1819
});
1920

20-
test("can register the oauth2 client and an account", async ({ context, page, homeserver, mailhog, app, mas }) => {
21+
test("can register the oauth2 client and an account", async ({ context, page, homeserver, mailhog, mas }) => {
2122
const tokenUri = `http://localhost:${mas.port}/oauth2/token`;
2223
const tokenApiPromise = page.waitForRequest(
2324
(request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code",
@@ -36,6 +37,7 @@ test.describe("OIDC Native", () => {
3637

3738
const deviceId = await page.evaluate<string>(() => window.localStorage.mx_device_id);
3839

40+
const app = new ElementAppPage(page);
3941
await app.settings.openUserSettings("Account");
4042
const newPagePromise = context.waitForEvent("page");
4143
await page.getByRole("button", { name: "Manage account" }).click();

0 commit comments

Comments
 (0)