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(); }); test('Curator login attempt (valid credentials)', async ({ page }) => { await page.goto('/en/curator'); await page.getByPlaceholder('Username').fill('elpatron'); await page.getByPlaceholder('Password').fill('surf&4033'); await page.getByRole('button', { name: 'Log in' }).click(); // Should redirect to specials dashboard await expect(page).toHaveURL(/\/curator\/specials/); await expect(page.getByText('Curator Specials')).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.addStyleTag({ content: 'nextjs-portal { display: none !important; }' }); await page.getByPlaceholder('Username').fill('invalid_user'); await page.getByPlaceholder('Password').fill('invalid_pass'); await page.getByRole('button', { name: 'Log in' }).click(); // Should show error message await expect(page.getByText('Login failed')).toBeVisible(); }); });