Skip to content

Commit f6a4f3e

Browse files
authored
Merge pull request #680 from cornell-dti/master
Spring 2022 Pre-enroll Release
2 parents 09127a0 + 680bc24 commit f6a4f3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+31321
-10602
lines changed

.github/workflows/ci-build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
repoToken: '${{ secrets.GITHUB_TOKEN }}'
2222
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
2323
projectId: cornelldti-courseplan-dev
24+
expires: 30d
2425
env:
2526
FIREBASE_CLI_PREVIEWS: hostingchannels
2627
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ Then access http://localhost:8080/
2727

2828
## Contributors
2929

30+
### SP22
31+
32+
- **Will Spencer** - Developer
33+
- **Ben Shen** - Developer
34+
- **Noah Schiff** - Developer
35+
- **Jerry Wang** - Developer
36+
- **Andrew Xu** - Developer
37+
- **Yuxuan Chen** - Designer
38+
- **Robin Ahn** - Designer
39+
- **Kehui Guo** - Designer
40+
- **Miranda Yu** - PMM
41+
- **Jessica Feng** - TPM
42+
- **Michael Farkouh** - Co-PM
43+
- **Ein Chang** - Co-PM
44+
3045
### FA21
3146

3247
- **Will Spencer** - Developer
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 the requirements sidebar with all toggles fully open
39+
// Note that the selector in checkA11y ensures only the sidebar is inspected
40+
it('Check accessibility of the requirements sidebar', () => {
41+
// open all dropdowns in the sidebar
42+
cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true });
43+
cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true });
44+
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true });
45+
46+
cy.checkA11y('[data-cyId=reqsSidebar]');
47+
});
48+
49+
it('Check accessibility of the bottom bar', () => {
50+
// Note that a course must be added in case the plan is empty to do so
51+
cy.get('[data-cyId=semester-addCourse]').click();
52+
cy.get('[data-cyId=newCourse-dropdown]').type('CS 1110');
53+
cy.get('[data-cyId=newCourse-searchResult]').first().click();
54+
cy.get('[data-cyId=modal-button]').click();
55+
56+
// open the bottom bar
57+
cy.get('[data-cyId=semester-course]').eq(0).click();
58+
59+
cy.checkA11y('[data-cyId=bottombar]', null, null, true); // only check accessibility within the bottom bar
60+
});
61+
62+
// Check the accessibility of each page of Onboarding
63+
// Note that the selector in checkA11y ensures violations behind the modal are not caught
64+
it('Check accessibility of onboarding modal pages', () => {
65+
cy.get('[data-cyId=editProfile]').click();
66+
cy.checkA11y('[data-cyId=onboarding]', null, null, true); // only check accessibility within the onboarding modal
67+
68+
cy.get('[data-cyId=onboarding-nextButton]').click();
69+
cy.checkA11y('[data-cyId=onboarding]', null, null, true);
70+
71+
cy.get('[data-cyId=onboarding-nextButton]').click();
72+
cy.checkA11y('[data-cyId=onboarding]', null, null, true);
73+
74+
cy.get('[data-cyId=onboarding-finishButton]').click();
75+
});
76+
77+
it('Visit privacy policy and check accessibility', () => {
78+
cy.visit('localhost:8080/policy');
79+
80+
// eslint-disable-next-line cypress/no-unnecessary-waiting
81+
cy.wait(2000); // ensure the page has time to load
82+
83+
cy.injectAxe(); // re-inject the library due to switching page
84+
85+
cy.checkA11y(null, null, null, true);
86+
});
87+
88+
it('Visit 404 page and check accessibility', () => {
89+
cy.visit('localhost:8080/404');
90+
91+
// eslint-disable-next-line cypress/no-unnecessary-waiting
92+
cy.wait(2000); // ensure the page has time to load
93+
94+
cy.injectAxe(); // re-inject the library due to switching page
95+
96+
cy.checkA11y(null, null, null, true);
97+
});

cypress/integration/hidden-features.spec.ts

