import { expect, type Page } from "@playwright/test" export async function logInUser(page: Page, email: string, password: string) { await page.goto("/login") await page.getByTestId("email-input").fill(email) await page.getByTestId("password-input").fill(password) await page.getByRole("button", { name: "Log In" }).click() await page.waitForURL("/") // The greeting is the one part of the dashboard that is there whether or not // any flows are. await expect(page.getByRole("heading", { name: /^Hi, / })).toBeVisible() }