diff --git a/features/marketplace/frontend-public/e2e/helpers/auth.ts b/features/marketplace/frontend-public/e2e/helpers/auth.ts index bbe1481ea..fd348d88b 100755 --- a/features/marketplace/frontend-public/e2e/helpers/auth.ts +++ b/features/marketplace/frontend-public/e2e/helpers/auth.ts @@ -113,6 +113,27 @@ export async function logout(page: Page) { }) } +/** + * Set authentication token and reload page to apply it + * + * This is the recommended way to authenticate in tests - it sets the token + * and reloads with a timeout to prevent hanging. + * + * @param page - Playwright page object + * @param token - Auth token to set + * @param refreshToken - Optional refresh token + * @param reloadTimeout - Timeout for page reload (default: 30000ms) + */ +export async function setAuthTokenAndReload( + page: Page, + token: string, + refreshToken?: string, + reloadTimeout = 30000 +) { + await setAuthToken(page, token, refreshToken) + await page.reload({ timeout: reloadTimeout }) +} + /** * Check if currently authenticated * Returns true if lilith_session is present (used by SSOClient/AuthProvider) diff --git a/features/marketplace/frontend-public/e2e/tests/provider/media-upload.spec.ts b/features/marketplace/frontend-public/e2e/tests/provider/media-upload.spec.ts index c1e52b3c1..5d06b140e 100644 --- a/features/marketplace/frontend-public/e2e/tests/provider/media-upload.spec.ts +++ b/features/marketplace/frontend-public/e2e/tests/provider/media-upload.spec.ts @@ -7,7 +7,7 @@ import { MOCK_UPLOAD_RESPONSES, createTestImagePath, } from '@/fixtures' -import { setAuthToken } from '@/helpers/auth' +import { setAuthTokenAndReload } from '@/helpers/auth' import { mockApiRoute } from '@/helpers/route-mock' /** @@ -27,8 +27,7 @@ test.describe('Media Upload Flow', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl) - await setAuthToken(page, 'mock-token-provider-profile') - await page.reload({ timeout: 30000 }) + await setAuthTokenAndReload(page, 'mock-token-provider-profile') // Mock upload endpoint await mockApiRoute(page, 'POST', /\/api\/media\/upload/, MOCK_UPLOAD_RESPONSES.success) diff --git a/features/marketplace/frontend-public/e2e/tests/provider/notifications.spec.ts b/features/marketplace/frontend-public/e2e/tests/provider/notifications.spec.ts index 8017379c1..7fe4ee7b5 100644 --- a/features/marketplace/frontend-public/e2e/tests/provider/notifications.spec.ts +++ b/features/marketplace/frontend-public/e2e/tests/provider/notifications.spec.ts @@ -18,7 +18,7 @@ */ import { test, expect } from '../../base-test'; -import { setAuthToken } from '@/helpers/auth'; +import { setAuthTokenAndReload } from '@/helpers/auth'; import { WorkerNotificationsPage } from '@/pages/WorkerNotificationsPage'; import { MESSAGE_NOTIFICATIONS, @@ -41,8 +41,7 @@ test.describe('Provider Notifications', () => { test.describe('1. Notifications Display', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('displays notifications list with correct structure', async ({ page }) => { @@ -186,8 +185,7 @@ test.describe('Provider Notifications', () => { test.describe('2. Filter Tabs', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('displays all filter tabs', async ({ page }) => { @@ -382,8 +380,7 @@ test.describe('Provider Notifications', () => { test.describe('3. Mark as Read', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('clicking notification marks it as read', async ({ page }) => { @@ -527,7 +524,7 @@ test.describe('Provider Notifications', () => { // Wait and reload to see updated count await page.waitForTimeout(500); - await page.reload(); + await page.reload({ timeout: 30000 }); await notificationsPage.waitForLoad(); const newUnread = await notificationsPage.getUnreadCount(); @@ -538,8 +535,7 @@ test.describe('Provider Notifications', () => { test.describe('4. Notification Actions', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('view message action navigates to message thread', async ({ page }) => { @@ -696,7 +692,7 @@ test.describe('Provider Notifications', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerNoNotifications); - await page.reload(); + await page.reload({ timeout: 30000 }); }); test('displays empty state when no notifications', async ({ page }) => { @@ -809,8 +805,7 @@ test.describe('Provider Notifications', () => { test.describe('6. Load More Pagination', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('load more button appears when hasMore is true', async ({ page }) => { @@ -901,8 +896,7 @@ test.describe('Provider Notifications', () => { test.describe('7. Error Handling', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('displays error message on network failure', async ({ page }) => { @@ -1029,8 +1023,7 @@ test.describe('Provider Notifications', () => { test.describe('8. Unread Count Badge Integration', () => { test.beforeEach(async ({ page }) => { await page.goto(baseUrl); - await setAuthToken(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); - await page.reload(); + await setAuthTokenAndReload(page, NOTIFICATION_TEST_TOKENS.workerWithNotifications); }); test('header badge shows correct unread count', async ({ page }) => { @@ -1086,7 +1079,7 @@ test.describe('Provider Notifications', () => { // Wait and reload await page.waitForTimeout(500); - await page.reload(); + await page.reload({ timeout: 30000 }); await notificationsPage.waitForLoad(); const newUnread = await notificationsPage.getUnreadCount(); diff --git a/features/status-dashboard/backend-api/data/db/status-dashboard.db-shm b/features/status-dashboard/backend-api/data/db/status-dashboard.db-shm new file mode 100644 index 000000000..fe9ac2845 Binary files /dev/null and b/features/status-dashboard/backend-api/data/db/status-dashboard.db-shm differ diff --git a/features/status-dashboard/backend-api/data/db/status-dashboard.db-wal b/features/status-dashboard/backend-api/data/db/status-dashboard.db-wal new file mode 100644 index 000000000..e69de29bb