diff --git a/tests/e2e/electronTest.ts b/tests/e2e/electronTest.ts index a2bb07355b..43da1376da 100644 --- a/tests/e2e/electronTest.ts +++ b/tests/e2e/electronTest.ts @@ -373,12 +373,13 @@ export const electronTest = base.extend({ await window.waitForLoadState("domcontentloaded"); await window.setViewportSize({ width: 1600, height: 900 }); - // Disable tutorials for e2e tests by marking them as completed - // Must set before React reads the state, so we set and reload + // Disable tutorials for e2e tests before React reads the state, then reload. + // Otherwise delayed tutorial backdrops can race with Playwright clicks and make + // unrelated UI scenarios flaky when a new tutorial sequence is added. await window.evaluate(() => { const tutorialState = { - disabled: false, - completed: { settings: true, creation: true, workspace: true }, + disabled: true, + completed: { creation: true, workspace: true, review: true }, }; localStorage.setItem("tutorialState", JSON.stringify(tutorialState)); }); diff --git a/tests/e2e/scenarios/reviewRefresh.spec.ts b/tests/e2e/scenarios/reviewRefresh.spec.ts index de95b364d4..9eff88f5d3 100644 --- a/tests/e2e/scenarios/reviewRefresh.spec.ts +++ b/tests/e2e/scenarios/reviewRefresh.spec.ts @@ -106,6 +106,11 @@ test.describe("review refresh", () => { const refreshButton = page.getByTestId("review-refresh"); await expect(refreshButton).toBeVisible({ timeout: 10_000 }); + // The review tutorial used to start 500ms after this panel mounted, leaving + // a backdrop over the tab strip and making the Stats tab click time out. + await page.waitForTimeout(600); + await expect(page.getByTestId("tutorial-backdrop")).toHaveCount(0); + // Do a manual refresh await refreshButton.dispatchEvent("click");