-
Notifications
You must be signed in to change notification settings - Fork 578
fix: E2E test stability and UI performance improvements #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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(() => {}); | ||
|
Comment on lines
+19
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, check the actual file structure and lines in question
echo "=== File content: apps/ui/tests/utils/components/dialogs.ts ==="
cat -n apps/ui/tests/utils/components/dialogs.tsRepository: AutoMaker-Org/automaker Length of output: 7804 🏁 Script executed: #!/bin/bash
# Verify how this helper is used
echo "=== Usage of dismissSandboxWarningIfVisible ==="
rg -n -C3 'dismissSandboxWarningIfVisible\(' apps/ui/tests 2>/dev/null || echo "No matches found"
echo -e "\n=== Silent catch patterns in dialogs.ts ==="
rg -n -C3 'waitFor\(\{ state: .hidden.|catch\(\(\) => \{\}\)' apps/ui/tests/utils/components/dialogs.ts 2>/dev/null || echo "No matches found"Repository: AutoMaker-Org/automaker Length of output: 2669 🏁 Script executed: #!/bin/bash
# Check for other similar patterns in test utilities
echo "=== Other silent catch patterns in test utils ==="
rg -n 'catch\(\(\) => \{\}\)' apps/ui/tests/ --type ts --type tsx 2>/dev/null | head -20 || echo "Pattern search failed"Repository: AutoMaker-Org/automaker Length of output: 116 Scope dialog dismissal to the specific sandbox dialog and expose timeout failures. Line 19 targets the first open dialog globally via Proposed fix export async function dismissSandboxWarningIfVisible(page: Page): Promise<void> {
const sandboxAcceptBtn = page.locator('button:has-text("I Accept the Risks")');
+ const sandboxDialog = page.locator('[role="dialog"]').filter({ has: sandboxAcceptBtn });
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(() => {});
+ await sandboxDialog.waitFor({ state: 'hidden', timeout: 3000 });
}
}🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Check if the add feature dialog is visible | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.