fix(ci): accept hydrated markers hidden by responsive layouts
This commit is contained in:
@@ -51,9 +51,11 @@ export async function visitBrowserDocument(page, url, reload = false) {
|
||||
const remaining = timeout - (Date.now() - started);
|
||||
if (remaining <= 0) throw new Error('Document hydration budget exhausted: ' + url);
|
||||
try {
|
||||
// Responsive layouts may hide the toggle. Its mounted ready marker
|
||||
// proves hydration; each caller still checks the controls it needs.
|
||||
// A cancelled script may be a preload duplicate. Hydration is the
|
||||
// authority; recover only when cancellation actually blocks startup.
|
||||
await page.locator('button[data-theme-ready="true"]').first().waitFor({timeout: failures.length ? Math.min(5000, remaining) : remaining});
|
||||
await page.locator('button[data-theme-ready="true"]').first().waitFor({state: 'attached', timeout: failures.length ? Math.min(5000, remaining) : remaining});
|
||||
} catch (error) {
|
||||
if (failures.length) throw new Error('Document bootstrap script request failed: ' + failures.join('; '), {cause: error});
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user