-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #995 from bcgov/bugs/atFix2
AT fixes and Addition of EDX-1251
- Loading branch information
Showing
8 changed files
with
378 additions
and
129 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
47 changes: 47 additions & 0 deletions
47
tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepFive.cy.ts
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,47 @@ | ||
import selectors from "../../support/selectors"; | ||
import { AppSetupData } from '../../../cypress.config'; | ||
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service"; | ||
|
||
describe('SDC School Collection View', () => { | ||
context('As an EDX School User', () => { | ||
before(() => { | ||
cy.task<AppSetupData>('dataLoad').then(res => { | ||
cy.task<SchoolCollection>('setup-collections', { | ||
school: res.school, | ||
loadWithStudentAndValidations: true, | ||
seedData: 'stepThreeSeedData' | ||
}); | ||
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] }); | ||
}); | ||
}); | ||
after(() => cy.logout()); | ||
beforeEach(() => cy.login()); | ||
|
||
it('can load dashboard & click data collection card & process collection', () => { | ||
cy.visit('/'); | ||
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School'); | ||
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
// Step five of collection - school contacts | ||
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Testing School'); | ||
cy.get(selectors.schoolContacts.newContactButton).click(); | ||
cy.get(selectors.schoolContacts.newContactTypeDropdown).parent().click(); | ||
cy.get(selectors.schoolContacts.listItem).contains('Principal').click(); | ||
cy.get(selectors.schoolContacts.newContactLastNameInput).type('Fake Principal'); | ||
cy.get(selectors.schoolContacts.newContactEmailInput).type('[email protected]'); | ||
cy.get(selectors.schoolContacts.newContactPhoneNumberInput).type('1231231234'); | ||
cy.get(selectors.schoolContacts.newContactEffectiveDateTextField).click(); | ||
cy.get(selectors.schoolContacts.newContactCalendar).contains('Select').click(); | ||
cy.get(selectors.schoolContacts.newContactPostBtn).click(); | ||
cy.get(selectors.snackbar.mainSnackBar).should('contain', 'Success! The school contact has been created.'); | ||
}); | ||
|
||
}); | ||
}); |
46 changes: 46 additions & 0 deletions
46
tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepFour.cy.ts
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,46 @@ | ||
import selectors from "../../support/selectors"; | ||
import { AppSetupData } from '../../../cypress.config'; | ||
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service"; | ||
|
||
describe('SDC School Collection View', () => { | ||
context('As an EDX School User', () => { | ||
before(() => { | ||
cy.task<AppSetupData>('dataLoad').then(res => { | ||
cy.task<SchoolCollection>('setup-collections', { | ||
school: res.school, | ||
loadWithStudentAndValidations: true, | ||
seedData: 'stepThreeSeedData' | ||
}); | ||
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] }); | ||
}); | ||
}); | ||
after(() => cy.logout()); | ||
beforeEach(() => cy.login()); | ||
|
||
it('can load dashboard & click data collection card & process collection', () => { | ||
cy.visit('/'); | ||
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School'); | ||
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
// Step four of collection - school details | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.schoolDetails.schoolMincodeTitle).contains('99899998'); | ||
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Testing School'); | ||
cy.get(selectors.schoolDetails.editButton).click(); | ||
cy.get(selectors.schoolDetails.schoolDetailsEmail).clear(); | ||
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).clear(); | ||
cy.get(selectors.studentLevelData.formHint).contains('Address, phone, and/or email must be added'); | ||
cy.get(selectors.studentLevelData.nextButton).should('be.disabled'); | ||
cy.get(selectors.schoolDetails.schoolDetailsEmail).type('[email protected]'); | ||
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).type('1234567890'); | ||
cy.get(selectors.schoolDetails.saveButton).click(); | ||
cy.get(selectors.schoolDetails.resolveBtn).click(); | ||
}); | ||
|
||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts
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,52 @@ | ||
import selectors from "../../support/selectors"; | ||
import { AppSetupData } from '../../../cypress.config'; | ||
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service"; | ||
|
||
describe('SDC School Collection View', () => { | ||
context('As an EDX School User', () => { | ||
before(() => { | ||
cy.task<AppSetupData>('dataLoad').then(res => { | ||
cy.task<SchoolCollection>('setup-collections', { | ||
school: res.school, | ||
loadWithStudentAndValidations: true, | ||
seedData: 'stepThreeSeedData' | ||
}); | ||
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] }); | ||
}); | ||
}); | ||
after(() => cy.logout()); | ||
beforeEach(() => cy.login()); | ||
|
||
it('can load dashboard & click data collection card & process collection', () => { | ||
cy.intercept(Cypress.env('interceptors').collection_students_pagination).as('pagination'); | ||
|
||
cy.visit('/'); | ||
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School'); | ||
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
|
||
// Step three of collection - edit/verify data | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
}); | ||
|
||
it('verifies FTE for Reported Students', () => { | ||
cy.intercept(Cypress.env('interceptors').collection_students_pagination).as('pagination'); | ||
cy.visit('/'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
|
||
// Step three of collection - edit/verify data | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(2); | ||
|
||
cy.get('.td-data').each(cell => { | ||
const cellText = cell.text() | ||
if (cellText === '1' || cellText === '0.875') { | ||
cy.log('Correct fte value expected') | ||
} | ||
}); | ||
}); | ||
}); | ||
}); |
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
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 |
---|---|---|
|
@@ -6,92 +6,40 @@ describe('SDC School Collection View', () => { | |
context('As an EDX School User', () => { | ||
before(() => { | ||
cy.task<AppSetupData>('dataLoad').then(res => { | ||
cy.task<SchoolCollection>('setup-collections',{ | ||
cy.task<SchoolCollection>('setup-collections', { | ||
school: res.school, | ||
loadWithStudentAndValidations: false} ); | ||
loadWithStudentAndValidations: true, | ||
seedData: 'stepThreeSeedData' | ||
}); | ||
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] }); | ||
}); | ||
}); | ||
after(() => cy.logout()); | ||
beforeEach(() => cy.login()); | ||
|
||
it('can load dashboard & click data collection card & process collection', () => { | ||
it('can return to previous step in collection', () => { | ||
cy.visit('/'); | ||
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School'); | ||
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
|
||
//step one of collection | ||
cy.get(selectors.studentLevelData.documentUploadButton).click(); | ||
cy.get(selectors.documentUpload.selectFileInput).selectFile('./cypress/uploads/sample-2-student-fnchars.std', {force: true}); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
|
||
// Timeout exception made since time to upload is variable depending on the file size and format. | ||
cy.get(selectors.snackbar.mainSnackBar, {timeout: 10000}).contains('Your document was uploaded successfully.'); | ||
cy.get(selectors.studentLevelData.nextButton, {timeout: 15000}).should('exist').click(); | ||
|
||
// step two of collection - review and fix data | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
//step three of collection - edit/verify data | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
// step four of collection | ||
cy.get(selectors.schoolDetails.schoolMincodeTitle).contains('99899998'); | ||
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Testing School'); | ||
cy.get(selectors.schoolDetails.editButton).click(); | ||
cy.get(selectors.schoolDetails.schoolDetailsEmail).clear(); | ||
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).clear(); | ||
cy.get(selectors.studentLevelData.formHint).contains('Address, phone, and/or email must be added'); | ||
cy.get(selectors.studentLevelData.nextButton).should('be.disabled'); | ||
cy.get(selectors.schoolDetails.schoolDetailsEmail).type('[email protected]'); | ||
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).type('1234567890'); | ||
cy.get(selectors.schoolDetails.saveButton).click(); | ||
cy.get(selectors.schoolDetails.resolveBtn).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
//step five of collection | ||
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Testing School'); | ||
cy.get(selectors.schoolContacts.newContactButton).click(); | ||
cy.get(selectors.schoolContacts.newContactTypeDropdown).parent().click(); | ||
cy.get(selectors.schoolContacts.listItem).contains('Principal').click(); | ||
cy.get(selectors.schoolContacts.newContactLastNameInput).type('Fake Principal'); | ||
cy.get(selectors.schoolContacts.newContactEmailInput).type('[email protected]'); | ||
cy.get(selectors.schoolContacts.newContactPhoneNumberInput).type('1231231234'); | ||
cy.get(selectors.schoolContacts.newContactEffectiveDateTextField).click(); | ||
cy.get(selectors.schoolContacts.newContactCalendar).contains('Select').click(); | ||
cy.get(selectors.schoolContacts.newContactPostBtn).click(); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
}); | ||
|
||
it('can return to previous step in collection', () => { | ||
cy.visit('/'); | ||
cy.get(selectors.dashboard.dataCollectionsTile).click(); | ||
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); | ||
|
||
//step one of collection - upload file | ||
cy.get(selectors.studentLevelData.documentUploadButton).click(); | ||
cy.get(selectors.documentUpload.selectFileInput).selectFile('./cypress/uploads/sample-2-student-fnchars.std', {force: true}); | ||
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School'); | ||
cy.get(selectors.studentLevelData.nextButton, {timeout: 15000}).should('exist').should('be.enabled').click(); | ||
|
||
// step two of collection - review and fix data | ||
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click(); | ||
|
||
//step three of collection - edit/verify data | ||
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click(); | ||
|
||
// checking if the previous button is clickable and the user is taken to the previous step; brings to step 2 | ||
cy.get(selectors.studentLevelData.stepTwo).should('exist').should('be.enabled').click(); | ||
cy.get(selectors.studentLevelData.stepTwo).should('exist').click(); | ||
|
||
// Step three should be disabled | ||
cy.get(selectors.studentLevelData.stepThree).should('exist').should('be.disabled'); | ||
cy.get(selectors.studentLevelData.stepThree).should('exist').should('not.be.enabled'); | ||
|
||
// User moved to next step by clicking next button | ||
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click(); | ||
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled'); | ||
cy.get(selectors.studentLevelData.nextButton).click(); | ||
|
||
}); | ||
}); | ||
|
Oops, something went wrong.