mirror of
https://github.com/strapi/strapi.git
synced 2025-12-03 10:32:10 +00:00
* chore!: remove form * chore: re-introduce form error focusing * chore: remove usage of Formik in auth * chore: fix test suite
21 lines
550 B
TypeScript
21 lines
550 B
TypeScript
import type { Page } from '@playwright/test';
|
|
import { ADMIN_EMAIL_ADDRESS, ADMIN_PASSWORD } from '../constants';
|
|
|
|
/**
|
|
* Log in to an e2e test app
|
|
*/
|
|
export const login = async ({ page, rememberMe = false }: { page: Page; rememberMe?: boolean }) => {
|
|
await page.getByLabel('Email').fill(ADMIN_EMAIL_ADDRESS);
|
|
await page
|
|
.getByLabel('Password*', {
|
|
exact: true,
|
|
})
|
|
.fill(ADMIN_PASSWORD);
|
|
|
|
if (rememberMe) {
|
|
await page.getByLabel('Remember me').click();
|
|
}
|
|
|
|
await page.getByRole('button', { name: 'Login' }).click();
|
|
};
|