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:
webdevcody
2026-01-07 23:01:57 -05:00
parent d8cdb0bf7a
commit eb627ef323
6 changed files with 192 additions and 5 deletions

View File

@@ -20,11 +20,14 @@ export async function pressModifierEnter(page: Page): Promise<void> {
/**
* Click an element by its data-testid attribute
* Waits for the element to be visible before clicking to avoid flaky tests
*/
export async function clickElement(page: Page, testId: string): Promise<void> {
// Wait for splash screen to disappear first (safety net)
await waitForSplashScreenToDisappear(page, 2000);
const element = await getByTestId(page, testId);
await waitForSplashScreenToDisappear(page, 5000);
const element = page.locator(`[data-testid="${testId}"]`);
// Wait for element to be visible and stable before clicking
await element.waitFor({ state: 'visible', timeout: 10000 });
await element.click();
}