Skip to content

Commit

Permalink
Merge pull request #680 from cornell-dti/master
Browse files Browse the repository at this point in the history
Spring 2022 Pre-enroll Release
  • Loading branch information
willespencer authored Apr 26, 2022
2 parents 09127a0 + 680bc24 commit f6a4f3e
Show file tree
Hide file tree
Showing 55 changed files with 31,321 additions and 10,602 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
projectId: cornelldti-courseplan-dev
expires: 30d
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ Then access http://localhost:8080/

## Contributors

### SP22

- **Will Spencer** - Developer
- **Ben Shen** - Developer
- **Noah Schiff** - Developer
- **Jerry Wang** - Developer
- **Andrew Xu** - Developer
- **Yuxuan Chen** - Designer
- **Robin Ahn** - Designer
- **Kehui Guo** - Designer
- **Miranda Yu** - PMM
- **Jessica Feng** - TPM
- **Michael Farkouh** - Co-PM
- **Ein Chang** - Co-PM

### FA21

- **Will Spencer** - Developer
Expand Down
97 changes: 97 additions & 0 deletions cypress/integration/accessibility-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* A test file that tests accessibility on all views of CoursePlan
* Can and should be expanded in the future.
* TODO @willespencer remove the skipFailures flag set to true in checkA11y once accessibility issues have been resolved
*/

// Before running tests, start on landing page, login to firebase, and inject accessibility scripts
// Log in occurs with TEST_UID of the courseplan testing account using a function from the cypress-firebase package
before('Visit landing page logged in', () => {
cy.visit('localhost:8080/login');
cy.login(Cypress.env('TEST_UID'));

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000); // ensure the page has time to load

cy.injectAxe(); // inject the axe-core library to check accessibility
});

it('Check landing page accessibility', () => {
cy.checkA11y(null, null, null, true);
});

it('Visit dashboard and check semesterview accessibility', () => {
cy.visit('localhost:8080');

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000); // ensure the page has time to load

cy.injectAxe(); // re-inject the library due to switching page

cy.checkA11y('[data-cyId=semesterView]', null, null, true); // only check accessibility within the semesterView
});

it('Check navbar accessibility', () => {
cy.checkA11y('[data-cyId=navbar]', null, null, true); // only check accessibility within the navbar
});

// Check the accessibility of the requirements sidebar with all toggles fully open
// Note that the selector in checkA11y ensures only the sidebar is inspected
it('Check accessibility of the requirements sidebar', () => {
// open all dropdowns in the sidebar
cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true });
cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true });
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true });

cy.checkA11y('[data-cyId=reqsSidebar]');
});

it('Check accessibility of the bottom bar', () => {
// Note that a course must be added in case the plan is empty to do so
cy.get('[data-cyId=semester-addCourse]').click();
cy.get('[data-cyId=newCourse-dropdown]').type('CS 1110');
cy.get('[data-cyId=newCourse-searchResult]').first().click();
cy.get('[data-cyId=modal-button]').click();

// open the bottom bar
cy.get('[data-cyId=semester-course]').eq(0).click();

cy.checkA11y('[data-cyId=bottombar]', null, null, true); // only check accessibility within the bottom bar
});

// Check the accessibility of each page of Onboarding
// Note that the selector in checkA11y ensures violations behind the modal are not caught
it('Check accessibility of onboarding modal pages', () => {
cy.get('[data-cyId=editProfile]').click();
cy.checkA11y('[data-cyId=onboarding]', null, null, true); // only check accessibility within the onboarding modal

cy.get('[data-cyId=onboarding-nextButton]').click();
cy.checkA11y('[data-cyId=onboarding]', null, null, true);

cy.get('[data-cyId=onboarding-nextButton]').click();
cy.checkA11y('[data-cyId=onboarding]', null, null, true);

cy.get('[data-cyId=onboarding-finishButton]').click();
});

it('Visit privacy policy and check accessibility', () => {
cy.visit('localhost:8080/policy');

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000); // ensure the page has time to load

cy.injectAxe(); // re-inject the library due to switching page

cy.checkA11y(null, null, null, true);
});

