Files
nat-as-server/e2e/website/login.spec.ts
tom.hempel 06fc134299
Some checks failed
Tests / test (push) Has been cancelled
just testing the environment
2026-05-20 07:10:08 +02:00

22 lines
825 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test';
test.describe('Website login', () => {
test('shows login form', async ({ page }) => {
await page.goto('/website/#/login');
await expect(page.locator('#loginForm')).toBeVisible();
});
test('bad password shows error', async ({ page }) => {
await page.goto('/website/#/login');
await page.locator('#username').fill('testadmin');
await page.locator('#password').fill('wrong-password');
await page.locator('#loginForm button[type="submit"]').click();
await expect(page.locator('#loginError')).toBeVisible();
});
test('protected route redirects to login', async ({ page }) => {
await page.goto('/website/#/users');
await expect(page.locator('#loginForm')).toBeVisible();
});
});