From 55ada2daabc93f0f17fd39d45c14b30a38cbfe93 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Mon, 28 Aug 2023 16:23:13 -0700 Subject: [PATCH 1/4] intial commit --- tests-e2e/cypress.config.ts | 3 +- .../sdcSchoolCollectionStepThree.cy.ts | 27 ++- .../services/sdc-collection-api-service.ts | 203 +++++++++++++++++- 3 files changed, 227 insertions(+), 6 deletions(-) diff --git a/tests-e2e/cypress.config.ts b/tests-e2e/cypress.config.ts index 2528343b6..a977e4774 100644 --- a/tests-e2e/cypress.config.ts +++ b/tests-e2e/cypress.config.ts @@ -47,7 +47,8 @@ export default defineConfig({ viewportWidth: 1920, defaultCommandTimeout: 5000, e2e: { - baseUrl: 'https://dev.educationdataexchange.gov.bc.ca', + // baseUrl: 'https://dev.educationdataexchange.gov.bc.ca', + baseUrl: 'http://localhost:8081', setupNodeEvents(on, config) { on('task', { 'dataLoad': async (options: InstituteOptions) => { diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts index 755d06492..7cbd58afa 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts @@ -9,12 +9,12 @@ describe('SDC School Collection View', () => { cy.task('setup-collections', { school: res.school, loadWithStudentAndValidations: true, - seedData: 'stepThreeSeedData' + seedData: 'careerProgramsSeedData' }); 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', () => { @@ -39,7 +39,7 @@ describe('SDC School Collection View', () => { // Step three of collection - edit/verify data cy.get(selectors.studentLevelData.nextButton).click(); - cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(2); + cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(3); cy.get('.td-data').each(cell => { const cellText = cell.text() @@ -48,5 +48,26 @@ describe('SDC School Collection View', () => { } }); }); + + it.only('verifies career programs 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(3); + cy.get('button[value="Career Programs"]').click(); + + + // cy.get('.td-data').each(cell => { + // const cellText = cell.text() + // cy.log(cellText) + // if (cellText === '1' || cellText === '0.875') { + // cy.log('Correct fte value expected') + // } + // }); + }); }); }); diff --git a/tests-e2e/cypress/services/sdc-collection-api-service.ts b/tests-e2e/cypress/services/sdc-collection-api-service.ts index adb325a00..c589a6ad6 100644 --- a/tests-e2e/cypress/services/sdc-collection-api-service.ts +++ b/tests-e2e/cypress/services/sdc-collection-api-service.ts @@ -127,7 +127,8 @@ export class SdcCollectionApiService { ] } - } else if (schoolCollection.seedData === 'stepThreeSeedData') { + } + else if (schoolCollection.seedData === 'stepThreeSeedData') { sdcSchoolCollectionPayload = { "createUser": "EDXAT", "updateUser": null, @@ -270,7 +271,205 @@ export class SdcCollectionApiService { }, ] } - + } + else if (schoolCollection.seedData === 'careerProgramsSeedData') { + sdcSchoolCollectionPayload = { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "sdcSchoolCollectionID": null, + "collectionID": newCollection.collectionID, + "schoolID": schoolCollection?.school.schoolId, + "districtID": schoolCollection?.school.districtId, + "uploadDate": "20230822", + "uploadFileName": "EDX-AT-FILE.std", + "sdcSchoolCollectionStatusCode": "LOADED", + "collectionTypeCode": "SEPTEMBER", + "collectionOpenDate": curDate, + "collectionCloseDate": curCloseDate, + "students": [ + { + "createUser": "EDXAT", + "localID": "12345", + "studentPen": "101932770", + "legalFirstName": "LEGALFIRST", + "legalMiddleNames": null, + "legalLastName": "LEGALLAST", + "usualFirstName": "USUALFIRST", + "usualMiddleNames": "USUALMIDDLE", + "usualLastName": "USUALLAST", + "dob": "20050630", + "gender": "M", + "specialEducationCategoryCode": null, + "schoolFundingCode": "20", + "nativeAncestryInd": "N", + "homeLanguageSpokenCode": "943", + "otherCourses": "0", + "supportBlocks": null, + "enrolledGradeCode": "09", + "careerProgramCode": null, + "numberOfCourses": "0700", + "bandCode": "0684", + "enrolledProgramCodes": "08", + "sdcSchoolCollectionStudentStatusCode": "LOADED", + "isAdult": "false", + "isSchoolAged": "true", + "fte": 1, + "postalCode": "V8R2Y9", + "fteZeroReasonCode": null, + "frenchProgramNonEligReasonCode": null, + "ellNonEligReasonCode": "NTENRELL", + "indigenousSupportProgramNonEligReasonCode": "NTENRINDIG", + "careerProgramNonEligReasonCode": "NTENRCAREE", + "specialEducationNonEligReasonCode": "NOSPECIAL", + "isGraduated": "false", + "assignedStudentId": null, + "assignedPen": null, + "sdcSchoolCollectionStudentValidationIssues": [], + "sdcSchoolCollectionStudentEnrolledPrograms": [ + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "08" + }, + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "08" + } + ] + }, + { + "createUser": "EDXAT", + "localID": "12345", + "studentPen": "102866365", + "legalFirstName": "LEGALFIRST", + "legalMiddleNames": null, + "legalLastName": "LEGALLAST", + "usualFirstName": "USUALFIRST", + "usualMiddleNames": "USUALMIDDLE", + "usualLastName": "USUALLAST", + "dob": "20070702", + "gender": "F", + "specialEducationCategoryCode": null, + "schoolFundingCode": "20", + "nativeAncestryInd": "N", + "homeLanguageSpokenCode": "943", + "otherCourses": "0", + "supportBlocks": null, + "enrolledGradeCode": "11", + "careerProgramCode": null, + "numberOfCourses": "0700", + "bandCode": "0684", + "postalCode": "V8R2Y9", + "enrolledProgramCodes": "43", + "sdcSchoolCollectionStudentStatusCode": "LOADED", + "isAdult": "false", + "isSchoolAged": "true", + "fte": 0.875, + "fteZeroReasonCode": null, + "frenchProgramNonEligReasonCode": null, + "ellNonEligReasonCode": "NTENRELL", + "indigenousSupportProgramNonEligReasonCode": "NTENRINDIG", + "careerProgramNonEligReasonCode": "NTENRCAREE", + "specialEducationNonEligReasonCode": "NOSPECIAL", + "isGraduated": "false", + "assignedStudentId": null, + "assignedPen": null, + "sdcSchoolCollectionStudentValidationIssues": [], + "sdcSchoolCollectionStudentEnrolledPrograms": [ + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "43" + }, + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "43" + } + ] + }, + { + "createUser": "EDXAT", + "localID": "12345", + "studentPen": "102866365", + "legalFirstName": "LEGALFIRST", + "legalMiddleNames": null, + "legalLastName": "LEGALLAST", + "usualFirstName": "USUALFIRST", + "usualMiddleNames": "USUALMIDDLE", + "usualLastName": "USUALLAST", + "dob": "20070702", + "gender": "F", + "specialEducationCategoryCode": null, + "schoolFundingCode": "20", + "nativeAncestryInd": "N", + "homeLanguageSpokenCode": "943", + "otherCourses": "0", + "supportBlocks": null, + "enrolledGradeCode": "09", + "careerProgramCode": null, + "numberOfCourses": "0700", + "bandCode": "0684", + "postalCode": "V8R2Y9", + "enrolledProgramCodes": "1141", + "sdcSchoolCollectionStudentStatusCode": "LOADED", + "isAdult": "false", + "isSchoolAged": "true", + "fte": 0.875, + "fteZeroReasonCode": null, + "frenchProgramNonEligReasonCode": null, + "ellNonEligReasonCode": "NTENRELL", + "indigenousSupportProgramNonEligReasonCode": "NTENRINDIG", + "careerProgramNonEligReasonCode": "NTENRCAREE", + "specialEducationNonEligReasonCode": "NOSPECIAL", + "isGraduated": "false", + "assignedStudentId": null, + "assignedPen": null, + "sdcSchoolCollectionStudentValidationIssues": [], + "sdcSchoolCollectionStudentEnrolledPrograms": [ + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "11" + }, + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "11" + }, + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "41" + }, + { + "createUser": "EDXAT", + "updateUser": null, + "createDate": null, + "updateDate": null, + "enrolledProgramCode": "41" + } + ] + } + ] + } } } else { From a4f48799de2198bd484346aa92407c914708a488 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Tue, 29 Aug 2023 09:10:49 -0700 Subject: [PATCH 2/4] removed unwanted set up code --- tests-e2e/cypress.config.ts | 3 +- .../services/sdc-collection-api-service.ts | 42 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/tests-e2e/cypress.config.ts b/tests-e2e/cypress.config.ts index a977e4774..2528343b6 100644 --- a/tests-e2e/cypress.config.ts +++ b/tests-e2e/cypress.config.ts @@ -47,8 +47,7 @@ export default defineConfig({ viewportWidth: 1920, defaultCommandTimeout: 5000, e2e: { - // baseUrl: 'https://dev.educationdataexchange.gov.bc.ca', - baseUrl: 'http://localhost:8081', + baseUrl: 'https://dev.educationdataexchange.gov.bc.ca', setupNodeEvents(on, config) { on('task', { 'dataLoad': async (options: InstituteOptions) => { diff --git a/tests-e2e/cypress/services/sdc-collection-api-service.ts b/tests-e2e/cypress/services/sdc-collection-api-service.ts index c589a6ad6..263bea375 100644 --- a/tests-e2e/cypress/services/sdc-collection-api-service.ts +++ b/tests-e2e/cypress/services/sdc-collection-api-service.ts @@ -246,20 +246,6 @@ export class SdcCollectionApiService { "updateDate": null, "enrolledProgramCode": "40" }, - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "40" - }, - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "08" - }, { "createUser": "EDXAT", "updateUser": null, @@ -328,13 +314,6 @@ export class SdcCollectionApiService { "assignedPen": null, "sdcSchoolCollectionStudentValidationIssues": [], "sdcSchoolCollectionStudentEnrolledPrograms": [ - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "08" - }, { "createUser": "EDXAT", "updateUser": null, @@ -383,13 +362,6 @@ export class SdcCollectionApiService { "assignedPen": null, "sdcSchoolCollectionStudentValidationIssues": [], "sdcSchoolCollectionStudentEnrolledPrograms": [ - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "43" - }, { "createUser": "EDXAT", "updateUser": null, @@ -445,20 +417,6 @@ export class SdcCollectionApiService { "updateDate": null, "enrolledProgramCode": "11" }, - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "11" - }, - { - "createUser": "EDXAT", - "updateUser": null, - "createDate": null, - "updateDate": null, - "enrolledProgramCode": "41" - }, { "createUser": "EDXAT", "updateUser": null, From e7d8d6b2e8c2793699f789499ce9247ed5a4e0d3 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Tue, 29 Aug 2023 14:39:18 -0700 Subject: [PATCH 3/4] EDX-1252 & 1253 --- .../sdcSchoolCollectionStepThree.cy.ts | 40 ++++++++++++------- .../services/sdc-collection-api-service.ts | 6 +-- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts index 7cbd58afa..2d764ae63 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts @@ -18,15 +18,12 @@ describe('SDC School Collection View', () => { 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(); }); @@ -36,8 +33,6 @@ describe('SDC School Collection View', () => { 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(3); @@ -49,25 +44,40 @@ describe('SDC School Collection View', () => { }); }); - it.only('verifies career programs for reported students', () => { + + it('verifies french programs 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(); + cy.get(selectors.studentLevelData.nextButton).click(); + cy.get('button[value="French Programs"]').click(); + cy.get('.td-data').each(cell => { + const cellText = cell.text() + if (cellText === '08-CORE FRENCH' || cellText === '11-EARLY FRENCH IM') { + cy.log('Correct french enrolled program value expected') + } + }); - // Step three of collection - edit/verify data + }); + + it('verifies career programs 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(); cy.get(selectors.studentLevelData.nextButton).click(); - // cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(3); cy.get('button[value="Career Programs"]').click(); + cy.get('.td-data').each(cell => { + const cellText = cell.text() + cy.log(cellText) + if (cellText === '41-CO-OPXA-BUSINESS & APPLIED BUSINESS' || cellText === '43-CAREER TECHNICAXH-TRADES & TECHNOLOGY') { + cy.log('Correct career enrolled program value expected') + } + }); + - // cy.get('.td-data').each(cell => { - // const cellText = cell.text() - // cy.log(cellText) - // if (cellText === '1' || cellText === '0.875') { - // cy.log('Correct fte value expected') - // } - // }); }); }); }); diff --git a/tests-e2e/cypress/services/sdc-collection-api-service.ts b/tests-e2e/cypress/services/sdc-collection-api-service.ts index 263bea375..04025f8d7 100644 --- a/tests-e2e/cypress/services/sdc-collection-api-service.ts +++ b/tests-e2e/cypress/services/sdc-collection-api-service.ts @@ -342,11 +342,11 @@ export class SdcCollectionApiService { "otherCourses": "0", "supportBlocks": null, "enrolledGradeCode": "11", - "careerProgramCode": null, "numberOfCourses": "0700", "bandCode": "0684", "postalCode": "V8R2Y9", "enrolledProgramCodes": "43", + "careerProgramCode": "XH", "sdcSchoolCollectionStudentStatusCode": "LOADED", "isAdult": "false", "isSchoolAged": "true", @@ -374,7 +374,7 @@ export class SdcCollectionApiService { { "createUser": "EDXAT", "localID": "12345", - "studentPen": "102866365", + "studentPen": "103169744", "legalFirstName": "LEGALFIRST", "legalMiddleNames": null, "legalLastName": "LEGALLAST", @@ -390,7 +390,7 @@ export class SdcCollectionApiService { "otherCourses": "0", "supportBlocks": null, "enrolledGradeCode": "09", - "careerProgramCode": null, + "careerProgramCode": "XA", "numberOfCourses": "0700", "bandCode": "0684", "postalCode": "V8R2Y9", From 81add28a3b8dd1a45100360706eb8ac935f27fd0 Mon Sep 17 00:00:00 2001 From: ANSINGH Date: Tue, 29 Aug 2023 14:42:19 -0700 Subject: [PATCH 4/4] code clean --- .../e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts index 2d764ae63..11902aa80 100644 --- a/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionStepThree.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', () => {