it('Visit 404 page and check accessibility', () => {
cy.visit('localhost:8080/404');

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000); // ensure the page has time to load

cy.injectAxe(); // re-inject the library due to switching page

cy.checkA11y(null, null, null, true);
});
27 changes: 21 additions & 6 deletions cypress/integration/hidden-features.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ it('Onboard a new user with all required fields', () => {
cy.get('[data-cyId=onboarding]').clickOutside();
cy.get('[data-cyId=onboarding]').should('be.visible');

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

// set Graduation year to 2022
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
// set Graduation semester to Summer 2022
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
cy.wrap($el)
.invoke('text')
.then(text => {
if (text.includes('Summer')) {
cy.wrap($el).click();
}
});
});
cy.get('[data-cyId=onboarding-nextButton]').should('be.disabled');
cy.get('[data-cyId=onboarding-error]').scrollIntoView().should('be.visible');

cy.get('[data-cyId=onboarding-dropdown]').eq(3).click();
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
cy.wrap($el)
.invoke('text')
Expand All @@ -64,7 +77,7 @@ it('Onboard a new user with all required fields', () => {
cy.get('[data-cyId=onboarding-error]').scrollIntoView().should('be.visible');

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

// confirm 2018, 2022, and engineering are selected on the review screen
// confirm Fall 2018, Summer 2022, and engineering are selected on the review screen
cy.get('[data-cyId=onboarding-entranceYear]').contains('2018');
cy.get('[data-cyId=onboarding-entranceSeason]').contains('Fall');
cy.get('[data-cyId=onboarding-gradYear]').contains('2022');
cy.get('[data-cyId=onboarding-gradSeason]').contains('Summer');
cy.get('[data-cyId=onboarding-college]').contains('Engineering');
cy.get('[data-cyId=onboarding-finishButton]').click();
});
Expand Down
33 changes: 23 additions & 10 deletions cypress/integration/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Can and should be expanded on in more files to test more specific functionality and ensure future bugs are caught earlier
*/

import { getCurrentYear, yearRange } from '../../src/utilities';
import { getCurrentYear, entranceYearRange } from '../../src/utilities';

const startYear = getCurrentYear() - yearRange;
const startYear = getCurrentYear() - entranceYearRange;

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

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

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

// set Graduation year to 2022
cy.get('[data-cyId=onboarding-dropdown]').eq(1).click();
// set Graduation semester to Summer 2022
cy.get('[data-cyId=onboarding-dropdown]').eq(2).click();
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
cy.wrap($el)
.invoke('text')
.then(text => {
if (text.includes('Summer')) {
cy.wrap($el).click();
}
});
});

cy.get('[data-cyId=onboarding-dropdown]').eq(3).click();
cy.get('[data-cyId=onboarding-dropdownItem]').each($el => {
cy.wrap($el)
.invoke('text')
Expand All @@ -119,7 +130,7 @@ it('Switch to engineering college and cs major in class of 2022', () => {
});

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

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

// confirm 2018, 2022, engineering, and computer science are selected on the review screen
// confirm Fall 2018, Summer 2022, engineering, and computer science are selected on the review screen
cy.get('[data-cyId=onboarding-entranceYear]').contains('2018');
cy.get('[data-cyId=onboarding-entranceSeason]').contains('Fall');
cy.get('[data-cyId=onboarding-gradYear]').contains('2022');
cy.get('[data-cyId=onboarding-gradSeason]').contains('Summer');
cy.get('[data-cyId=onboarding-college]').contains('Engineering');
cy.get('[data-cyId=onboarding-major]').contains('Computer Science');
cy.get('[data-cyId=onboarding-finishButton]').click();
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
// Import commands.js using ES2015 syntax:
import './commands';

// Import cypress-axe commands to test accessibility
import 'cypress-axe';

// Alternatively you can use CommonJS syntax:
// require('./commands')
20 changes: 14 additions & 6 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f6a4f3e

Please sign in to comment.