Phase 7
This commit is contained in:
189 files changed
+9873
-655
No files matched your search
@@ -4,6 +4,12 @@ import type { Page } from "@playwright/test";
|
||||
/** Seeded in prisma/seed.ts — see that file for the full fixture set this suite relies on. */
|
||||
export const SEEDED = {
|
||||
registeredCustomer: { email: "alex.chen@example.com", password: "password123", name: "Alex Chen" },
|
||||
// Seeded right at their loyalty reward threshold (10/10 stamps, one
|
||||
// AVAILABLE reward) — see prisma/seed.ts. owner-journeys.spec.ts's
|
||||
// journey 10 redeems this exact reward, so any test relying on it still
|
||||
// being AVAILABLE must run before that (customer-journeys.spec.ts runs
|
||||
// first in the suite, so this is safe there).
|
||||
secondCustomer: { email: "sam.osei@example.com", password: "password123", name: "Sam Osei" },
|
||||
owner: { email: "marcus@blakeheritage.co.uk", name: "Marcus Reed" },
|
||||
barberHaircutOnly: { email: "leo@blakeheritage.co.uk", name: "Leo Vance" },
|
||||
barberSkinfadeBeard: { email: "jamie@blakeheritage.co.uk", name: "Jamie Wallace" },
|
||||
@@ -16,6 +22,12 @@ export const SEEDED = {
|
||||
|
||||
export async function signIn(page: Page, email: string, password: string): Promise<void> {
|
||||
await page.goto("/sign-in");
|
||||
// Turbopack dev-mode compiles each route group on first visit — on a
|
||||
// cold server, a click that lands before that finishes (and before
|
||||
// React attaches the form's submit handler) is silently dropped. Wait
|
||||
// for the page to go idle once before interacting, so this doesn't
|
||||
// race the very first visit to an as-yet-uncompiled route.
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.getByLabel("Email Address").fill(email);
|
||||
await page.getByLabel("Password", { exact: true }).fill(password);
|
||||
await page.getByRole("button", { name: "Sign In", exact: true }).click();
|
||||
|
||||
Reference in new issue
Block a user