Initial
This commit is contained in:
commit
b43955e0d9
162 changed files with 15425 additions and 0 deletions
24
tests/e2e/auth.spec.ts
Normal file
24
tests/e2e/auth.spec.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('anonymous visitor is redirected to /login', async ({ page }) => {
|
||||
await page.goto('/app/');
|
||||
await expect(page).toHaveURL(/\/login/);
|
||||
});
|
||||
|
||||
test('valid credentials log in and reach the app', async ({ page }) => {
|
||||
await page.goto('/login/');
|
||||
await page.fill('#lg-username', 'demo');
|
||||
await page.fill('#lg-password', 'demo');
|
||||
await page.click('button[type=submit]');
|
||||
// Who you are signed in as lives behind the burger.
|
||||
await page.getByTestId('nav-menu').click();
|
||||
await expect(page.getByTestId('app-heading')).toContainText('demo');
|
||||
});
|
||||
|
||||
test('invalid credentials show an inline error', async ({ page }) => {
|
||||
await page.goto('/login/');
|
||||
await page.fill('#lg-username', 'demo');
|
||||
await page.fill('#lg-password', 'wrong');
|
||||
await page.click('button[type=submit]');
|
||||
await expect(page.getByTestId('login-error')).toBeVisible();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue