From 8c88f7052a65bbabde3a19223e967feddb186008 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 16 Oct 2024 14:15:11 -0500 Subject: [PATCH] Wait on viewevent to trigger before checking Collection Page in e2e tests. This ensures Collection page is fully loaded because viewevent triggers upon loading. --- cypress/e2e/collection-page.cy.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cypress/e2e/collection-page.cy.ts b/cypress/e2e/collection-page.cy.ts index d12536d332a..373da078888 100644 --- a/cypress/e2e/collection-page.cy.ts +++ b/cypress/e2e/collection-page.cy.ts @@ -3,8 +3,15 @@ import { testA11y } from 'cypress/support/utils'; describe('Collection Page', () => { it('should pass accessibility tests', () => { + cy.intercept('POST', '/server/api/statistics/viewevents').as('viewevent'); + + // Visit Collections page cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION'))); + // Wait for the "viewevent" to trigger on the Collection page. + // This ensures our tag is fully loaded, as the tag is contained within it. + cy.wait('@viewevent'); + // tag must be loaded cy.get('ds-collection-page').should('be.visible');