fix(ui): wait for rendered browser state during CI navigation
Endoleap brand checks / verify (pull_request) Successful in 6s
creative workspace review checks / verify (pull_request) Successful in 26m0s

This commit is contained in:
2026-11-01 03:09:33 +08:00
parent 628449735b
commit 2a324c4d19
5 changed files with 24 additions and 14 deletions
@@ -17,10 +17,12 @@ export async function verifyBrandUI(base: string) {
const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || '/usr/bin/chromium', headless: true, args: ['--no-sandbox', '--disable-dev-shm-usage'] });
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 960 } });
page.setDefaultTimeout(60000);page.setDefaultNavigationTimeout(60000);
const visit = async (path: string, theme: string) => {
await page.goto(base + path, { waitUntil: 'commit' });
await page.locator('button[data-theme-ready="true"]').first().waitFor();
await page.waitForFunction(expected => document.documentElement.dataset.theme === expected, theme);
console.log('Brand UI route ready:', path, theme);
};
const background = (selector: string) => page.locator(selector).first().evaluate(el => getComputedStyle(el).backgroundColor);
await visit('/', 'home-light');