forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DSpace#3405 from 4Science/task/backport-3213-to-ds…
…pace-7_x [Port dspace-7_x] Implement e2e accessibility tests for pages in DSpace User Interface
- Loading branch information
Showing
42 changed files
with
679 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Add New Modals', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin for sidebar to appear | ||
cy.visit('/login'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('Add new Community modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-new-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.new_community"]').click(); | ||
|
||
// Analyze <ds-create-community-parent-selector> for accessibility | ||
testA11y('ds-create-community-parent-selector'); | ||
}); | ||
|
||
it('Add new Collection modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-new-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.new_collection"]').click(); | ||
|
||
// Analyze <ds-create-collection-parent-selector> for accessibility | ||
testA11y('ds-create-collection-parent-selector'); | ||
}); | ||
|
||
it('Add new Item modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-new-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.new_item"]').click(); | ||
|
||
// Analyze <ds-create-item-parent-selector> for accessibility | ||
testA11y('ds-create-item-parent-selector'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Curation Tasks', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/admin/curation-tasks'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Page must first be visible | ||
cy.get('ds-admin-curation-task').should('be.visible'); | ||
// Analyze <ds-admin-curation-task> for accessibility issues | ||
testA11y('ds-admin-curation-task'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Edit Modals', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin for sidebar to appear | ||
cy.visit('/login'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('Edit Community modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-edit-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.edit_community"]').click(); | ||
|
||
// Analyze <ds-edit-community-selector> for accessibility | ||
testA11y('ds-edit-community-selector'); | ||
}); | ||
|
||
it('Edit Collection modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-edit-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.edit_collection"]').click(); | ||
|
||
// Analyze <ds-edit-collection-selector> for accessibility | ||
testA11y('ds-edit-collection-selector'); | ||
}); | ||
|
||
it('Edit Item modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-edit-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.edit_item"]').click(); | ||
|
||
// Analyze <ds-edit-item-selector> for accessibility | ||
testA11y('ds-edit-item-selector'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Export Modals', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin for sidebar to appear | ||
cy.visit('/login'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('Export metadata modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-export-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.export_metadata"]').click(); | ||
|
||
// Analyze <ds-export-metadata-selector> for accessibility | ||
testA11y('ds-export-metadata-selector'); | ||
}); | ||
|
||
it('Export batch modal should pass accessibility tests', () => { | ||
// Pin the sidebar open | ||
cy.get('#sidebar-collapse-toggle').click(); | ||
|
||
// Click on entry of menu | ||
cy.get('#admin-menu-section-export-title').click(); | ||
|
||
cy.get('a[data-test="menu.section.export_batch"]').click(); | ||
|
||
// Analyze <ds-export-batch-selector> for accessibility | ||
testA11y('ds-export-metadata-selector'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Search Page', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/admin/search'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
//Page must first be visible | ||
cy.get('ds-admin-search-page').should('be.visible'); | ||
// At least one search result should be displayed | ||
cy.get('[data-test="list-object"]').should('be.visible'); | ||
// Click each filter toggle to open *every* filter | ||
// (As we want to scan filter section for accessibility issues as well) | ||
cy.get('[data-test="filter-toggle"]').click({ multiple: true }); | ||
// Analyze <ds-admin-search-page> for accessibility issues | ||
testA11y('ds-admin-search-page'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Admin Workflow Page', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/admin/workflow'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Page must first be visible | ||
cy.get('ds-admin-workflow-page').should('be.visible'); | ||
// At least one search result should be displayed | ||
cy.get('[data-test="list-object"]').should('be.visible'); | ||
// Click each filter toggle to open *every* filter | ||
// (As we want to scan filter section for accessibility issues as well) | ||
cy.get('[data-test="filter-toggle"]').click({ multiple: true }); | ||
// Analyze <ds-admin-workflow-page> for accessibility issues | ||
testA11y('ds-admin-workflow-page'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Batch Import Page', () => { | ||
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 <ds-batch-import-page> for accessibility issues | ||
testA11y('ds-batch-import-page'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Bitstreams Formats', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/admin/registries/bitstream-formats'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Page must first be visible | ||
cy.get('ds-bitstream-formats').should('be.visible'); | ||
// Analyze <ds-bitstream-formats> for accessibility issues | ||
testA11y('ds-bitstream-formats'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
import { Options } from 'cypress-axe'; | ||
|
||
describe('Bulk Access', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/access-control/bulk-access'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Page must first be visible | ||
cy.get('ds-bulk-access').should('be.visible'); | ||
// At least one search result should be displayed | ||
cy.get('[data-test="list-object"]').should('be.visible'); | ||
// Click each filter toggle to open *every* filter | ||
// (As we want to scan filter section for accessibility issues as well) | ||
cy.get('[data-test="filter-toggle"]').click({ multiple: true }); | ||
// Analyze <ds-bulk-access> for accessibility issues | ||
testA11y('ds-bulk-access', { | ||
rules: { | ||
// All panels are accordians & 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 }, | ||
// Card titles fail this test currently | ||
'heading-order': { enabled: false }, | ||
}, | ||
} as Options); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Create Eperson', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/access-control/epeople/create'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Form must first be visible | ||
cy.get('ds-eperson-form').should('be.visible'); | ||
// Analyze <ds-eperson-form> for accessibility issues | ||
testA11y('ds-eperson-form'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Create Group', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/access-control/groups/create'); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Form must first be visible | ||
cy.get('ds-group-form').should('be.visible'); | ||
// Analyze <ds-group-form> for accessibility issues | ||
testA11y('ds-group-form'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Edit Eperson', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/access-control/epeople/'.concat(Cypress.env('DSPACE_TEST_ADMIN_USER_UUID')).concat('/edit')); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Form must first be visible | ||
cy.get('ds-eperson-form').should('be.visible'); | ||
// Analyze <ds-eperson-form> for accessibility issues | ||
testA11y('ds-eperson-form'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('Edit Group', () => { | ||
beforeEach(() => { | ||
// Must login as an Admin to see the page | ||
cy.visit('/access-control/groups/'.concat(Cypress.env('DSPACE_ADMINISTRATOR_GROUP')).concat('/edit')); | ||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('should pass accessibility tests', () => { | ||
// Form must first be visible | ||
cy.get('ds-group-form').should('be.visible'); | ||
// Analyze <ds-group-form> for accessibility issues | ||
testA11y('ds-group-form'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { testA11y } from 'cypress/support/utils'; | ||
|
||
describe('End User Agreement', () => { | ||
it('should pass accessibility tests', () => { | ||
cy.visit('/info/end-user-agreement'); | ||
|
||
// Page must first be visible | ||
cy.get('ds-end-user-agreement').should('be.visible'); | ||
|
||
// Analyze <ds-end-user-agreement> for accessibility | ||
testA11y('ds-end-user-agreement'); | ||
}); | ||
}); |
Oops, something went wrong.