mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
- Replace ~100 waitForTimeout calls with proper condition-based waits - Extract shared utilities for time input and task scheduling - Add timeout constants for consistent wait times - Add new selectors for reminder dialogs and detail panels Files refactored across 25+ test files including: - Plugin tests (lifecycle, upload, loading, enable, structure) - Reminder tests (view-task, schedule-page, default-options) - Work view, planner, focus mode, and app feature tests - Task dragdrop, autocomplete, and daily summary tests New utilities created: - e2e/utils/time-input-helper.ts - Robust time input filling - e2e/utils/schedule-task-helper.ts - Task scheduling helpers - e2e/constants/timeouts.ts - Standardized timeout values
44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
import { test } from '../fixtures/test.fixture';
|
|
|
|
test.describe('All Basic Routes Without Error', () => {
|
|
test('should open all basic routes from menu without error', async ({
|
|
page,
|
|
workViewPage,
|
|
}) => {
|
|
// Load app and wait for work view
|
|
await workViewPage.waitForTaskList();
|
|
|
|
// Wait for magic-side-nav to be fully loaded
|
|
await page.locator('magic-side-nav').waitFor({ state: 'visible' });
|
|
|
|
// Helper to navigate and wait for route to load
|
|
const navigateAndWait = async (route: string): Promise<void> => {
|
|
await page.goto(route);
|
|
await page.locator('.route-wrapper').waitFor({ state: 'visible', timeout: 10000 });
|
|
};
|
|
|
|
// Navigate to schedule
|
|
await navigateAndWait('/#/tag/TODAY/schedule');
|
|
|
|
// Test that key navigation elements are visible and functional
|
|
await page.waitForSelector('magic-side-nav', { state: 'visible' });
|
|
|
|
// Test navigation to different routes by URL (the main goal of this test)
|
|
await navigateAndWait('/#/schedule');
|
|
await navigateAndWait('/#/tag/TODAY/tasks');
|
|
await navigateAndWait('/#/config');
|
|
|
|
// Navigate to different routes
|
|
await navigateAndWait('/#/tag/TODAY/quick-history');
|
|
await navigateAndWait('/#/tag/TODAY/worklog');
|
|
await navigateAndWait('/#/tag/TODAY/metrics');
|
|
await navigateAndWait('/#/tag/TODAY/planner');
|
|
await navigateAndWait('/#/tag/TODAY/daily-summary');
|
|
await navigateAndWait('/#/tag/TODAY/settings');
|
|
|
|
// Send 'n' key to open notes dialog
|
|
await page.keyboard.press('n');
|
|
|
|
// Verify no errors in console (implicit with test passing)
|
|
});
|
|
});
|