diff --git a/tests/e2e/helpers/source-control-ai-generation.ts b/tests/e2e/helpers/source-control-ai-generation.ts index c93a20e37a1..3a488bc58db 100644 --- a/tests/e2e/helpers/source-control-ai-generation.ts +++ b/tests/e2e/helpers/source-control-ai-generation.ts @@ -53,7 +53,6 @@ export async function openChecks(page: Page, worktreeId: string): Promise // instead of hanging on a locator that stopped matching mid-action. await checksButton.click({ timeout: 2_000 }).catch(() => undefined) } - await page.waitForTimeout(250) return page.evaluate(() => window.__store?.getState().rightSidebarTab) }, { timeout: 10_000 } diff --git a/tests/e2e/pr-comments-sidebar-cards.spec.ts b/tests/e2e/pr-comments-sidebar-cards.spec.ts index d0cfa4498c2..127502dab91 100644 --- a/tests/e2e/pr-comments-sidebar-cards.spec.ts +++ b/tests/e2e/pr-comments-sidebar-cards.spec.ts @@ -138,15 +138,21 @@ test.describe('PR comments sidebar cards view', () => { await orcaPage.screenshot({ path: testInfo.outputPath('reaction-before.png') }) await threadReactionButton.click() await expect(orcaPage.getByRole('group', { name: 'Add reaction' })).toBeFocused() - await orcaPage.waitForTimeout(300) - await orcaPage.screenshot({ path: testInfo.outputPath('reaction-picker.png') }) + await expect(orcaPage.getByRole('button', { name: 'Add rocket reaction' })).toBeVisible() + await orcaPage.screenshot({ + path: testInfo.outputPath('reaction-picker.png'), + animations: 'disabled' + }) await orcaPage.getByRole('button', { name: 'Add rocket reaction' }).click() await expect(orcaPage.getByRole('group', { name: 'Add reaction' })).toBeHidden() const selectedRocket = reviewThreadCard.getByRole('button', { name: '1 rocket reaction' }) await expect(selectedRocket).toHaveAttribute('aria-pressed', 'true') await selectedRocket.focus() - await orcaPage.waitForTimeout(300) - await orcaPage.screenshot({ path: testInfo.outputPath('reaction-after.png') }) + await expect(selectedRocket).toBeFocused() + await orcaPage.screenshot({ + path: testInfo.outputPath('reaction-after.png'), + animations: 'disabled' + }) await selectedRocket.press('Enter') await expect(selectedRocket).toHaveCount(0) await expect(threadReactionButton).toBeFocused() diff --git a/tests/e2e/quick-open-file-paths.spec.ts b/tests/e2e/quick-open-file-paths.spec.ts index bb9703bc5cb..8625af42082 100644 --- a/tests/e2e/quick-open-file-paths.spec.ts +++ b/tests/e2e/quick-open-file-paths.spec.ts @@ -42,19 +42,20 @@ test('cmd+p quick open prioritizes the filename and reveals the full path on hov rowText?.indexOf('packages/orca/src/renderer/src/components/navigation/') ?? -1 ) - // Two hovers on purpose: results stream in and remount the row, and Radix only - // opens on a pointermove it actually receives. A single hover can land before - // the remount and leave the cursor sitting still over a row that never saw it. - await row.hover({ position: { x: 20, y: 12 } }) - await orcaPage.waitForTimeout(250) - await row.hover({ position: { x: 40, y: 12 } }) + const tooltip = orcaPage + .locator('[data-slot="tooltip-content"]') + .filter({ hasText: relativeFilePath }) + // Streaming results can remount the row under a stationary pointer. + await expect(async () => { + await row.hover({ position: { x: 20, y: 12 }, timeout: 1_000 }) + await row.hover({ position: { x: 40, y: 12 }, timeout: 1_000 }) + await expect(tooltip).toBeVisible({ timeout: 1_000 }) + }).toPass({ timeout: 10_000, intervals: [100, 250, 500] }) // Exact cursor placement is arithmetic, unit-tested via cursorTooltipOffsets. // Asserting it here measures the app mid-reflow and is flaky; what E2E is // uniquely good for is that the tooltip really opens with the whole path. - await expect( - orcaPage.locator('[data-slot="tooltip-content"]').filter({ hasText: relativeFilePath }) - ).toBeVisible() + await expect(tooltip).toBeVisible() const proofPath = process.env.ORCA_QUICK_OPEN_PROOF_PATH if (proofPath) {