plane/web/tests/helpers/user-helpers.ts

16 lines
632 B
TypeScript
Raw Normal View History

2024-02-20 10:44:34 +00:00
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();
};