Skip to content

Commit f3926ba

Browse files
Andrea Barbassovins01-4science
authored andcommitted
Merged in task/ux-plus-cris-2024_02_x/UXP-297 (pull request #76)
[UXP-297] fix e2e tests Approved-by: Vincenzo Mecca
2 parents f320109 + c028e31 commit f3926ba

6 files changed

Lines changed: 53 additions & 35 deletions

File tree

cypress/e2e/admin-search-page.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ describe('Admin Search Page', () => {
1616
// (As we want to scan filter section for accessibility issues as well)
1717
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
1818
// Analyze <ds-admin-search-page> for accessibility issues
19-
testA11y('ds-admin-search-page');
19+
testA11y({
20+
include: ['ds-admin-search-page'],
21+
exclude: ['.noUi-handle'],
22+
});
2023
});
2124
});

cypress/e2e/admin-workflow-page.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ describe('Admin Workflow Page', () => {
1616
// (As we want to scan filter section for accessibility issues as well)
1717
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
1818
// Analyze <ds-admin-workflow-page> for accessibility issues
19-
testA11y('ds-admin-workflow-page');
19+
testA11y({
20+
include: ['ds-admin-workflow-page'],
21+
exclude: ['.noUi-handle'],
22+
});
2023
});
2124
});

cypress/e2e/bulk-access.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ describe('Bulk Access', () => {
1717
// (As we want to scan filter section for accessibility issues as well)
1818
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
1919
// Analyze <ds-bulk-access> for accessibility issues
20-
testA11y('ds-bulk-access', {
20+
testA11y({
21+
include: ['ds-bulk-access'],
22+
exclude: ['.noUi-handle'],
23+
}, {
2124
rules: {
2225
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
2326
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216

cypress/e2e/end-user-agreement.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ describe('End User Agreement', () => {
88
cy.get('ds-end-user-agreement').should('be.visible');
99

1010
// Analyze <ds-end-user-agreement> for accessibility
11-
testA11y('ds-end-user-agreement');
11+
testA11y({
12+
include: ['ds-end-user-agreement'],
13+
exclude: ['ds-markdown-viewer'],
14+
});
1215
});
1316
});

cypress/e2e/my-dspace.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ describe('My DSpace page', () => {
1717
cy.get('.filter-toggle').click({ multiple: true });
1818

1919
// Analyze <ds-my-dspace-page> for accessibility issues
20-
testA11y('ds-my-dspace-page');
20+
testA11y({
21+
include: ['ds-my-dspace-page'],
22+
exclude: ['.noUi-handle'],
23+
});
2124
});
2225

2326
it('should have a working detailed view that passes accessibility tests', () => {

cypress/e2e/submission.cy.ts

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ describe('New Submission page', () => {
2828

2929
// Test entire page for accessibility
3030
testA11y('ds-submission-edit',
31-
{
32-
rules: {
33-
// Author & Subject fields have invalid "aria-multiline" attrs.
34-
// See https://github.com/DSpace/dspace-angular/issues/1272
35-
'aria-allowed-attr': { enabled: false },
36-
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
37-
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
38-
'aria-required-children': { enabled: false },
39-
'nested-interactive': { enabled: false },
40-
// All select boxes fail to have a name / aria-label.
41-
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
42-
'select-name': { enabled: false },
43-
},
44-
45-
} as Options,
31+
{
32+
rules: {
33+
// Author & Subject fields have invalid "aria-multiline" attrs.
34+
// See https://github.com/DSpace/dspace-angular/issues/1272
35+
'aria-allowed-attr': { enabled: false },
36+
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
37+
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
38+
'aria-required-children': { enabled: false },
39+
'nested-interactive': { enabled: false },
40+
// All select boxes fail to have a name / aria-label.
41+
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
42+
'select-name': { enabled: false },
43+
},
44+
45+
} as Options,
4646
);
4747

4848
// Discard button should work
@@ -123,7 +123,7 @@ describe('New Submission page', () => {
123123

124124
// Confirm the required license by checking checkbox
125125
// (NOTE: requires "force:true" cause Cypress claims this checkbox is covered by its own <span>)
126-
cy.get('input#granted').check( { force: true } );
126+
cy.get('input#granted').check({ force: true });
127127

128128
// Before using Cypress drag & drop, we have to manually trigger the "dragover" event.
129129
// This ensures our UI displays the dropzone that covers the entire submission page.
@@ -187,20 +187,23 @@ describe('New Submission page', () => {
187187
cy.get('div#section_license').should('be.visible');
188188

189189
// Test entire page for accessibility
190-
testA11y('ds-submission-edit',
191-
{
192-
rules: {
193-
// Author & Subject fields have invalid "aria-multiline" attrs.
194-
// See https://github.com/DSpace/dspace-angular/issues/1272
195-
'aria-allowed-attr': { enabled: false },
196-
197-
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
198-
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
199-
'aria-required-children': { enabled: false },
200-
'nested-interactive': { enabled: false },
201-
},
202-
203-
} as Options,
190+
testA11y({
191+
include: ['ds-submission-edit'],
192+
exclude: ['.noUi-handle'],
193+
},
194+
{
195+
rules: {
196+
// Author & Subject fields have invalid "aria-multiline" attrs.
197+
// See https://github.com/DSpace/dspace-angular/issues/1272
198+
'aria-allowed-attr': { enabled: false },
199+
200+
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
201+
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
202+
'aria-required-children': { enabled: false },
203+
'nested-interactive': { enabled: false },
204+
},
205+
206+
} as Options,
204207
);
205208

206209
// Back on the form, click the discard button to remove new submission

0 commit comments

Comments
 (0)