MCPcopy Index your code
hub / github.com/coder/coder / login

Function login

site/e2e/helpers.ts:73–85  ·  view source on GitHub ↗
(page: Page, options: LoginOptions = users.owner)

Source from the content-addressed store, hash-verified

71};
72
73export 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
87function currentUser(page: Page): LoginOptions {
88 const ctx = page.context();

Calls

no outgoing calls

Tested by

no test coverage detected