mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Add new e2e accessibility tests & update some existing ones
This commit is contained in:
@@ -109,6 +109,9 @@ describe('Login Modal', () => {
|
|||||||
cy.get('ds-themed-navbar [data-test="register"]').click();
|
cy.get('ds-themed-navbar [data-test="register"]').click();
|
||||||
cy.location('pathname').should('eq', '/register');
|
cy.location('pathname').should('eq', '/register');
|
||||||
cy.get('ds-register-email').should('exist');
|
cy.get('ds-register-email').should('exist');
|
||||||
|
|
||||||
|
// Test accessibility of this page
|
||||||
|
testA11y('ds-register-email');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow forgot password', () => {
|
it('should allow forgot password', () => {
|
||||||
@@ -123,16 +126,26 @@ describe('Login Modal', () => {
|
|||||||
cy.get('ds-themed-navbar [data-test="forgot"]').click();
|
cy.get('ds-themed-navbar [data-test="forgot"]').click();
|
||||||
cy.location('pathname').should('eq', '/forgot');
|
cy.location('pathname').should('eq', '/forgot');
|
||||||
cy.get('ds-forgot-email').should('exist');
|
cy.get('ds-forgot-email').should('exist');
|
||||||
|
|
||||||
|
// Test accessibility of this page
|
||||||
|
testA11y('ds-forgot-email');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests in menus', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
|
// Open login menu & verify accessibility
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
|
|
||||||
cy.get('ds-log-in').should('exist');
|
cy.get('ds-log-in').should('exist');
|
||||||
|
|
||||||
// Analyze <ds-log-in> for accessibility issues
|
|
||||||
testA11y('ds-log-in');
|
testA11y('ds-log-in');
|
||||||
|
|
||||||
|
// Now login
|
||||||
|
page.submitLoginAndPasswordByPressingButton(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||||
|
cy.get('ds-log-in').should('not.exist');
|
||||||
|
|
||||||
|
// Open user menu, verify user menu accesibility
|
||||||
|
page.openUserMenu();
|
||||||
|
cy.get('ds-user-menu').should('be.visible');
|
||||||
|
testA11y('ds-user-menu');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import { Options } from 'cypress-axe';
|
|
||||||
import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME } from 'cypress/support/e2e';
|
import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME } from 'cypress/support/e2e';
|
||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
@@ -35,16 +34,8 @@ describe('My DSpace page', () => {
|
|||||||
|
|
||||||
cy.get('ds-object-detail').should('be.visible');
|
cy.get('ds-object-detail').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-search-page> for accessibility issues
|
// Analyze <ds-my-dspace-page> for accessibility issues
|
||||||
testA11y('ds-my-dspace-page',
|
testA11y('ds-my-dspace-page');
|
||||||
{
|
|
||||||
rules: {
|
|
||||||
// Search filters fail these two "moderate" impact rules
|
|
||||||
'heading-order': { enabled: false },
|
|
||||||
'landmark-unique': { enabled: false }
|
|
||||||
}
|
|
||||||
} as Options
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// NOTE: Deleting existing submissions is exercised by submission.spec.ts
|
// NOTE: Deleting existing submissions is exercised by submission.spec.ts
|
||||||
@@ -136,6 +127,9 @@ describe('My DSpace page', () => {
|
|||||||
|
|
||||||
// The external import searchbox should be visible
|
// The external import searchbox should be visible
|
||||||
cy.get('ds-submission-import-external-searchbar').should('be.visible');
|
cy.get('ds-submission-import-external-searchbar').should('be.visible');
|
||||||
|
|
||||||
|
// Test for accessibility issues
|
||||||
|
testA11y('ds-submission-import-external');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -46,9 +46,8 @@ describe('Search Page', () => {
|
|||||||
testA11y('ds-search-page',
|
testA11y('ds-search-page',
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Search filters fail these two "moderate" impact rules
|
// Card titles fail this test currently
|
||||||
'heading-order': { enabled: false },
|
'heading-order': { enabled: false }
|
||||||
'landmark-unique': { enabled: false }
|
|
||||||
}
|
}
|
||||||
} as Options
|
} as Options
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user