[CST-15592] refine health page tests

(cherry picked from commit f131ae2f6b)
This commit is contained in:
FrancescoMolinaro
2024-07-24 10:30:06 +02:00
committed by github-actions[bot]
parent a80b324f1f
commit dfd698c914

View File

@@ -10,8 +10,15 @@ beforeEach(() => {
describe('Health Page > Status Tab', () => { describe('Health Page > Status Tab', () => {
it('should pass accessibility tests', () => { it('should pass accessibility tests', () => {
cy.get('a[data-test="health-page.status-tab"]').click();
// Page must first be visible // Page must first be visible
cy.get('ds-health-page').should('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 <ds-health-page> for accessibility issues // Analyze <ds-health-page> for accessibility issues
testA11y('ds-health-page', { testA11y('ds-health-page', {
rules: { rules: {
@@ -26,16 +33,21 @@ describe('Health Page > Status Tab', () => {
describe('Health Page > Info Tab', () => { describe('Health Page > Info Tab', () => {
it('should pass accessibility tests', () => { it('should pass accessibility tests', () => {
cy.get('a[data-test="health-page.info-tab"]').click();
// Page must first be visible // Page must first be visible
cy.get('ds-health-page').should('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'); 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 <ds-health-info> for accessibility issues // Analyze <ds-health-info> for accessibility issues
testA11y('ds-health-info', { testA11y('ds-health-info', {
rules: { 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 // Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
'aria-required-children': { enabled: false }, 'aria-required-children': { enabled: false },
'nested-interactive': { enabled: false }, 'nested-interactive': { enabled: false },