+21-6
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ it('Onboard a new user with all required fields', () => {
3535
cy.get('[data-cyId=onboarding]').clickOutside();
3636
cy.get('[data-cyId=onboarding]').should('be.visible');
3737

38-
// set Graduation year to 2018
39-
cy.get('[data-cyId=onboarding-dropdown]').eq(0).click();
38+
// set Entrance semester to 2018 (default Fall)
39+
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
4040
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
4141
cy.wrap($el)
4242
.invoke('text')
@@ -49,8 +49,21 @@ it('Onboard a new user with all required fields', () => {
4949
cy.get('[data-cyId=onboarding-nextButton]').should('be.disabled');
5050
cy.get('[data-cyId=onboarding-error]').scrollIntoView().should('be.visible');
5151

52-
// set Graduation year to 2022
53-
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
52+
// set Graduation semester to Summer 2022
53+
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
54+
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
55+
cy.wrap($el)
56+
.invoke('text')
57+
.then(text => {
58+
if (text.includes('Summer')) {
59+
cy.wrap($el).click();
60+
}
61+
});
62+
});
63+
cy.get('[data-cyId=onboarding-nextButton]').should('be.disabled');
64+
cy.get('[data-cyId=onboarding-error]').scrollIntoView().should('be.visible');
65+
66+
cy.get('[data-cyId=onboarding-dropdown]').eq(3).click();
5467
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
5568
cy.wrap($el)
5669
.invoke('text')
@@ -64,7 +77,7 @@ it('Onboard a new user with all required fields', () => {
6477
cy.get('[data-cyId=onboarding-error]').scrollIntoView().should('be.visible');
6578

6679
// set to Engineering college
67-
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
80+
cy.get('[data-cyId=onboarding-dropdown]').eq(4).click();
6881
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
6982
cy.wrap($el)
7083
.invoke('text')
@@ -80,9 +93,11 @@ it('Onboard a new user with all required fields', () => {
8093
cy.get('[data-cyId=onboarding-error]').should('not.exist');
8194
cy.get('[data-cyId=onboarding-nextButton]').click();
8295

83-
// confirm 2018, 2022, and engineering are selected on the review screen
96+
// confirm Fall 2018, Summer 2022, and engineering are selected on the review screen
8497
cy.get('[data-cyId=onboarding-entranceYear]').contains('2018');
98+
cy.get('[data-cyId=onboarding-entranceSeason]').contains('Fall');
8599
cy.get('[data-cyId=onboarding-gradYear]').contains('2022');
100+
cy.get('[data-cyId=onboarding-gradSeason]').contains('Summer');
86101
cy.get('[data-cyId=onboarding-college]').contains('Engineering');
87102
cy.get('[data-cyId=onboarding-finishButton]').click();
88103
});

cypress/integration/test.spec.ts

+23-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Can and should be expanded on in more files to test more specific functionality and ensure future bugs are caught earlier
44
*/
55

6-
import { getCurrentYear, yearRange } from '../../src/utilities';
6+
import { getCurrentYear, entranceYearRange } from '../../src/utilities';
77

8-
const startYear = getCurrentYear() - yearRange;
8+
const startYear = getCurrentYear() - entranceYearRange;
99

1010
// Before running tests, starts on landing page, logs in to firebase, then visits the dashboard
1111
// Log in occurs with TEST_UID of the courseplan testing account using a function from the cypress-firebase package
@@ -90,12 +90,12 @@ it('Edit a semester (Fall of oldest year -> Spring of second oldest year)', () =
9090
.contains(`Spring ${startYear + 1}`);
9191
});
9292

93-
// Test that you can change entrance year, grad year, colleges and majors. A later requirements test is dependent on these choices
93+
// Test that you can change entrance semester, grad semester, colleges and majors. A later requirements test is dependent on these choices
9494
it('Switch to engineering college and cs major in class of 2022', () => {
9595
cy.get('[data-cyId=editProfile]').click();
9696

97-
// set Graduation year to 2018
98-
cy.get('[data-cyId=onboarding-dropdown]').eq(0).click();
97+
// set Entrance semester to 2018
98+
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
9999
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
100100
cy.wrap($el)
101101
.invoke('text')
@@ -106,8 +106,19 @@ it('Switch to engineering college and cs major in class of 2022', () => {
106106
});
107107
});
108108

109-
// set Graduation year to 2022
110-
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
109+
// set Graduation semester to Summer 2022
110+
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
111+
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
112+
cy.wrap($el)
113+
.invoke('text')
114+
.then(text => {
115+
if (text.includes('Summer')) {
116+
cy.wrap($el).click();
117+
}
118+
});
119+
});
120+
121+
cy.get('[data-cyId=onboarding-dropdown]').eq(3).click();
111122
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
112123
cy.wrap($el)
113124
.invoke('text')
@@ -119,7 +130,7 @@ it('Switch to engineering college and cs major in class of 2022', () => {
119130
});
120131

121132
// set to Engineering college
122-
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
133+
cy.get('[data-cyId=onboarding-dropdown]').eq(4).click();
123134
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
124135
cy.wrap($el)
125136
.invoke('text')
@@ -131,7 +142,7 @@ it('Switch to engineering college and cs major in class of 2022', () => {
131142
});
132143

133144
// set to CS major
134-
cy.get('[data-cyId=onboarding-dropdown]').eq(3).click();
145+
cy.get('[data-cyId=onboarding-dropdown]').eq(5).click();
135146
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
136147
cy.wrap($el)
137148
.invoke('text')
@@ -146,9 +157,11 @@ it('Switch to engineering college and cs major in class of 2022', () => {
146157
cy.get('[data-cyId=onboarding-nextButton]').click();
147158
cy.get('[data-cyId=onboarding-nextButton]').click();
148159

149-
// confirm 2018, 2022, engineering, and computer science are selected on the review screen
160+
// confirm Fall 2018, Summer 2022, engineering, and computer science are selected on the review screen
150161
cy.get('[data-cyId=onboarding-entranceYear]').contains('2018');
162+
cy.get('[data-cyId=onboarding-entranceSeason]').contains('Fall');
151163
cy.get('[data-cyId=onboarding-gradYear]').contains('2022');
164+
cy.get('[data-cyId=onboarding-gradSeason]').contains('Summer');
152165
cy.get('[data-cyId=onboarding-college]').contains('Engineering');
153166
cy.get('[data-cyId=onboarding-major]').contains('Computer Science');
154167
cy.get('[data-cyId=onboarding-finishButton]').click();

cypress/support/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
// Import commands.js using ES2015 syntax:
1717
import './commands';
1818

19+
// Import cypress-axe commands to test accessibility
20+
import 'cypress-axe';
21+
1922
// Alternatively you can use CommonJS syntax:
2023
// require('./commands')

functions/package-lock.json

+14-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)