Initial
This commit is contained in:
commit
b43955e0d9
162 changed files with 15425 additions and 0 deletions
22
tests/e2e/register.spec.ts
Normal file
22
tests/e2e/register.spec.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('a visitor can register and lands in the app', async ({ page }) => {
|
||||
await page.goto('/register/');
|
||||
await page.fill('#rg-username', 'newbie');
|
||||
await page.fill('#rg-email', 'newbie@example.com');
|
||||
await page.fill('#rg-password', 's3curePass!');
|
||||
await page.fill('#rg-password2', 's3curePass!');
|
||||
await page.click('button[type=submit]');
|
||||
await page.getByTestId('nav-menu').click();
|
||||
await expect(page.getByTestId('app-heading')).toContainText('newbie');
|
||||
});
|
||||
|
||||
test('duplicate username shows an inline error', async ({ page }) => {
|
||||
await page.goto('/register/');
|
||||
await page.fill('#rg-username', 'demo'); // seeded in the mock
|
||||
await page.fill('#rg-email', 'dupe@example.com');
|
||||
await page.fill('#rg-password', 's3curePass!');
|
||||
await page.fill('#rg-password2', 's3curePass!');
|
||||
await page.click('button[type=submit]');
|
||||
await expect(page.getByTestId('register-error')).toBeVisible();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue