feat: add reasoning tests (#856)
This commit is contained in:
parent
39729644df
commit
9628c54755
11 changed files with 420 additions and 155 deletions
24
tests/auth.setup.ts
Normal file
24
tests/auth.setup.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import path from 'path';
|
||||
import { generateId } from 'ai';
|
||||
import { getUnixTime } from 'date-fns';
|
||||
import { expect, test as setup } from '@playwright/test';
|
||||
|
||||
const authFile = path.join(__dirname, '../playwright/.auth/session.json');
|
||||
|
||||
setup('authenticate', async ({ page }) => {
|
||||
const testEmail = `test-${getUnixTime(new Date())}@playwright.com`;
|
||||
const testPassword = generateId(16);
|
||||
|
||||
await page.goto('http://localhost:3000/register');
|
||||
await page.getByPlaceholder('user@acme.com').click();
|
||||
await page.getByPlaceholder('user@acme.com').fill(testEmail);
|
||||
await page.getByLabel('Password').click();
|
||||
await page.getByLabel('Password').fill(testPassword);
|
||||
await page.getByRole('button', { name: 'Sign Up' }).click();
|
||||
|
||||
await expect(page.getByTestId('toast')).toContainText(
|
||||
'Account created successfully!',
|
||||
);
|
||||
|
||||
await page.context().storageState({ path: authFile });
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue