mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
feat: implement splash screen handling in navigation and interactions
- Added a new function `waitForSplashScreenToDisappear` to manage splash screen visibility, ensuring it does not block user interactions. - Integrated splash screen checks in various navigation functions and interaction methods to enhance user experience by waiting for the splash screen to disappear before proceeding. - Updated test setup to disable the splash screen during tests for consistent testing behavior.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Page } from '@playwright/test';
|
||||
import { clickElement } from '../core/interactions';
|
||||
import { handleLoginScreenIfPresent } from '../core/interactions';
|
||||
import { waitForElement } from '../core/waiting';
|
||||
import { waitForElement, waitForSplashScreenToDisappear } from '../core/waiting';
|
||||
import { authenticateForTests } from '../api/client';
|
||||
|
||||
/**
|
||||
@@ -16,6 +16,9 @@ export async function navigateToBoard(page: Page): Promise<void> {
|
||||
await page.goto('/board');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Handle login redirect if needed
|
||||
await handleLoginScreenIfPresent(page);
|
||||
|
||||
@@ -35,6 +38,9 @@ export async function navigateToContext(page: Page): Promise<void> {
|
||||
await page.goto('/context');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Handle login redirect if needed
|
||||
await handleLoginScreenIfPresent(page);
|
||||
|
||||
@@ -67,6 +73,9 @@ export async function navigateToSpec(page: Page): Promise<void> {
|
||||
await page.goto('/spec');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Wait for loading state to complete first (if present)
|
||||
const loadingElement = page.locator('[data-testid="spec-view-loading"]');
|
||||
try {
|
||||
@@ -100,6 +109,9 @@ export async function navigateToAgent(page: Page): Promise<void> {
|
||||
await page.goto('/agent');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Handle login redirect if needed
|
||||
await handleLoginScreenIfPresent(page);
|
||||
|
||||
@@ -119,6 +131,9 @@ export async function navigateToSettings(page: Page): Promise<void> {
|
||||
await page.goto('/settings');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Wait for the settings view to be visible
|
||||
await waitForElement(page, 'settings-view', { timeout: 10000 });
|
||||
}
|
||||
@@ -146,6 +161,9 @@ export async function navigateToWelcome(page: Page): Promise<void> {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('load');
|
||||
|
||||
// Wait for splash screen to disappear (safety net)
|
||||
await waitForSplashScreenToDisappear(page, 3000);
|
||||
|
||||
// Handle login redirect if needed
|
||||
await handleLoginScreenIfPresent(page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user