Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dspace-7_x] Fix flakey Item page accessibility tests by waiting for pages to fuly load #3471

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cypress/e2e/item-edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe('Edit Item > Edit Metadata tab', () => {
// <ds-edit-item-page> tag must be loaded
cy.get('ds-edit-item-page').should('be.visible');

// wait for all the Edit Item tabs to be rendered
cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLDivElement) => {
cy.wrap($row).find('li[role="presentation"]').should('be.visible');
});

// wait for all the ds-dso-edit-metadata-value components to be rendered
cy.get('ds-dso-edit-metadata-value div[role="row"]').each(($row: HTMLDivElement) => {
cy.wrap($row).find('div[role="cell"]').should('be.visible');
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/item-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ describe('Item Page', () => {
});

it('should pass accessibility tests', () => {
cy.intercept('POST', '/server/api/statistics/viewevents').as('viewevent');

cy.visit(ENTITYPAGE);

// Wait for the "viewevent" to trigger on the Item page.
// This ensures our <ds-item-page> tag is fully loaded, as the <ds-view-event> tag is contained within it.
cy.wait('@viewevent');

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

Expand All @@ -22,8 +28,14 @@ describe('Item Page', () => {
});

it('should pass accessibility tests on full item page', () => {
cy.intercept('POST', '/server/api/statistics/viewevents').as('viewevent');

cy.visit(ENTITYPAGE + '/full');

// Wait for the "viewevent" to trigger on the Item page.
// This ensures our <ds-item-page> tag is fully loaded, as the <ds-view-event> tag is contained within it.
cy.wait('@viewevent');

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

Expand Down
Loading