test: deflake and open sidebar on mobile

This commit is contained in:
Robert Perce 2026-04-08 11:37:32 -05:00
parent 231eee3e10
commit 18de4c5895
3 changed files with 45 additions and 2 deletions

View file

@ -2,10 +2,11 @@ import { expect } from '@playwright/test';
import type { Page } from '@playwright/test';
export const login = async (page: Page) => {
await page.goto('/');
await page.goto('/login');
await page.getByLabel("Username").fill("test");
await page.getByLabel("Password").fill("test");
await page.getByRole("button", { name: /login/i }).click();
await page.waitForURL('/');
};
export const todate = () => new Date().toISOString().split('T')[0];
@ -15,6 +16,9 @@ type UserFields = {
birthday?: string,
};
export const verifyCreateUser = async (page: Page, fields: UserFields) => {
if (await page.locator('#sidebar-show-hide').isVisible()) {
await page.locator('#sidebar-show-hide').click();
}
await page.getByRole('button', { name: /add contact/i }).click();
await page.waitForURL(/contact\/\d+\/edit$/);