Skip to content

Commit

Permalink
Merge pull request #906 from bcgov/feature/regressionTestsCleanup
Browse files Browse the repository at this point in the history
Added AT for stage 3 uploading 1701 file
  • Loading branch information
angadhsingh1 authored Jul 26, 2023
2 parents 023d97f + 6facee9 commit 289d6ec
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
32 changes: 22 additions & 10 deletions tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionView.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import selectors from "../../support/selectors";
import { AppSetupData } from '../../../cypress.config';
import {timeout} from "rxjs";

describe('SDC School Collection View', () => {
context('As an EDX School User', () => {
Expand All @@ -14,28 +15,28 @@ describe('SDC School Collection View', () => {

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.title).contains('Dashboard | EDX Automation Test School');
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.title).contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.dataCollectionsLanding.title).contains('Student Level Data (1701) | EDX Automation Test School');
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

//step one of collection
cy.get(selectors.schoolDetails.schoolMincodeTitle).contains('99899998');
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Testing School')
cy.get(selectors.stepOneSchoolDetails.formHint).contains('Address, phone, and/or email must be added');
cy.get(selectors.stepOneSchoolDetails.nextButton).should('be.disabled');
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Test 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('fake@gmail.com');
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).type('1234567890');
cy.get(selectors.schoolDetails.saveButton).click();
cy.get(selectors.schoolDetails.resolveBtn).click();
cy.get(selectors.stepOneSchoolDetails.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();

//step two of collection
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Testing School');
cy.get(selectors.stepTwoSchoolContacts.formHint).contains('A principal with an active start date and contact information must be added');
cy.get(selectors.stepTwoSchoolContacts.nextButton).should('be.disabled');
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Test School');
cy.get(selectors.schoolContacts.newContactButton).click();
cy.get(selectors.schoolContacts.newContactTypeDropdown).parent().click();
cy.get(selectors.schoolContacts.listItem).contains('Principal').click();
Expand All @@ -45,7 +46,18 @@ describe('SDC School Collection View', () => {
cy.get(selectors.schoolContacts.newContactEffectiveDateTextField).click();
cy.get(selectors.schoolContacts.newContactCalendar).contains('Select').click();
cy.get(selectors.schoolContacts.newContactPostBtn).click();
cy.get(selectors.stepTwoSchoolContacts.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();

//step three 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 Test School');

// Timeout exception made since time to upload is varaible 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').should('be.enabled').click();


});
});
});
12 changes: 5 additions & 7 deletions tests-e2e/cypress/support/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export default {
documentUpload: { //common component
selectFileInput: '#selectFileInput',
uploadDocumentButton: '#upload_form',
uploadDocumentTypeCodeSelect: '#uploadDocumentTypeCodeSelect'
uploadDocumentTypeCodeSelect: '#uploadDocumentTypeCodeSelect',
stepThreeNextButton: '#nextButton',
},
dropdown: { //common component
listItem: '.v-list-item'
Expand Down Expand Up @@ -193,13 +194,10 @@ export default {
snackbar: {
mainSnackBar: '#mainSnackBar'
},
stepOneSchoolDetails: {
formHint: 'p.form-hint',
nextButton: '#nextButton'
},
stepTwoSchoolContacts: {
studentLevelData: {
formHint: 'p.form-hint',
nextButton: '#nextButton'
nextButton: '#nextButton',
documentUploadButton: '#uploadButton',
},
userActivationPage: {
mincodeInput: '#instituteIdentifierTextField',
Expand Down
4 changes: 4 additions & 0 deletions tests-e2e/cypress/uploads/sample-2-student-fnchars.std
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FFI99899998Lindsay Park Elementary 20230426
SRM0000000000011234567890Nader Nickolas Ryan Jacques 19720820F N943 000020000000000000000 0800 V8N0B6
SRM0000000000021234567890Stamm Richmond Kuhlman Gregory 19860428M N943 000070000000000000000 0800 V8N1E3
BTR000002Follett Software MYED TSW_VM

0 comments on commit 289d6ec

Please sign in to comment.