You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
824 B
28 lines
824 B
/**
|
|
* @param {TestInfo} testInfo Test info
|
|
* @param {Page} page Page
|
|
* @returns {Promise<void>}
|
|
*/
|
|
export async function screenshot(testInfo, page) {
|
|
const screenshot = await page.screenshot();
|
|
await testInfo.attach("screenshot", {
|
|
body: screenshot,
|
|
contentType: "image/png"
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @param {Page} page Page
|
|
* @returns {Promise<void>}
|
|
*/
|
|
export async function login(page) {
|
|
// Login
|
|
await page.getByPlaceholder("Username").click();
|
|
await page.getByPlaceholder("Username").fill("admin");
|
|
await page.getByPlaceholder("Username").press("Tab");
|
|
await page.getByPlaceholder("Password").fill("admin123");
|
|
await page.getByLabel("Remember me").check();
|
|
await page.getByRole("button", { name: "Log in" }).click();
|
|
await page.isVisible("text=Add New Monitor");
|
|
}
|