diff --git a/cypress/e2e/item-edit.cy.ts b/cypress/e2e/item-edit.cy.ts index ad5d8ea0930..fcddecf3146 100644 --- a/cypress/e2e/item-edit.cy.ts +++ b/cypress/e2e/item-edit.cy.ts @@ -23,6 +23,11 @@ describe('Edit Item > Edit Metadata tab', () => { // tag must be loaded cy.get('ds-edit-item-page').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').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'); @@ -46,6 +51,11 @@ describe('Edit Item > Status tab', () => { // tag must be loaded cy.get('ds-item-status').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-item-status'); }); @@ -64,6 +74,10 @@ describe('Edit Item > Bitstreams tab', () => { // tag must be loaded cy.get('ds-item-bitstreams').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); // Table of item bitstreams must also be loaded cy.get('div.item-bitstreams').should('be.visible'); @@ -93,6 +107,11 @@ describe('Edit Item > Curate tab', () => { // tag must be loaded cy.get('ds-item-curate').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-item-curate'); }); @@ -111,6 +130,11 @@ describe('Edit Item > Relationships tab', () => { // tag must be loaded cy.get('ds-item-relationships').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-item-relationships'); }); @@ -129,6 +153,11 @@ describe('Edit Item > Version History tab', () => { // tag must be loaded cy.get('ds-item-version-history').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-item-version-history'); }); @@ -147,6 +176,11 @@ describe('Edit Item > Access Control tab', () => { // tag must be loaded cy.get('ds-item-access-control').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-item-access-control'); }); @@ -165,6 +199,11 @@ describe('Edit Item > Collection Mapper tab', () => { // tag must be loaded cy.get('ds-item-collection-mapper').should('be.visible'); + // wait for all the tabs to be rendered on this page + cy.get('ds-edit-item-page ul[role="tablist"]').each(($row: HTMLUListElement) => { + cy.wrap($row).find('a[role="tab"]').should('be.visible'); + }); + // Analyze entire page for accessibility issues testA11y('ds-item-collection-mapper');