From e6d871c5e7531dabd955381e487ec490db31199e Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 16 Oct 2026 04:23:17 -0700 Subject: [PATCH] test(e2e): read Space rows from the separate Space window (#29627) Space opens in its own window since #29513, so the full-suite spec waited on the main window for checkboxes that now render in space.html. --- tests/e2e/workspace-space-git-status.spec.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/e2e/workspace-space-git-status.spec.ts b/tests/e2e/workspace-space-git-status.spec.ts index 57b0e6dc136..53985be0fa3 100644 --- a/tests/e2e/workspace-space-git-status.spec.ts +++ b/tests/e2e/workspace-space-git-status.spec.ts @@ -7,6 +7,7 @@ import { loadWorktreesUntilPathsPresent } from './helpers/worktree-registration' test.describe('Workspace Space git status checks', () => { test('checks every scanned deletable row, including rows after the first 50', async ({ + electronApp, orcaPage, testRepoPath }) => { @@ -137,16 +138,26 @@ test.describe('Workspace Space git status checks', () => { // Why: `toHaveCount(0)` passes trivially while the list is still empty, so // every row has to be on screen before the absent-status assertion means // anything. - const rowCheckboxes = orcaPage.getByRole('checkbox', { + // Why: Space opens in its own window (#29513), so the rows render there. + const findSpacePage = () => + electronApp.windows().find((page) => page.url().endsWith('/space.html')) + await expect.poll(() => Boolean(findSpacePage())).toBe(true) + const spacePage = findSpacePage() + if (!spacePage) { + throw new Error('Expected the Space window to open') + } + const rowCheckboxes = spacePage.getByRole('checkbox', { name: new RegExp( `^Select (?:${rowDisplayNames .map((displayName) => displayName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')) .join('|')})$` ) }) - await expect(rowCheckboxes).toHaveCount(rowDisplayNames.length, { timeout: 30_000 }) + await expect(rowCheckboxes).toHaveCount(rowDisplayNames.length, { + timeout: 30_000 + }) - await expect(orcaPage.getByText('Keep: git not checked')).toHaveCount(0, { timeout: 30_000 }) + await expect(spacePage.getByText('Keep: git not checked')).toHaveCount(0, { timeout: 30_000 }) } finally { for (const worktreePath of worktreePaths) { try {