Merge pull request #3471 from tdonohue/flakey_item_page_tests

[dspace-7_x] Fix flakey Item page accessibility tests by waiting for pages to fuly load
This commit is contained in:
Tim Donohue
2024-10-18 14:33:12 -05:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

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

View File

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