pytest was deleting every user on teardown against the development database. The engine is built at import time, so tests/__init__.py pins POSTGRES_DB before app.core.config loads; the fixture creates the schema and drops the database again, guarded against a name that is not _test. Playwright now defaults at the integrated stack, which is the origin the API allows, so a bare `bunx playwright test` works without a dev server. The four template specs that asserted copy we no longer ship are gone, along with the helpers they were the last callers of. The admin edit assertion was page-wide and only ever passed on a fresh database. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KkmeRiyeYmVZqJVwuyHq9o
14 lines
458 B
TypeScript
14 lines
458 B
TypeScript
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("/")
|
|
await expect(
|
|
page.getByText("Welcome back, nice to see you again!"),
|
|
).toBeVisible()
|
|
}
|