-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
cypress/e2e/partner-admin/default-tests/viewIndividualReport.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const testDistrictId = Cypress.env('testDistrictId'); | ||
const testPartnerAdministrationName = Cypress.env('testPartnerAdministrationName'); | ||
const testPartnerAdministrationId = Cypress.env('testPartnerAdministrationId'); | ||
const testPartnerAdminUsername = Cypress.env('partnerAdminUsername'); | ||
const testPartnerAdminPassword = Cypress.env('partnerAdminPassword'); | ||
const timeout = Cypress.env('timeout'); | ||
const baseUrl = Cypress.env('baseUrl'); | ||
const testUserList = Cypress.env('testUserList'); | ||
const testAssignments = ['vocab', 'Multichoice']; | ||
|
||
function checkUrl() { | ||
cy.login(testPartnerAdminUsername, testPartnerAdminPassword); | ||
cy.navigateTo('/'); | ||
cy.url({ timeout: timeout }).should('eq', `${baseUrl}/`); | ||
} | ||
|
||
function clickScoreButton() { | ||
cy.get('button', { timeout: timeout }).contains('Scores').first().click(); | ||
cy.url({ timeout: timeout }).should( | ||
'eq', | ||
`${baseUrl}/scores/${testPartnerAdministrationId}/district/${testDistrictId}`, | ||
); | ||
} | ||
|
||
function checkAssignmentColumns() { | ||
cy.get('[data-cy="roar-data-table"] thead th').then(($header) => { | ||
const tableHeaders = $header.map((index, elem) => Cypress.$(elem).text()).get(); | ||
|
||
testAssignments.forEach((assignment) => { | ||
expect(tableHeaders).to.include(assignment); | ||
}); | ||
}); | ||
} | ||
|
||
describe('The partner admin can view score reports for a given administration.', () => { | ||
it('Selects an administration and views its score report.', () => { | ||
checkUrl(); | ||
cy.getAdministrationCard(testPartnerAdministrationName); | ||
clickScoreButton(); | ||
cy.checkUserList(testUserList); | ||
checkAssignmentColumns(testAssignments); | ||
cy.get('button').contains('Report').click(); | ||
cy.wait(4000); | ||
cy.get('div').contains('Individual Score Report'); | ||
cy.get('button').contains('Expand All Sections').click(); | ||
cy.get('button').contains('Export to PDF'); | ||
cy.get('div').contains('The ROAR assessements return 3 kinds of scores'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters