Skip to content

Commit aeaa73a

Browse files
authored
Fix flaky OIDC "verifiy dialog" test (#33188)
This test was flaking. The problem appears to have been that we were clicking "Continue" twice in succession; the intention was that we click on two *different* "Continue" buttons, but sometimes we ended up clicking in the same one twice. Fix it by waiting for the content to change after the first click. Fixes: #31316
1 parent 8834438 commit aeaa73a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
148148

149149
const userId = `alice_${testInfo.testId}`;
150150
await registerAccountMas(page, mailpitClient, userId, `${userId}@email.com`, "Pa$sW0rD!");
151-
await expect(page.getByText("Welcome")).toBeVisible();
151+
// richvdh: This takes several seconds to happen on a dev instance
152+
await expect(page.getByText("Welcome")).toBeVisible({ timeout: 10000 });
152153

153154
// Log out
154155
await page.getByRole("button", { name: "User menu" }).click();
@@ -162,11 +163,14 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
162163

163164
// Log in again
164165
await page.goto("/#/login");
166+
await expect(page.getByText("Sign in")).toBeVisible();
165167
await page.getByRole("button", { name: "Continue" }).click();
168+
await expect(page.getByText("Continue to Element?")).toBeVisible();
166169
await page.getByRole("button", { name: "Continue" }).click();
167170

168171
// We should be being warned that we need to verify (but we can't)
169-
await expect(page.getByText("Confirm your digital identity")).toBeVisible();
172+
// richvdh: Again, Element takes several seconds to load on a dev instance
173+
await expect(page.getByText("Confirm your digital identity")).toBeVisible({ timeout: 10000 });
170174

171175
// And there should be no way to close this prompt
172176
await expect(page.getByRole("button", { name: "Skip verification for now" })).not.toBeVisible();

0 commit comments

Comments
 (0)