(page: Page, options: LoginOptions = users.owner)
| 71 | }; |
| 72 | |
| 73 | export async function login(page: Page, options: LoginOptions = users.owner) { |
| 74 | const ctx = page.context(); |
| 75 | // biome-ignore lint/suspicious/noExplicitAny: reset the current user |
| 76 | (ctx as any)[Symbol.for("currentUser")] = undefined; |
| 77 | await ctx.clearCookies(); |
| 78 | await page.goto("/login"); |
| 79 | await page.getByLabel("Email").fill(options.email); |
| 80 | await page.getByLabel("Password").fill(options.password); |
| 81 | await page.getByRole("button", { name: "Sign In" }).click(); |
| 82 | await expectUrl(page).toHavePathName("/workspaces"); |
| 83 | // biome-ignore lint/suspicious/noExplicitAny: update once logged in |
| 84 | (ctx as any)[Symbol.for("currentUser")] = options; |
| 85 | } |
| 86 | |
| 87 | function currentUser(page: Page): LoginOptions { |
| 88 | const ctx = page.context(); |
no outgoing calls
no test coverage detected