Skip to content

Commit

Permalink
refactored school imprvoment plan to add change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FahadDarw committed Jul 2, 2024
1 parent ceaee40 commit 4721dc4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ describe('School Improvement Plan Tests', () => {
schoolImprovementPage.verifyImprovementDetails("Local Authority", "Fahad-Cypress Test", "12 December 2023", "12 November 2024", "High", "This is a test comment");
Logger.log("Verify the submitted interim school improvement plan details are saved correctly");
schoolImprovementPage.verifyTheFinalImprovementDetails("Local Authority", "Fahad-Cypress Test", "12 December 2023", "12 November 2024", "High", "This is a test comment");
Logger.log("change the details");
schoolImprovementPage.changeImprovementDetails("Cypress Test Interim schoool plan","Test comment");
Logger.log("Verify the changed interim school improvement plan details are saved correctly");
schoolImprovementPage.verifyChangedImprovementDetails("Regional Director, Local Authority", "Cypress Test Interim schoool plan", "12 December 2023", "Unknown", "Medium", "Test comment");

Logger.log("Delete the project and verify that it was deleted successfully - Project ID: " + projectId);
schoolImprovementPage.deleteProject(projectId);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,23 @@ export class SchoolImprovementPage {
}

enterImprovementEndDate(day, month, year) {
cy.get('#plan-start-date-day').clear();
cy.get('#plan-start-date-day').type(day);
cy.get('#plan-start-date-month').clear();
cy.get('#plan-start-date-month').type(month);
cy.get('#plan-start-date-year').clear();
cy.get('#plan-start-date-year').type(year);
cy.get('#submit-btn').click();
return this;
}

enterExpectedEndDate(day, month, year) {
cy.get('#Other-radio').click();
cy.get('#plan-end-date-other-day').clear;
cy.get('#plan-end-date-other-day').type(day);
cy.get('#plan-end-date-other-month').clear();
cy.get('#plan-end-date-other-month').type(month);
cy.get('#plan-end-date-other-year').clear()
cy.get('#plan-end-date-other-year').type(year);
cy.get('#submit-btn').click();
return this;
Expand All @@ -80,6 +86,7 @@ export class SchoolImprovementPage {
return this;
}
enterComments(comments) {
cy.get('#PlanComments').clear();
cy.get('#PlanComments').type(comments);
cy.get('#submit-btn').click();
return this;
Expand All @@ -105,6 +112,34 @@ export class SchoolImprovementPage {
cy.get('[data-cy="comments"]').should('contain', comments);
return this;
}
changeImprovementDetails(providedBy,comments) {
cy.get('#change-arranger-btn').click();
cy.get('#regionaldirector-checkbox').click();
cy.get('#submit-btn').click();
cy.get('#PlanProvider').clear();
cy.get('#PlanProvider').type(providedBy);
cy.get('#submit-btn').click();
cy.get('#submit-btn').click();
cy.get('#Unknown-radio').click();
cy.get('#submit-btn').click();
cy.get('#Medium-radio').click();
cy.get('#submit-btn').click();
cy.get('#PlanComments').clear();
cy.get('#PlanComments').type(comments);
cy.get('#submit-btn').click();
return this;
}

verifyChangedImprovementDetails(arrangedBy, providedBy, startDate, endDate, confidenceLevel, comments) {
cy.get('#arranged-by').should('contain', arrangedBy);
cy.get('#provided-by').eq(0).should('contain', providedBy);
cy.get('#start-date').should('contain', startDate);
cy.get('#end-date').should('contain', endDate);
cy.get('#confidence-level').should('contain', confidenceLevel);
cy.get('#comments').should('contain', comments);
cy.get('#submit-btn').click();
return this;
}
deleteProject(projectId) {
cy.callAcademisationApi("DELETE", `/conversion-project/${projectId}/Delete`).then((response) => {
expect(response.status).to.eq(200);
Expand Down

0 comments on commit 4721dc4

Please sign in to comment.