From cd6fda20be8b41f240e1acb92082b63fb9391af2 Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Fri, 19 Jul 2024 17:41:12 +0200 Subject: [PATCH] [CST-15592] add accessibility tests for following pages: Metadata Import Batch Import Processes Overview New Process Quality Assurance Sources (cherry picked from commit e6a7fb852a147e9193fd3164660d12228c36d56a) --- cypress/e2e/batch-import-page.cy.ts | 17 +++++++++++++++++ cypress/e2e/metadata-import-page.cy.ts | 17 +++++++++++++++++ cypress/e2e/new-process.cy.ts | 17 +++++++++++++++++ cypress/e2e/processes-overview.cy.ts | 18 ++++++++++++++++++ .../e2e/quality-assurance-source-page.cy.ts | 17 +++++++++++++++++ .../quality-assurance-source.component.html | 2 +- .../process-overview-table.component.html | 1 - 7 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/batch-import-page.cy.ts create mode 100644 cypress/e2e/metadata-import-page.cy.ts create mode 100644 cypress/e2e/new-process.cy.ts create mode 100644 cypress/e2e/processes-overview.cy.ts create mode 100644 cypress/e2e/quality-assurance-source-page.cy.ts diff --git a/cypress/e2e/batch-import-page.cy.ts b/cypress/e2e/batch-import-page.cy.ts new file mode 100644 index 0000000000..82660e8e43 --- /dev/null +++ b/cypress/e2e/batch-import-page.cy.ts @@ -0,0 +1,17 @@ +import { testA11y } from 'cypress/support/utils'; + +describe('Batch Import Page', () => { + // NOTE: these tests currently assume this query will return results! + beforeEach(() => { + // Must login as an Admin to see processes + cy.visit('/admin/batch-import'); + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + }); + + it('should pass accessibility tests', () => { + // Batch import form must first be visible + cy.get('ds-batch-import-page').should('be.visible'); + // Analyze for accessibility issues + testA11y('ds-batch-import-page'); + }); +}); diff --git a/cypress/e2e/metadata-import-page.cy.ts b/cypress/e2e/metadata-import-page.cy.ts new file mode 100644 index 0000000000..3c1d1a91af --- /dev/null +++ b/cypress/e2e/metadata-import-page.cy.ts @@ -0,0 +1,17 @@ +import { testA11y } from 'cypress/support/utils'; + +describe('Metadata Import Page', () => { + // NOTE: these tests currently assume this query will return results! + beforeEach(() => { + // Must login as an Admin to see processes + cy.visit('/admin/metadata-import'); + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + }); + + it('should pass accessibility tests', () => { + // Metadata import form must first be visible + cy.get('ds-metadata-import-page').should('be.visible'); + // Analyze for accessibility issues + testA11y('ds-metadata-import-page'); + }); +}); diff --git a/cypress/e2e/new-process.cy.ts b/cypress/e2e/new-process.cy.ts new file mode 100644 index 0000000000..d2a6ab4731 --- /dev/null +++ b/cypress/e2e/new-process.cy.ts @@ -0,0 +1,17 @@ +import { testA11y } from 'cypress/support/utils'; + +describe('New Process', () => { + // NOTE: these tests currently assume this query will return results! + beforeEach(() => { + // Must login as an Admin to see processes + cy.visit('/processes/new'); + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + }); + + it('should pass accessibility tests', () => { + // Process form must first be visible + cy.get('ds-new-process').should('be.visible'); + // Analyze for accessibility issues + testA11y('ds-new-process'); + }); +}); diff --git a/cypress/e2e/processes-overview.cy.ts b/cypress/e2e/processes-overview.cy.ts new file mode 100644 index 0000000000..f0e1ccc3fe --- /dev/null +++ b/cypress/e2e/processes-overview.cy.ts @@ -0,0 +1,18 @@ +import { testA11y } from 'cypress/support/utils'; + +describe('Processes Overview', () => { + // NOTE: these tests currently assume this query will return results! + beforeEach(() => { + // Must login as an Admin to see processes + cy.visit('/processes'); + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + }); + + it('should pass accessibility tests', () => { + + // Process overview must first be visible + cy.get('ds-process-overview').should('be.visible'); + // Analyze for accessibility issues + testA11y('ds-process-overview'); + }); +}); diff --git a/cypress/e2e/quality-assurance-source-page.cy.ts b/cypress/e2e/quality-assurance-source-page.cy.ts new file mode 100644 index 0000000000..beb797df41 --- /dev/null +++ b/cypress/e2e/quality-assurance-source-page.cy.ts @@ -0,0 +1,17 @@ +import { testA11y } from 'cypress/support/utils'; + +describe('Quality Assurance Source Page', () => { + // NOTE: these tests currently assume this query will return results! + beforeEach(() => { + // Must login as an Admin to see processes + cy.visit('/notifications/quality-assurance'); + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + }); + + it('should pass accessibility tests', () => { + // Source page must first be visible + cy.get('ds-quality-assurance-source-page-component').should('be.visible'); + // Analyze for accessibility issues + testA11y('ds-quality-assurance-source-page-component'); + }); +}); diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.html b/src/app/notifications/qa/source/quality-assurance-source.component.html index bf461873a1..faeb571234 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.html +++ b/src/app/notifications/qa/source/quality-assurance-source.component.html @@ -7,7 +7,7 @@
-

{{'quality-assurance.source'| translate}}

+

{{'quality-assurance.source'| translate}}

{{tableEntry.info}}