MCPcopy
hub / github.com/fastapi/full-stack-fastapi-template / logInUser

Function logInUser

frontend/tests/utils/user.ts:19–29  ·  view source on GitHub ↗
(page: Page, email: string, password: string)

Source from the content-addressed store, hash-verified

17}
18
19export async function logInUser(page: Page, email: string, password: string) {
20 await page.goto("/login")
21
22 await page.getByTestId("email-input").fill(email)
23 await page.getByTestId("password-input").fill(password)
24 await page.getByRole("button", { name: "Log In" }).click()
25 await page.waitForURL("/")
26 await expect(
27 page.getByText("Welcome back, nice to see you again!"),
28 ).toBeVisible()
29}
30
31export async function logOutUser(page: Page) {
32 await page.getByTestId("user-menu").click()

Callers 4

items.spec.tsFile · 0.90
admin.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected