From 4692773724574106333c8a49122cfe68cf21482c Mon Sep 17 00:00:00 2001 From: Steliyan Dinkov Date: Mon, 25 Nov 2024 17:16:17 +0100 Subject: [PATCH 1/4] update course sync test for substitute teachers --- .../course/createEditStopSyncedCourse.feature | 325 +++++++++--------- cypress/support/pages/course/pageCourses.js | 6 + .../createEditDeleteSyncedCourseSteps.spec.js | 5 + 3 files changed, 174 insertions(+), 162 deletions(-) diff --git a/cypress/e2e/course/createEditStopSyncedCourse.feature b/cypress/e2e/course/createEditStopSyncedCourse.feature index b745061d..09664c7f 100644 --- a/cypress/e2e/course/createEditStopSyncedCourse.feature +++ b/cypress/e2e/course/createEditStopSyncedCourse.feature @@ -1,171 +1,172 @@ @unstable_test Feature: Teacher can create, update and stop a synchronized course - Scenario Outline: Fail to create a synchronized course with a group that doesn't have a teacher - Given I am logged in as a '' at '' - When I go to courses overview - When I click on FAB to add or import courses - Then I see the button to create a new synced course - When I click on the button to create a new synced course - Then I see title of the modal to select a synced group - Then I see information text of the modal to select a synced group - Then I see the group selection of the modal to select a synced group - When I select group '' in the group selection - Then I see the group '' is selected - Then I see the warning text of the modal to select a synced group - Then I see continue button of the modal to select a synced group is disabled - When I click cancel button on the modal to select a synced group - Examples: - | user | namespace | group_title | - | admin1_nbc | nbc | Cypress-Test-Group-Course-Sync-Without-Teacher | + Scenario Outline: Fail to create a synchronized course with a group that doesn't have a teacher + Given I am logged in as a '' at '' + When I go to courses overview + When I click on FAB to add or import courses + Then I see the button to create a new synced course + When I click on the button to create a new synced course + Then I see title of the modal to select a synced group + Then I see information text of the modal to select a synced group + Then I see the group selection of the modal to select a synced group + When I select group '' in the group selection + Then I see the group '' is selected + Then I see the warning text of the modal to select a synced group + Then I see continue button of the modal to select a synced group is disabled + When I click cancel button on the modal to select a synced group + Examples: + | user | namespace | group_title | + | admin1_nbc | nbc | Cypress-Test-Group-Course-Sync-Without-Teacher | - Scenario Outline: Create a synchronized course - Given I am logged in as a '' at '' - When I go to courses overview - When I click on FAB to add or import courses - Then I see the button to create a new synced course - When I click on the button to create a new synced course - Then I see title of the modal to select a synced group - Then I see information text of the modal to select a synced group - Then I see the group selection of the modal to select a synced group - When I select group '' in the group selection - Then I see the group '' is selected - When I click continue button on the modal to select a synced group - Then I see the course title form contains '' - Then I see the teacher '' is selected - Then I see the start date picker has '' selected - Then I see the end date picker has '' selected - Then I see the teacher selection box is disabled - Then I see the substitute teacher selection box is disabled - Then I see the date pickers to start and end the course are disabled - When I click on button Next Steps after entering the course detail in section one - Then I see section two area on the course create page - When I click on button Next Steps after selecting course participant details - Then I see the section three area as the finish page - Then I see the button to create another course is not visible - When I click on button To Course Overview on the finish page - Then I see the course '' on the course overview page - When I click on administration in menu - When I go to new class administration page - Then I see the new class administration page - Then I see the group '' is synced with course '' - Examples: - | user | namespace | group_title | teacher_name | student_name | start_date | end_date | - | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync | Karl Herzog | Herbert Kraft | 01.08.2024 | 31.07.2025 | - | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync2 | Karl Herzog | Herbert Kraft | 01.08.2024 | 31.07.2025 | - | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Herbert Kraft | 01.08.2024 | 31.07.2025 | - | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Herbert Kraft | 01.08.2024 | 31.07.2025 | + Scenario Outline: Create a synchronized course + Given I am logged in as a '' at '' + When I go to courses overview + When I click on FAB to add or import courses + Then I see the button to create a new synced course + When I click on the button to create a new synced course + Then I see title of the modal to select a synced group + Then I see information text of the modal to select a synced group + Then I see the group selection of the modal to select a synced group + When I select group '' in the group selection + Then I see the group '' is selected + When I click continue button on the modal to select a synced group + Then I see the course title form contains '' + Then I see the teacher '' is selected + Then I see the substitute teacher '' is selected + Then I see the start date picker has '' selected + Then I see the end date picker has '' selected + Then I see the teacher selection box is disabled + Then I see the substitute teacher selection box is disabled + Then I see the date pickers to start and end the course are disabled + When I click on button Next Steps after entering the course detail in section one + Then I see section two area on the course create page + When I click on button Next Steps after selecting course participant details + Then I see the section three area as the finish page + Then I see the button to create another course is not visible + When I click on button To Course Overview on the finish page + Then I see the course '' on the course overview page + When I click on administration in menu + When I go to new class administration page + Then I see the new class administration page + Then I see the group '' is synced with course '' + Examples: + | user | namespace | group_title | teacher_name | substitute_teacher_name | student_name | start_date | end_date | + | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | + | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync2 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | + | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | + | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | - Scenario Outline: Synchronize course with group - # create course - Given I am logged in as a '' at '' - When I go to courses overview - When I click on FAB to create a new course depending on sub menu - Then I see section one area on the course create page - When I enter the course title '' - When I select course colour as red - Then I see teacher '' is selected by default - Then I see substitute teacher selection box - Then I see date pickers to start and end the course as per school year - Then I see button to create a course time table container - When I click on button Next Steps after entering the course detail in section one - Then I see section two area on the course create page - When I click on button Next Steps after selecting course participant details - Then I see the section three area as the finish page - When I click on button To Course Overview on the finish page - Then I see the course '' on the course overview page - #synchronize course - When I go to course '' - When I click on the three dot menu button next to the course title - Then I see the start synchronization button - When I click the start synchronization button - Then I see title of the modal to select a synced group - Then I see information text of the modal to select a synced group - Then I see the group selection of the modal to select a synced group - When I select group '' in the group selection - Then I see the group '' is selected - When I click continue button on the modal to select a synced group - Then I see the title of the modal for synchronization confirmation - Then I see a warning about the consequences of synchronization - Then I see information text of the modal asking for confirmation of synchronization - When I click the confirm button on the synchronization confirmation modal - Then I see the synced chip next to the title on the course page - Examples: - | user | namespace | course_title | group_title | teacher_name | student_name | - | teacher1_nbc | nbc | Cypress-Test-Existing-Course | Cypress-Test-Group | Karl Herzog | Herbert Kraft | + Scenario Outline: Synchronize course with group + # create course + Given I am logged in as a '' at '' + When I go to courses overview + When I click on FAB to create a new course depending on sub menu + Then I see section one area on the course create page + When I enter the course title '' + When I select course colour as red + Then I see teacher '' is selected by default + Then I see substitute teacher selection box + Then I see date pickers to start and end the course as per school year + Then I see button to create a course time table container + When I click on button Next Steps after entering the course detail in section one + Then I see section two area on the course create page + When I click on button Next Steps after selecting course participant details + Then I see the section three area as the finish page + When I click on button To Course Overview on the finish page + Then I see the course '' on the course overview page + #synchronize course + When I go to course '' + When I click on the three dot menu button next to the course title + Then I see the start synchronization button + When I click the start synchronization button + Then I see title of the modal to select a synced group + Then I see information text of the modal to select a synced group + Then I see the group selection of the modal to select a synced group + When I select group '' in the group selection + Then I see the group '' is selected + When I click continue button on the modal to select a synced group + Then I see the title of the modal for synchronization confirmation + Then I see a warning about the consequences of synchronization + Then I see information text of the modal asking for confirmation of synchronization + When I click the confirm button on the synchronization confirmation modal + Then I see the synced chip next to the title on the course page + Examples: + | user | namespace | course_title | group_title | teacher_name | substitute_teacher_name | student_name | + | teacher1_nbc | nbc | Cypress-Test-Existing-Course | Cypress-Test-Group | Karl Herzog | Lara Hande | Herbert Kraft | - Scenario Outline: Edit a synchronized course - When I go to courses overview - When I go to course '' - Then I see the synced chip next to the title on the course page - When I open page Edit course - Then I see page Edit course - Then I see the course title form contains '' - When I edit the title of the course to '' - Then I see the course title form contains '' - Then I see the teacher '' is selected - Then I see the start date picker has '' selected - Then I see the end date picker has '' selected - Then I see the teacher selection box is disabled - Then I see the substitute teacher selection box is disabled - Then I see the student selection box is disabled - Then I see the class selection box is disabled - Then I see the date pickers to start and end the course are disabled - When I click on button Save changes in page Edit course - Then I see the course '' on the course overview page - Then I do not see the course '' on the course overview page - Examples: - | course_title | course_title_new | teacher_name | student_name | start_date | end_date | - | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Kraft, Herbert | 01.08.2024 | 31.07.2025 | + Scenario Outline: Edit a synchronized course + When I go to courses overview + When I go to course '' + Then I see the synced chip next to the title on the course page + When I open page Edit course + Then I see page Edit course + Then I see the course title form contains '' + When I edit the title of the course to '' + Then I see the course title form contains '' + Then I see the teacher '' is selected + Then I see the start date picker has '' selected + Then I see the end date picker has '' selected + Then I see the teacher selection box is disabled + Then I see the substitute teacher selection box is disabled + Then I see the student selection box is disabled + Then I see the class selection box is disabled + Then I see the date pickers to start and end the course are disabled + When I click on button Save changes in page Edit course + Then I see the course '' on the course overview page + Then I do not see the course '' on the course overview page + Examples: + | course_title | course_title_new | teacher_name | student_name | start_date | end_date | + | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Kraft, Herbert | 01.08.2024 | 31.07.2025 | - Scenario Outline: Stop a course synchronization in a course - When I go to courses overview - When I go to course '' - When I click on the three dot menu button next to the course title - Then I see the end synchronization button - When I click the end synchronization button - Then I see the title of the modal to end the sync - Then I see the information text of the modal to end the sync - When I click the confirmation button of the modal to end the sync - When I go to courses overview - When I go to course '' - Then I see the course '' is unsynchronized - When I click on administration in menu - When I go to new class administration page - Then I see the new class administration page - Then I see the group '' has no synced course - Examples: - | course_title | group_title | - | Cypress-Test-Course-Sync | Cypress-Test-Group-Course-Sync | - | Cypress-Test-Existing-Course | Cypress-Test-Group | + Scenario Outline: Stop a course synchronization in a course + When I go to courses overview + When I go to course '' + When I click on the three dot menu button next to the course title + Then I see the end synchronization button + When I click the end synchronization button + Then I see the title of the modal to end the sync + Then I see the information text of the modal to end the sync + When I click the confirmation button of the modal to end the sync + When I go to courses overview + When I go to course '' + Then I see the course '' is unsynchronized + When I click on administration in menu + When I go to new class administration page + Then I see the new class administration page + Then I see the group '' has no synced course + Examples: + | course_title | group_title | + | Cypress-Test-Course-Sync | Cypress-Test-Group-Course-Sync | + | Cypress-Test-Existing-Course | Cypress-Test-Group | - Scenario Outline: Stop a course synchronization in the class overview - Given I see the new class administration page - Then I see the group '' is synced with course '' - When I click the end sync button of group '' - Then I see the title of the modal to end the sync - Then I see the information text of the modal to end the sync - When I click the confirmation button of the modal to end the sync - Then I see the group '' has no synced course - When I go to courses overview - When I go to course '' - Then I see the course '' is unsynchronized - Examples: - | group_title | - | Cypress-Test-Group-Course-Sync2 | + Scenario Outline: Stop a course synchronization in the class overview + Given I see the new class administration page + Then I see the group '' is synced with course '' + When I click the end sync button of group '' + Then I see the title of the modal to end the sync + Then I see the information text of the modal to end the sync + When I click the confirmation button of the modal to end the sync + Then I see the group '' has no synced course + When I go to courses overview + When I go to course '' + Then I see the course '' is unsynchronized + Examples: + | group_title | + | Cypress-Test-Group-Course-Sync2 | - Scenario Outline: Delete the course as a post condition - When I go to courses overview - When I go to course '' - When I open page Edit course - When I click on the button delete course - Then I see the modal to confirm the deletion - When I click on the button delete on the modal to confirm the course deletion - Then I do not see the course '' on the course overview page - Examples: - | course_title | - | Cypress-Test-Course-Sync | - | Cypress-Test-Group-Course-Sync2 | - | Cypress-Test-Existing-Course | - | Cypress-Test-Group1 | - | Cypress-Test-Group1 | + Scenario Outline: Delete the course as a post condition + When I go to courses overview + When I go to course '' + When I open page Edit course + When I click on the button delete course + Then I see the modal to confirm the deletion + When I click on the button delete on the modal to confirm the course deletion + Then I do not see the course '' on the course overview page + Examples: + | course_title | + | Cypress-Test-Course-Sync | + | Cypress-Test-Group-Course-Sync2 | + | Cypress-Test-Existing-Course | + | Cypress-Test-Group1 | + | Cypress-Test-Group1 | diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 3175e109..7888e73f 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -1066,6 +1066,12 @@ class Courses { .should("be.selected"); } + seeSelectedSubstituteTeacher(teacherName) { + cy.get(Courses.#selectSubstituteTeacher) + .contains("option", teacherName) + .should("be.selected"); + } + seeSelectedStudent(studentName) { cy.get(Courses.#selectStudent) .contains("option", studentName) diff --git a/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js b/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js index 1d865f44..bb4e1a9f 100644 --- a/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js +++ b/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js @@ -55,6 +55,11 @@ Then("I see the teacher {string} is selected", (teacherName) => { courses.seeSelectedTeacher(teacherName); }); +Then("I see the substitute teacher {string} is selected", (teacherName) => { + courses.seeSelectedSubstituteTeacher(teacherName); +}); + + Then("I see the student {string} is selected", (studentName) => { courses.seeSelectedStudent(studentName); }); From 0c8516332a73c964ff1a1fa5e567835b15cce619 Mon Sep 17 00:00:00 2001 From: Steliyan Dinkov Date: Tue, 26 Nov 2024 15:29:00 +0100 Subject: [PATCH 2/4] update var names --- cypress/support/pages/course/pageCourses.js | 4 ++-- .../course/createEditDeleteSyncedCourseSteps.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 7888e73f..c6f8eaae 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -1066,9 +1066,9 @@ class Courses { .should("be.selected"); } - seeSelectedSubstituteTeacher(teacherName) { + seeSelectedSubstituteTeacher(substituteTeacher) { cy.get(Courses.#selectSubstituteTeacher) - .contains("option", teacherName) + .contains("option", substituteTeacher) .should("be.selected"); } diff --git a/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js b/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js index bb4e1a9f..a207e91a 100644 --- a/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js +++ b/cypress/support/step_definition/course/createEditDeleteSyncedCourseSteps.spec.js @@ -55,8 +55,8 @@ Then("I see the teacher {string} is selected", (teacherName) => { courses.seeSelectedTeacher(teacherName); }); -Then("I see the substitute teacher {string} is selected", (teacherName) => { - courses.seeSelectedSubstituteTeacher(teacherName); +Then("I see the substitute teacher {string} is selected", (substituteTeacher) => { + courses.seeSelectedSubstituteTeacher(substituteTeacher); }); From 74dc2108d6a56192e010dde851e10e576a77f7be Mon Sep 17 00:00:00 2001 From: Steliyan Dinkov Date: Wed, 27 Nov 2024 15:16:38 +0100 Subject: [PATCH 3/4] update review changes --- .../e2e/course/createEditStopSyncedCourse.feature | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/course/createEditStopSyncedCourse.feature b/cypress/e2e/course/createEditStopSyncedCourse.feature index 09664c7f..c8cba6a8 100644 --- a/cypress/e2e/course/createEditStopSyncedCourse.feature +++ b/cypress/e2e/course/createEditStopSyncedCourse.feature @@ -54,8 +54,6 @@ Feature: Teacher can create, update and stop a synchronized course | user | namespace | group_title | teacher_name | substitute_teacher_name | student_name | start_date | end_date | | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | | teacher1_nbc | nbc | Cypress-Test-Group-Course-Sync2 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | - | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | - | teacher1_nbc | nbc | Cypress-Test-Group1 | Karl Herzog | Lara Hande | Herbert Kraft | 01.08.2024 | 31.07.2025 | Scenario Outline: Synchronize course with group # create course @@ -66,6 +64,7 @@ Feature: Teacher can create, update and stop a synchronized course When I enter the course title '' When I select course colour as red Then I see teacher '' is selected by default + Then I see the substitute teacher '' is selected Then I see substitute teacher selection box Then I see date pickers to start and end the course as per school year Then I see button to create a course time table container @@ -92,8 +91,8 @@ Feature: Teacher can create, update and stop a synchronized course When I click the confirm button on the synchronization confirmation modal Then I see the synced chip next to the title on the course page Examples: - | user | namespace | course_title | group_title | teacher_name | substitute_teacher_name | student_name | - | teacher1_nbc | nbc | Cypress-Test-Existing-Course | Cypress-Test-Group | Karl Herzog | Lara Hande | Herbert Kraft | + | user | namespace | course_title | group_title | teacher_name | student_name | + | teacher1_nbc | nbc | Cypress-Test-Existing-Course | Cypress-Test-Group | Karl Herzog | Herbert Kraft | Scenario Outline: Edit a synchronized course When I go to courses overview @@ -105,6 +104,7 @@ Feature: Teacher can create, update and stop a synchronized course When I edit the title of the course to '' Then I see the course title form contains '' Then I see the teacher '' is selected + Then I see the substitute teacher '' is selected Then I see the start date picker has '' selected Then I see the end date picker has '' selected Then I see the teacher selection box is disabled @@ -116,8 +116,8 @@ Feature: Teacher can create, update and stop a synchronized course Then I see the course '' on the course overview page Then I do not see the course '' on the course overview page Examples: - | course_title | course_title_new | teacher_name | student_name | start_date | end_date | - | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Kraft, Herbert | 01.08.2024 | 31.07.2025 | + | course_title | course_title_new | teacher_name | substitute_teacher_name | student_name | start_date | end_date | + | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Lara Hande | Kraft, Herbert | 01.08.2024 | 31.07.2025 | Scenario Outline: Stop a course synchronization in a course When I go to courses overview @@ -168,5 +168,3 @@ Feature: Teacher can create, update and stop a synchronized course | Cypress-Test-Course-Sync | | Cypress-Test-Group-Course-Sync2 | | Cypress-Test-Existing-Course | - | Cypress-Test-Group1 | - | Cypress-Test-Group1 | From c9530ec381a4e4bab7576ba458fdefc4afd574f3 Mon Sep 17 00:00:00 2001 From: MBergCap Date: Wed, 27 Nov 2024 16:05:01 +0100 Subject: [PATCH 4/4] adjust test --- cypress/e2e/course/createEditStopSyncedCourse.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/e2e/course/createEditStopSyncedCourse.feature b/cypress/e2e/course/createEditStopSyncedCourse.feature index c8cba6a8..7b6d2a2d 100644 --- a/cypress/e2e/course/createEditStopSyncedCourse.feature +++ b/cypress/e2e/course/createEditStopSyncedCourse.feature @@ -64,7 +64,6 @@ Feature: Teacher can create, update and stop a synchronized course When I enter the course title '' When I select course colour as red Then I see teacher '' is selected by default - Then I see the substitute teacher '' is selected Then I see substitute teacher selection box Then I see date pickers to start and end the course as per school year Then I see button to create a course time table container @@ -117,7 +116,7 @@ Feature: Teacher can create, update and stop a synchronized course Then I do not see the course '' on the course overview page Examples: | course_title | course_title_new | teacher_name | substitute_teacher_name | student_name | start_date | end_date | - | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Lara Hande | Kraft, Herbert | 01.08.2024 | 31.07.2025 | + | Cypress-Test-Group-Course-Sync | Cypress-Test-Course-Sync | Herzog, Karl | Hande, Lara | Kraft, Herbert | 01.08.2024 | 31.07.2025 | Scenario Outline: Stop a course synchronization in a course When I go to courses overview