diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts index 3e09f1013..b0bf5849d 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepTwo.cy.ts @@ -46,5 +46,27 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.nextButton).should('not.be.disabled'); cy.get(selectors.studentLevelData.nextButton).click(); }); + + it('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.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.'); + }); }); }); 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',