refactor(e2e): migrate all tests to Playwright Test
This commit is contained in:
parent
174c6c001e
commit
7900f264ba
14 changed files with 398 additions and 401 deletions
19
tests/e2e/registration.spec.js
Normal file
19
tests/e2e/registration.spec.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// @ts-check
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
const fixtures = JSON.parse(process.env.E2E_FIXTURES || '{}');
|
||||
|
||||
test.describe('Registration', () => {
|
||||
test('invalid token returns 400', async ({ page }) => {
|
||||
const resp = await page.goto('/register/invalid-token-12345');
|
||||
expect(resp.status()).toBe(400);
|
||||
await expect(page.locator('body')).toContainText('Invalid or expired');
|
||||
});
|
||||
|
||||
test('used token returns 400', async ({ page }) => {
|
||||
expect(fixtures.used_token).toBeTruthy();
|
||||
const resp = await page.goto(`/register/${fixtures.used_token}`);
|
||||
expect(resp.status()).toBe(400);
|
||||
await expect(page.locator('body')).toContainText('Invalid or expired');
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue