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');