Skip to content

Commit

Permalink
Wait on viewevent to trigger before checking Collection Page in e2e t…
Browse files Browse the repository at this point in the history
…ests. This ensures Collection page is fully loaded because viewevent triggers upon loading.
  • Loading branch information
tdonohue committed Oct 16, 2024
1 parent f749ade commit 8c88f70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cypress/e2e/collection-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ds-collection-page> tag is fully loaded, as the <ds-view-event> tag is contained within it.
cy.wait('@viewevent');

// <ds-collection-page> tag must be loaded
cy.get('ds-collection-page').should('be.visible');

Expand Down

0 comments on commit 8c88f70

Please sign in to comment.