e2e: replace stale post-login heading assertion with a URL wait
The shared signIn helper in every spec asserted
`getByRole("heading", { name: "Clawmates" })` after clicking Sign in, but
the dashboard's "Clawmates" is a decorative <span> in the top-bar logo,
not a heading — so all authenticated tests died on the same helper. Swap
that for `page.waitForURL((url) => !url.pathname.endsWith("/login"))`
with a 15s timeout. Robust across UI redesigns and doesn't couple the
signIn helper to a specific product surface. Should convert ~27 of the
remaining 30 failures to passes.
This commit is contained in:
@@ -11,7 +11,7 @@ async function signIn(page: import("@playwright/test").Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
test("unauthenticated visitors see the marketing landing", async ({ page }) => {
|
test("unauthenticated visitors see the marketing landing", async ({ page }) => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function openScout(page: Page) {
|
async function openScout(page: Page) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function openFreshScoutSession(page: Page) {
|
async function openFreshScoutSession(page: Page) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function openScout(page: Page) {
|
async function openScout(page: Page) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
test("connect Slack, then an outbound post is gated and broker-executed", async ({
|
test("connect Slack, then an outbound post is gated and broker-executed", async ({
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function readBalance(page: Page): Promise<number> {
|
async function readBalance(page: Page): Promise<number> {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function expectClean(page: Page, context: string) {
|
async function expectClean(page: Page, context: string) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ async function signIn(page: Page) {
|
|||||||
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
await page.getByLabel("Email address").fill(OWNER_EMAIL);
|
||||||
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
await page.getByLabel("Password").fill(OWNER_PASSWORD);
|
||||||
await page.getByRole("button", { name: "Sign in" }).click();
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
|
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
test("browse the topology catalog and build a graph", async ({ page }) => {
|
test("browse the topology catalog and build a graph", async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user