Improve the UI and tests
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { acceptCookieConsent } from '../helpers/utils';
|
||||
|
||||
test.describe('Logout Flow', () => {
|
||||
// Use authenticated state for these tests
|
||||
test.use({ storageState: 'tests/.auth/user.json' });
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// Accept cookie consent if present on any page navigation
|
||||
await acceptCookieConsent(page);
|
||||
});
|
||||
|
||||
test('should successfully logout', async ({ page }) => {
|
||||
// Navigate to dashboard
|
||||
await page.goto('/app/dashboard');
|
||||
await acceptCookieConsent(page);
|
||||
|
||||
// Verify we're logged in
|
||||
await expect(page.locator('body')).toContainText(/dashboard|panel de control/i);
|
||||
@@ -29,8 +36,9 @@ test.describe('Logout Flow', () => {
|
||||
// Should redirect to login page
|
||||
await expect(page).toHaveURL(/\/(login|$)/, { timeout: 10000 });
|
||||
|
||||
// Verify we're logged out
|
||||
await expect(page.getByLabel(/email/i)).toBeVisible();
|
||||
// Verify we're logged out (check for login form)
|
||||
await acceptCookieConsent(page);
|
||||
await expect(page.getByLabel(/email|correo/i)).toBeVisible();
|
||||
});
|
||||
|
||||
test('should not access protected routes after logout', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user