mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 00:24:08 +00:00
feat: error-boundary + crash cache addition (#8056)
* internal emit chain for clearance * fix: crash ui * fix(ErrorBoundary): ensure cache clearing is awaited before force quitting * test(e2e): environment persistence across collections * test: migration test * Update environment.spec.ts * fix: reduce padding for dark mode app errors * chore: re-add waitForReadyPage
This commit is contained in:
@@ -31,6 +31,28 @@ function isTracingEnabled(testInfo: TestInfo): boolean {
|
||||
return !!(testInfo as any)._tracing.traceOptions();
|
||||
}
|
||||
|
||||
// Wait for the Electron app to have a ready, loaded window.
|
||||
// Handles cases where the first window is slow to appear (e.g. on Windows).
|
||||
export async function waitForReadyPage(app: ElectronApplication, options: { timeout?: number } = {}): Promise<Page> {
|
||||
const { timeout = 45000 } = options;
|
||||
|
||||
let page: Page | null = null;
|
||||
try {
|
||||
page = await app.firstWindow();
|
||||
} catch {
|
||||
page = null;
|
||||
}
|
||||
|
||||
if (!page) {
|
||||
page = await app.waitForEvent('window', { timeout });
|
||||
}
|
||||
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout });
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
async function usePageWithTracing(
|
||||
context: BrowserContext,
|
||||
page: Page,
|
||||
|
||||
Reference in New Issue
Block a user