diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts index 21b0d3e1..7c4e3bc8 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts @@ -125,6 +125,8 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.nativeAncestryInd).parent().click(); cy.get(selectors.dropdown.listItem).contains('N').click(); + cy.get(selectors.studentLevelData.studentPen).type('101932770'); + cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled'); cy.get(selectors.studentLevelData.saveEditStudentRecord).click(); @@ -150,6 +152,8 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.nativeAncestryInd).parent().click(); cy.get(selectors.dropdown.listItem).contains('N').click(); + cy.get(selectors.studentLevelData.studentPen).type('102866365'); + cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled'); cy.get(selectors.studentLevelData.saveEditStudentRecord).click(); @@ -184,9 +188,9 @@ describe('SDC School Collection View', () => { return obj; }, {}); }); - - expect(records).to.have.length(6); - const expectedPENs = ['102866365', '101932770', '103169744', '']; + records.pop(); //last item is a null line + expect(records).to.have.length(5); + const expectedPENs = ['102866365', '101932770', '103169744']; const expectedCourses = ['0700', undefined]; const expectedApprenticeStatus = ['N', undefined, '']; @@ -225,9 +229,7 @@ describe('SDC School Collection View', () => { cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click(); cy.get(selectors.studentLevelData.collectionSubmission).should('exist'); - cy.get(selectors.studentLevelData.stepThree).should('exist').click(); - cy.get(selectors.studentLevelData.addStudent).should('be.disabled'); - cy.get(selectors.studentLevelData.remove).should('be.disabled'); + cy.get(selectors.studentLevelData.stepThree).should('be.disabled'); }); }); }); diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThreeRefugee.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThreeRefugee.cy.ts index b18a972b..be380a63 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThreeRefugee.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThreeRefugee.cy.ts @@ -49,29 +49,35 @@ describe('SDC School Collection View', () => { cy.get(selectors.studentLevelData.schoolFundingCodes).parent().click(); cy.get(selectors.dropdown.listItem).contains('Newcomer Refugee (16)').click(); + cy.get(selectors.studentLevelData.studentPen).type('102866365'); + cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled'); cy.get(selectors.studentLevelData.saveEditStudentRecord).click(); cy.get(selectors.snackbar.mainSnackBar, {timeout:15000}).should('exist').contains('Success! The student details have been updated.'); cy.reload(); - // checks tab available in Feb - cy.get(selectors.studentLevelData.collectionTypeYear).should('exist').contains('February 2024 Collection'); - cy.get(selectors.stepThreeTabSlider.refugeeButton).should('exist').click(); - cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1); - - // checks special filter for refugee funding - cy.get(selectors.refugeeComponent.filterButton).click(); - cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingEligible).click(); - cy.get(selectors.filters.cancelBtn).click(); - - cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(0); - - cy.get(selectors.refugeeComponent.filterButton).click(); - cy.get(selectors.activeFiltersDrawer.drawer).contains('Clear').click(); - cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingNotEligible).click(); - cy.get(selectors.filters.cancelBtn).click(); - cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1); + // Only run if February Collection + cy.get(selectors.studentLevelData.collectionTypeYear).then($el => { + const text = $el.text(); + if (text.includes('February')) { + cy.get(selectors.stepThreeTabSlider.refugeeButton).should('exist').click(); + cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1); + + // checks special filter for refugee funding + cy.get(selectors.refugeeComponent.filterButton).click(); + cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingEligible).click(); + cy.get(selectors.filters.cancelBtn).click(); + + cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(0); + + cy.get(selectors.refugeeComponent.filterButton).click(); + cy.get(selectors.activeFiltersDrawer.drawer).contains('Clear').click(); + cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingNotEligible).click(); + cy.get(selectors.filters.cancelBtn).click(); + cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1); + } + }); }); }); }); diff --git a/tests-e2e/cypress/support/selectors.ts b/tests-e2e/cypress/support/selectors.ts index ae684117..556b36e8 100644 --- a/tests-e2e/cypress/support/selectors.ts +++ b/tests-e2e/cypress/support/selectors.ts @@ -195,6 +195,7 @@ export default { allowableTab: '#allowableButton', }, filters: { + applyPenLocalIdNameFilterBtn: '#applyPenLocalIdNameFilter', clearFilter: '#clear-filter', studentType: '#studentType', warnings: '#warnings',