mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: enhance E2E test setup and error handling
- Updated Playwright configuration to explicitly unset ALLOWED_ROOT_DIRECTORY for unrestricted testing paths. - Improved E2E fixture setup script to reset server settings to a known state, ensuring test isolation. - Enhanced error handling in ContextView and WelcomeView components to reset state and provide user feedback on failures. - Updated tests to ensure proper navigation and visibility checks during logout processes, improving reliability.
This commit is contained in:
@@ -120,13 +120,21 @@ test.describe('Settings startup sync race', () => {
|
||||
};
|
||||
expect(beforeLogout.projects?.length).toBeGreaterThan(0);
|
||||
|
||||
// Navigate to settings and click logout.
|
||||
// Navigate to settings, then to Account section (logout button is only visible there)
|
||||
await page.goto('/settings');
|
||||
// Wait for settings view to load, then click on Account section
|
||||
await page.locator('button:has-text("Account")').first().click();
|
||||
// Wait for account section to be visible before clicking logout
|
||||
await page
|
||||
.locator('[data-testid="logout-button"]')
|
||||
.waitFor({ state: 'visible', timeout: 10000 });
|
||||
await page.locator('[data-testid="logout-button"]').click();
|
||||
|
||||
// Ensure we landed on logged-out or login (either is acceptable).
|
||||
// Note: The page uses curly apostrophe (') so we match the heading role instead
|
||||
await page
|
||||
.locator('text=You’ve been logged out, text=Authentication Required')
|
||||
.getByRole('heading', { name: /logged out/i })
|
||||
.or(page.locator('text=Authentication Required'))
|
||||
.first()
|
||||
.waitFor({ state: 'visible', timeout: 30000 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user