mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 10:11:35 +10:00
feat: add more tests
This commit is contained in:
13
apps/web/src/tests/auth.setup.ts
Normal file
13
apps/web/src/tests/auth.setup.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { type Page, expect, test as setup } from '@playwright/test';
|
||||
|
||||
import { STORAGE_STATE } from '../../../../playwright.config';
|
||||
|
||||
setup('authenticate', async ({ page }: { page: Page }) => {
|
||||
await page.goto('/');
|
||||
await page.getByLabel('Email').fill(process.env.E2E_TEST_USER_EMAIL);
|
||||
await page.getByLabel('Password').fill(process.env.E2E_TEST_USER_PASSWORD);
|
||||
await page.getByRole('button', { name: 'Sign In' }).click();
|
||||
await page.waitForURL('/documents');
|
||||
await expect(page).toHaveURL('/documents');
|
||||
await page.context().storageState({ path: STORAGE_STATE });
|
||||
});
|
||||
Reference in New Issue
Block a user