From ea4b3333551102141eec3ed5dcdfa4131691dc53 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Thu, 22 Oct 2026 18:26:13 -0500 Subject: [PATCH] test(e2e): scroll a sandbox row into view before checking it Since server-side pagination (#122) the sandbox list has a third filter and a pager above it, and at CI's 1280x720 viewport its second row starts below the fold of the page's scrolling content area. Cypress counts a row its scroll container clips as not visible, so "displays sandbox list with different phases" failed on main's push runs for 61e2590 and 70afb39 ("its content is being clipped by one of its parent elements, which has a CSS property of overflow"). Each row is now scrolled to before it is checked. The workspace draft-summary stub also matched only a bare path, while the paged list asks with ?sandbox=..., so those requests fell through to a BFF that is not running and answered 500. The stub now matches with a query. Co-Authored-By: Claude Opus 5.5 --- frontend/cypress/e2e/sandbox-lifecycle.cy.ts | 10 +++++++--- frontend/cypress/support/intercepts.ts | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/e2e/sandbox-lifecycle.cy.ts b/frontend/cypress/e2e/sandbox-lifecycle.cy.ts index 0a1660fa..ec3ddb74 100644 --- a/frontend/cypress/e2e/sandbox-lifecycle.cy.ts +++ b/frontend/cypress/e2e/sandbox-lifecycle.cy.ts @@ -12,10 +12,14 @@ describe('Sandbox Lifecycle', () => { cy.get('[data-testid="view-toggle-list"]').click(); }); + // The list sits in the page's scrolling content area. With the filters and + // the pager above it, a row can start below the fold at the CI viewport, + // and Cypress counts a row its scroll container clips as not visible. Each + // row is scrolled to before it is checked. it('displays sandbox list with different phases', () => { - cy.contains('my-agent').should('be.visible'); - cy.contains('data-processor').should('be.visible'); - cy.contains('broken-sandbox').should('be.visible'); + ['my-agent', 'data-processor', 'broken-sandbox'].forEach((name) => { + cy.contains(name).scrollIntoView().should('be.visible'); + }); }); it('shows sandbox phase labels in table view', () => { diff --git a/frontend/cypress/support/intercepts.ts b/frontend/cypress/support/intercepts.ts index ec78c14e..8869a806 100644 --- a/frontend/cypress/support/intercepts.ts +++ b/frontend/cypress/support/intercepts.ts @@ -353,7 +353,8 @@ export const interceptMisc = () => { }).as('draftSummary'); // What the sandbox list reads its "N pending rules" badges from. - cy.intercept('GET', /\/api\/v1\/workspaces\/[^/]+\/draft-summary$/, { + // The sandbox list names the sandboxes of its page (?sandbox=...). + cy.intercept('GET', /\/api\/v1\/workspaces\/[^/]+\/draft-summary(\?.*)?$/, { statusCode: 200, body: { sandboxes: [], totalPending: 0 }, }).as('workspaceDraftSummary');