From fcf2a94394e0f2d5ea3d69247b14e5abaffa7f7d Mon Sep 17 00:00:00 2001 From: Jordon Leach Date: Mon, 23 Sep 2024 10:35:24 -0400 Subject: [PATCH] Fix timing of intercept check --- cypress/e2e/tests/pages/explorer/apps/charts.spec.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/tests/pages/explorer/apps/charts.spec.ts b/cypress/e2e/tests/pages/explorer/apps/charts.spec.ts index 08cca52de2d..6865789ffc2 100644 --- a/cypress/e2e/tests/pages/explorer/apps/charts.spec.ts +++ b/cypress/e2e/tests/pages/explorer/apps/charts.spec.ts @@ -119,14 +119,13 @@ describe('Apps/Charts', { tags: ['@explorer', '@adminUser'] }, () => { chartPage.waitForPage(); - // Set up intercept for the network request triggered by $fetch - cy.intercept('GET', '**/v1/catalog.cattle.io.clusterrepos/**').as('fetchChartData'); - // Navigate back to the charts page cy.go('back'); chartsPage.waitForPage(); - // Verify that the network request was not made after navigating back - cy.get('@fetchChartData.all').should('have.length', 0); + // Set up intercept after navigating back + cy.intercept('GET', '**/v1/catalog.cattle.io.clusterrepos/**').as('fetchChartDataAfterBack'); + + cy.get('@fetchChartDataAfterBack.all').should('have.length', 0); }); });