mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
16 lines
632 B
TypeScript
16 lines
632 B
TypeScript
import { test, Page } from "@playwright/test";
|
|
|
|
export const login = async (page: Page) => {
|
|
if (!process.env.PLAYWRIGHT_USERNAME || !process.env.PLAYWRIGHT_PASSWORD) {
|
|
test.fail(true, "User name or password not set");
|
|
return;
|
|
}
|
|
|
|
await page.goto("/");
|
|
await page.getByPlaceholder("name@company.com").click();
|
|
await page.getByPlaceholder("name@company.com").fill(process.env.PLAYWRIGHT_USERNAME);
|
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
await page.getByPlaceholder("Enter password").fill(process.env.PLAYWRIGHT_PASSWORD);
|
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
};
|