mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user