mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 10:03:08 +00:00
fix: E2E test stability and UI performance improvements (#823)
This commit is contained in:
@@ -2,6 +2,27 @@ import { Page, Locator } from '@playwright/test';
|
||||
import { clickElement } from '../core/interactions';
|
||||
import { waitForElement, waitForElementHidden } from '../core/waiting';
|
||||
|
||||
/**
|
||||
* Dismiss the sandbox warning dialog if it appears.
|
||||
* This dialog blocks pointer events and must be accepted before interacting
|
||||
* with elements behind it.
|
||||
*/
|
||||
export async function dismissSandboxWarningIfVisible(page: Page): Promise<void> {
|
||||
const sandboxAcceptBtn = page.locator('button:has-text("I Accept the Risks")');
|
||||
const sandboxVisible = await sandboxAcceptBtn
|
||||
.waitFor({ state: 'visible', timeout: 2000 })
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
if (sandboxVisible) {
|
||||
await sandboxAcceptBtn.click();
|
||||
await page
|
||||
.locator('[role="dialog"][data-state="open"]')
|
||||
.first()
|
||||
.waitFor({ state: 'hidden', timeout: 3000 })
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the add feature dialog is visible
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user