From dfd698c91449ceace1d93ba6aff933a77357ecb9 Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Wed, 24 Jul 2024 10:30:06 +0200 Subject: [PATCH] [CST-15592] refine health page tests (cherry picked from commit f131ae2f6babf03170f3ee719285456cbfa22392) --- cypress/e2e/health-page.cy.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/health-page.cy.ts b/cypress/e2e/health-page.cy.ts index 8ae0ef8e97..f23b0bf4ad 100644 --- a/cypress/e2e/health-page.cy.ts +++ b/cypress/e2e/health-page.cy.ts @@ -10,8 +10,15 @@ beforeEach(() => { describe('Health Page > Status Tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="health-page.status-tab"]').click(); // Page must first be visible cy.get('ds-health-page').should('be.visible'); + cy.get('ds-health-panel').should('be.visible'); + + // wait for all the ds-health-info-component components to be rendered + cy.get('div[role="tabpanel"]').each(($panel: HTMLDivElement) => { + cy.wrap($panel).find('ds-health-component').should('be.visible'); + }); // Analyze for accessibility issues testA11y('ds-health-page', { rules: { @@ -26,16 +33,21 @@ describe('Health Page > Status Tab', () => { describe('Health Page > Info Tab', () => { it('should pass accessibility tests', () => { + + cy.get('a[data-test="health-page.info-tab"]').click(); // Page must first be visible cy.get('ds-health-page').should('be.visible'); - cy.get('a[data-test="health-page.info-tab"]').click(); - cy.get('ds-health-info').should('be.visible'); + // wait for all the ds-health-info-component components to be rendered + cy.get('div[role="tabpanel"]').each(($panel: HTMLDivElement) => { + cy.wrap($panel).find('ds-health-info-component').should('be.visible'); + }); + // Analyze for accessibility issues testA11y('ds-health-info', { rules: { - // All panels are accordians & fail "aria-required-children" and "nested-interactive". + // All panels are accordions & fail "aria-required-children" and "nested-interactive". // Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216 'aria-required-children': { enabled: false }, 'nested-interactive': { enabled: false },