Wait for Run All button with proper async selector
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Successful in 6s
CI/CD / test-runners (pull_request) Failing after 1m44s
CI/CD / test-go-pg (pull_request) Successful in 2m55s
CI/CD / test-sqlite (pull_request) Successful in 3m10s
CI/CD / build-and-deploy (pull_request) Has been skipped

The test-runner suites load asynchronously — the button only appears
after runners register. Use waitForSelector with 60s timeout instead
of a fixed 3s delay. Dump page text on failure for debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 11:01:15 +00:00
parent 8945c4f8c3
commit f5f9526f8a

View File

@@ -54,21 +54,19 @@ if (!TOKEN) {
console.log('Navigating to test-runners surface...');
await page.goto(SERVER + '/s/test-runners', { waitUntil: 'networkidle', timeout: 30000 });
// Wait for runners to load
console.log('Waiting for runners to load...');
await page.waitForSelector('[data-testid="run-all"], button', { timeout: 30000 });
// Wait a bit for all runner scripts to finish loading
await page.waitForTimeout(3000);
// Click "Run All" button
console.log('Clicking Run All...');
const runAllBtn = await page.$('button:has-text("Run All")');
// Wait for the "Run All" button — suites load asynchronously so the
// button only appears once runners have registered their suites.
console.log('Waiting for Run All button...');
const runAllBtn = await page.waitForSelector('button:has-text("Run All")', { timeout: 60000 })
.catch(() => null);
if (!runAllBtn) {
console.error('ERROR: "Run All" button not found');
// Dump page content for debugging
const text = await page.textContent('body').catch(() => '(empty)');
console.error('ERROR: "Run All" button not found. Page text:', text.substring(0, 500));
await browser.close();
process.exit(1);
}
console.log('Clicking Run All...');
await runAllBtn.click();
// Wait for results — poll until running state clears