Implement integration tests with Playwright
This commit is contained in:
23
tests/curator.spec.ts
Normal file
23
tests/curator.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Curator Dashboard', () => {
|
||||
test('Curator login form should be displayed', async ({ page }) => {
|
||||
await page.goto('/en/curator');
|
||||
// Check for login form elements
|
||||
await expect(page.getByPlaceholder('Username')).toBeVisible();
|
||||
await expect(page.getByPlaceholder('Password')).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Log in' })).toBeVisible();
|
||||
});
|
||||
|
||||
// Valid login cannot be tested without seed data in this environment
|
||||
test('Curator login attempt (invalid credentials)', async ({ page }) => {
|
||||
await page.goto('/en/curator');
|
||||
|
||||
await page.getByPlaceholder('Username').fill('invalid_user');
|
||||
await page.getByPlaceholder('Password').fill('invalid_pass');
|
||||
await page.getByRole('button', { name: 'Log in' }).click({ force: true });
|
||||
|
||||
// Should show error message
|
||||
await expect(page.getByText('Login failed')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user