|
1 |
| -/** |
2 |
| - * A test file that tests accessibility on all views of CoursePlan |
3 |
| - * Can and should be expanded in the future. |
4 |
| - * TODO @willespencer remove the skipFailures flag set to true in checkA11y once accessibility issues have been resolved |
5 |
| - */ |
6 |
| - |
7 |
| -// Before running tests, start on landing page, login to firebase, and inject accessibility scripts |
8 |
| -// Log in occurs with TEST_UID of the courseplan testing account using a function from the cypress-firebase package |
9 |
| -before('Visit landing page logged in', () => { |
10 |
| - cy.visit('localhost:8080/login'); |
11 |
| - cy.login(Cypress.env('TEST_UID')); |
12 |
| - |
13 |
| - // eslint-disable-next-line cypress/no-unnecessary-waiting |
14 |
| - cy.wait(2000); // ensure the page has time to load |
15 |
| - |
16 |
| - cy.injectAxe(); // inject the axe-core library to check accessibility |
17 |
| -}); |
18 |
| - |
19 |
| -it('Check landing page accessibility', () => { |
20 |
| - cy.checkA11y(null, null, null, true); |
21 |
| -}); |
22 |
| - |
23 |
| -it('Visit dashboard and check semesterview accessibility', () => { |
24 |
| - cy.visit('localhost:8080'); |
25 |
| - |
26 |
| - // eslint-disable-next-line cypress/no-unnecessary-waiting |
27 |
| - cy.wait(5000); // ensure the page has time to load |
28 |
| - |
29 |
| - cy.injectAxe(); // re-inject the library due to switching page |
30 |
| - |
31 |
| - cy.checkA11y('[data-cyId=semesterView]', null, null, true); // only check accessibility within the semesterView |
32 |
| -}); |
33 |
| - |
34 |
| -it('Check navbar accessibility', () => { |
35 |
| - cy.checkA11y('[data-cyId=navbar]', null, null, true); // only check accessibility within the navbar |
36 |
| -}); |
37 |
| - |
38 |
| -// Test to confirm that the new user walkthrough works as expected |
39 |
| -// Click through the initial explanation, then the 4 following steps, and finally the finishing page |
40 |
| -it('Click through schedule generator tour', () => { |
41 |
| - cy.get('.introjs-nextbutton').click(); |
42 |
| -}); |
43 |
| - |
44 |
| -// Check the accessibility of the requirements sidebar with all toggles fully open |
45 |
| -// Note that the selector in checkA11y ensures only the sidebar is inspected |
46 |
| -it('Check accessibility of the requirements sidebar', () => { |
47 |
| - // Note that there must a completed requirement (i.e. swim test) |
48 |
| - cy.get('[data-cyId=semester-addCourse]').click(); |
49 |
| - cy.get('[data-cyId=newCourse-dropdown]').type('PE 1100'); |
50 |
| - cy.get('[data-cyId=newCourse-searchResult]').first().click(); |
51 |
| - cy.get('[data-cyId=modal-button]').click(); |
52 |
| - |
53 |
| - // open all dropdowns in the sidebar |
54 |
| - cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true }); |
55 |
| - cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true }); |
56 |
| - cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true, force: true }); |
57 |
| - |
58 |
| - cy.checkA11y('[data-cyId=reqsSidebar]'); |
59 |
| -}); |
60 |
| - |
61 |
| -it('Check accessibility of the bottom bar', () => { |
62 |
| - // Note that a course must be added in case the plan is empty to do so |
63 |
| - cy.get('[data-cyId=semester-addCourse]').click(); |
64 |
| - cy.get('[data-cyId=newCourse-dropdown]').type('CS 1110'); |
65 |
| - cy.get('[data-cyId=newCourse-searchResult]').first().click(); |
66 |
| - cy.get('[data-cyId=modal-button]').click(); |
67 |
| - |
68 |
| - // open the bottom bar |
69 |
| - cy.get('[data-cyId=semester-course]').eq(0).click(); |
70 |
| - |
71 |
| - // eslint-disable-next-line cypress/no-unnecessary-waiting |
72 |
| - cy.wait(5000); |
73 |
| - cy.checkA11y('[data-cyId=bottombar]', null, null, true); // only check accessibility within the bottom bar |
74 |
| -}); |
75 |
| - |
76 |
| -// Check the accessibility of each page of Onboarding |
77 |
| -// Note that the selector in checkA11y ensures violations behind the modal are not caught |
78 |
| -it('Check accessibility of onboarding modal pages', () => { |
79 |
| - cy.get('[data-cyId=editProfile]').click(); |
80 |
| - cy.checkA11y('[data-cyId=onboarding]', null, null, true); // only check accessibility within the onboarding modal |
81 |
| - |
82 |
| - cy.get('[data-cyId=onboarding-nextButton]').click(); |
83 |
| - cy.checkA11y('[data-cyId=onboarding]', null, null, true); |
84 |
| - |
85 |
| - cy.get('[data-cyId=onboarding-nextButton]').click(); |
86 |
| - cy.checkA11y('[data-cyId=onboarding]', null, null, true); |
87 |
| - |
88 |
| - cy.get('[data-cyId=onboarding-finishButton]').click(); |
89 |
| -}); |
90 |
| - |
91 |
| -it('Visit privacy policy and check accessibility', () => { |
92 |
| - cy.visit('localhost:8080/policy'); |
93 |
| - |
94 |
| - // eslint-disable-next-line cypress/no-unnecessary-waiting |
95 |
| - cy.wait(2000); // ensure the page has time to load |
96 |
| - |
97 |
| - cy.injectAxe(); // re-inject the library due to switching page |
98 |
| - |
99 |
| - cy.checkA11y(null, null, null, true); |
100 |
| -}); |
101 |
| - |
102 |
| -it('Visit 404 page and check accessibility', () => { |
103 |
| - cy.visit('localhost:8080/404'); |
104 |
| - |
105 |
| - // eslint-disable-next-line cypress/no-unnecessary-waiting |
106 |
| - cy.wait(2000); // ensure the page has time to load |
107 |
| - |
108 |
| - cy.injectAxe(); // re-inject the library due to switching page |
109 |
| - |
110 |
| - cy.checkA11y(null, null, null, true); |
111 |
| -}); |
| 1 | +// /** |
| 2 | +// * A test file that tests accessibility on all views of CoursePlan |
| 3 | +// * Can and should be expanded in the future. |
| 4 | +// * TODO @willespencer remove the skipFailures flag set to true in checkA11y once accessibility issues have been resolved |
| 5 | +// */ |
| 6 | + |
| 7 | +// // Before running tests, start on landing page, login to firebase, and inject accessibility scripts |
| 8 | +// // Log in occurs with TEST_UID of the courseplan testing account using a function from the cypress-firebase package |
| 9 | +// before('Visit landing page logged in', () => { |
| 10 | +// cy.visit('localhost:8080/login'); |
| 11 | +// cy.login(Cypress.env('TEST_UID')); |
| 12 | + |
| 13 | +// // eslint-disable-next-line cypress/no-unnecessary-waiting |
| 14 | +// cy.wait(2000); // ensure the page has time to load |
| 15 | + |
| 16 | +// cy.injectAxe(); // inject the axe-core library to check accessibility |
| 17 | +// }); |
| 18 | + |
| 19 | +// it('Check landing page accessibility', () => { |
| 20 | +// cy.checkA11y(null, null, null, true); |
| 21 | +// }); |
| 22 | + |
| 23 | +// it('Visit dashboard and check semesterview accessibility', () => { |
| 24 | +// cy.visit('localhost:8080'); |
| 25 | + |
| 26 | +// // eslint-disable-next-line cypress/no-unnecessary-waiting |
| 27 | +// cy.wait(5000); // ensure the page has time to load |
| 28 | + |
| 29 | +// cy.injectAxe(); // re-inject the library due to switching page |
| 30 | + |
| 31 | +// cy.checkA11y('[data-cyId=semesterView]', null, null, true); // only check accessibility within the semesterView |
| 32 | +// }); |
| 33 | + |
| 34 | +// it('Check navbar accessibility', () => { |
| 35 | +// cy.checkA11y('[data-cyId=navbar]', null, null, true); // only check accessibility within the navbar |
| 36 | +// }); |
| 37 | + |
| 38 | +// // Check the accessibility of each page of Onboarding |
| 39 | +// // Note that the selector in checkA11y ensures violations behind the modal are not caught |
| 40 | +// it('Check accessibility of onboarding modal pages', () => { |
| 41 | +// cy.get('[data-cyId=editProfile]').click(); |
| 42 | +// cy.checkA11y('[data-cyId=onboarding]', null, null, true); // only check accessibility within the onboarding modal |
| 43 | +// cy.get('[data-cyId=onboarding-nextButton]').scrollIntoView().should('be.visible'); // scroll until the next button is visible |
| 44 | +// cy.get('[data-cyId=onboarding-nextButton]').click(); |
| 45 | +// cy.checkA11y('[data-cyId=onboarding]', null, null, true); |
| 46 | +// cy.get('[data-cyId=onboarding-nextButton]').scrollIntoView().should('be.visible'); // scroll until the next button is visible |
| 47 | +// cy.get('[data-cyId=onboarding-nextButton]').click(); |
| 48 | +// cy.checkA11y('[data-cyId=onboarding]', null, null, true); |
| 49 | +// cy.get('[data-cyId=onboarding-nextButton]').scrollIntoView().should('be.visible'); // scroll until the next button is visible |
| 50 | +// cy.get('[data-cyId=onboarding-finishButton]').click(); |
| 51 | +// }); |
| 52 | + |
| 53 | +// // Test to confirm that the new user walkthrough works as expected |
| 54 | +// // Click through the initial explanation, then the 4 following steps, and finally the finishing page |
| 55 | +// it('Click through schedule generator tour', () => { |
| 56 | +// cy.get('.introjs-nextbutton').click(); |
| 57 | +// }); |
| 58 | + |
| 59 | +// // Check the accessibility of the requirements sidebar with all toggles fully open |
| 60 | +// // Note that the selector in checkA11y ensures only the sidebar is inspected |
| 61 | +// it('Check accessibility of the requirements sidebar', () => { |
| 62 | +// // Note that there must a completed requirement (i.e. swim test) |
| 63 | +// cy.get('[data-cyId=semester-addCourse]').click(); |
| 64 | +// cy.get('[data-cyId=newCourse-dropdown]').type('PE 1100'); |
| 65 | +// cy.get('[data-cyId=newCourse-searchResult]').first().click(); |
| 66 | +// cy.get('[data-cyId=modal-button]').click(); |
| 67 | + |
| 68 | +// // open all dropdowns in the sidebar |
| 69 | +// cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true }); |
| 70 | +// cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true }); |
| 71 | +// cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true, force: true }); |
| 72 | + |
| 73 | +// cy.checkA11y('[data-cyId=reqsSidebar]'); |
| 74 | +// }); |
| 75 | + |
| 76 | +// it('Check accessibility of the bottom bar', () => { |
| 77 | +// // Note that a course must be added in case the plan is empty to do so |
| 78 | +// cy.get('[data-cyId=semester-addCourse]').click(); |
| 79 | +// cy.get('[data-cyId=newCourse-dropdown]').type('CS 1110'); |
| 80 | +// cy.get('[data-cyId=newCourse-searchResult]').first().click(); |
| 81 | +// cy.get('[data-cyId=modal-button]').click(); |
| 82 | + |
| 83 | +// // open the bottom bar |
| 84 | +// cy.get('[data-cyId=semester-course]').eq(0).click(); |
| 85 | + |
| 86 | +// // eslint-disable-next-line cypress/no-unnecessary-waiting |
| 87 | +// cy.wait(5000); |
| 88 | +// cy.checkA11y('[data-cyId=bottombar]', null, null, true); // only check accessibility within the bottom bar |
| 89 | +// }); |
| 90 | + |
| 91 | +// it('Visit privacy policy and check accessibility', () => { |
| 92 | +// cy.visit('localhost:8080/policy'); |
| 93 | + |
| 94 | +// // eslint-disable-next-line cypress/no-unnecessary-waiting |
| 95 | +// cy.wait(2000); // ensure the page has time to load |
| 96 | + |
| 97 | +// cy.injectAxe(); // re-inject the library due to switching page |
| 98 | + |
| 99 | +// cy.checkA11y(null, null, null, true); |
| 100 | +// }); |
| 101 | + |
| 102 | +// it('Visit 404 page and check accessibility', () => { |
| 103 | +// cy.visit('localhost:8080/404'); |
| 104 | + |
| 105 | +// // eslint-disable-next-line cypress/no-unnecessary-waiting |
| 106 | +// cy.wait(2000); // ensure the page has time to load |
| 107 | + |
| 108 | +// cy.injectAxe(); // re-inject the library due to switching page |
| 109 | + |
| 110 | +// cy.checkA11y(null, null, null, true); |
| 111 | +// }); |
0 commit comments