Compare commits

...
Author SHA1 Message Date
Andrew BeveridgeandClaude Fable 5 57610c3890 test: handle session-restore dialog + cold-start latency in auto-correct prod E2E
The Saved Review Sessions dialog aria-hides the app when a saved
session exists for the picked job, making role-based locators miss
visible elements; close it without restoring. Also allow 90s for the
first review-page load after a fresh deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 03:48:04 -04:00
@@ -62,7 +62,17 @@ test.describe('AI auto-correct suggestions (production)', () => {
await openReviewPage(page)
// Generous timeout: right after a deploy the first review-page load can
// exceed 30s (cold Cloud Run instance + uncached correction payload).
// A "Saved Review Sessions" dialog may open on load (it aria-hides the
// rest of the app); close it without restoring before proceeding.
const suggestBtn = page.getByRole('button', { name: /AI Suggest/i })
const sessionDialog = page.getByRole('dialog', { name: /Saved Review Sessions/i })
await expect(suggestBtn.or(sessionDialog).first()).toBeVisible({ timeout: 90_000 })
if (await sessionDialog.isVisible().catch(() => false)) {
await sessionDialog.getByRole('button', { name: /^Close$/i }).click()
await expect(sessionDialog).not.toBeVisible()
}
await expect(suggestBtn).toBeVisible({ timeout: 30_000 })
await suggestBtn.click()