From 65ae8c0e7a3da7f7589328f0604f7a53749ed6d3 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Fri, 25 Aug 2023 14:49:20 -0700 Subject: [PATCH 1/2] EDX-1143 intial commit --- .../sdcSchoolCollectionStepTwo.cy.ts | 35 ++++++++++++++++++- tests-e2e/cypress/support/selectors.ts | 8 +++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts index 3e09f1013..a07b13575 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts @@ -14,7 +14,7 @@ describe('SDC School Collection View', () => { cy.task('setup-schoolUser', { schoolCodes: ['99998'] }); }); }); - after(() => cy.logout()); + // after(() => cy.logout()); beforeEach(() => cy.login()); it('can load dashboard & click data collection card & process collection', () => { @@ -46,5 +46,38 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); cy.get(selectors.studentLevelData.nextButton).click(); }); + + it.only('can remove record containing validation errors', () => { + 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(); + + cy.wait('@pagination').then(({response}) => { + cy.get(selectors.studentLevelData.nextButton).should('be.disabled'); + }) + + // cy.get(selectors.studentLevelData.saveAndRefreshButton).click(); + + // cy.wait('@pagination').then(({response}) => { + // cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); + // cy.get(selectors.studentLevelData.legalLastNameValidationTextInput).should('not.exist'); + // cy.get(selectors.studentLevelData.postalCodeValidationTextInput).should('exist'); + // }) + + // cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); + // cy.get(selectors.studentLevelData.nextButton).click(); + + cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).should('exist'); + cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).click(); + cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecordRejectButton).click(); + cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).click(); + cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecordConfirmButton).click(); + }); }); }); diff --git a/tests-e2e/cypress/support/selectors.ts b/tests-e2e/cypress/support/selectors.ts index fa1a68b58..e7a57a052 100644 --- a/tests-e2e/cypress/support/selectors.ts +++ b/tests-e2e/cypress/support/selectors.ts @@ -161,6 +161,14 @@ export default { viewFirstSchoolContactsButton: '#viewContactsButton0', schoolRow: '.hoverTable' }, + sdcSchoolStudentCollection: { + sdcCollectionStepTwo: { + removeRecord: '#removeRecord', + removeRecordRejectButton: '#rejectBtn', + removeRecordConfirmButton: '#resolveBtn', + } + }, + secureExchangeDetail: { addAttachmentConvButton: '#addAttachmentConvButton', addStudentConvButton: '#addStudentConvButton', From 7de5f519cf3e68bf10a809095f4d085fa388d149 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Tue, 29 Aug 2023 08:56:47 -0700 Subject: [PATCH 2/2] code cleanup --- .../sdcSchoolCollectionStepTwo.cy.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts index a07b13575..b0bf5849d 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts @@ -14,7 +14,7 @@ describe('SDC School Collection View', () => { cy.task('setup-schoolUser', { schoolCodes: ['99998'] }); }); }); - // after(() => cy.logout()); + after(() => cy.logout()); beforeEach(() => cy.login()); it('can load dashboard & click data collection card & process collection', () => { @@ -47,7 +47,7 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.nextButton).click(); }); - it.only('can remove record containing validation errors', () => { + it('can remove record containing validation errors', () => { cy.intercept(Cypress.env('interceptors').collection_students_pagination).as('pagination'); cy.visit('/'); @@ -61,23 +61,12 @@ describe('SDC School Collection View', () => { cy.wait('@pagination').then(({response}) => { cy.get(selectors.studentLevelData.nextButton).should('be.disabled'); }) - - // cy.get(selectors.studentLevelData.saveAndRefreshButton).click(); - - // cy.wait('@pagination').then(({response}) => { - // cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); - // cy.get(selectors.studentLevelData.legalLastNameValidationTextInput).should('not.exist'); - // cy.get(selectors.studentLevelData.postalCodeValidationTextInput).should('exist'); - // }) - - // cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); - // cy.get(selectors.studentLevelData.nextButton).click(); - cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).should('exist'); cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).click(); cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecordRejectButton).click(); cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecord).click(); cy.get(selectors.sdcSchoolStudentCollection.sdcCollectionStepTwo.removeRecordConfirmButton).click(); + cy.get(selectors.snackbar.mainSnackBar).should('exist').contains('Success! The student details have been deleted.'); }); }); });