From 22899031e187c2870bf622fbefad8b37e63fa503 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 29 Aug 2024 15:40:20 +0200 Subject: [PATCH] MOBILE-4616 behat: Adapt tests for MDL-82195 --- .../tests/behat/marking_workflow-404.feature | 124 ++++++++++++++++++ .../tests/behat/marking_workflow.feature | 6 +- 2 files changed, 127 insertions(+), 3 deletions(-) create mode 100755 src/addons/mod/assign/tests/behat/marking_workflow-404.feature diff --git a/src/addons/mod/assign/tests/behat/marking_workflow-404.feature b/src/addons/mod/assign/tests/behat/marking_workflow-404.feature new file mode 100755 index 000000000..90209ea78 --- /dev/null +++ b/src/addons/mod/assign/tests/behat/marking_workflow-404.feature @@ -0,0 +1,124 @@ +@addon_mod_assign @app @javascript @lms_upto4.4 +Feature: Test marking workflow in assignment activity in app + + Background: + Given the Moodle site is compatible with this feature + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student1 | student1 | student1@example.com | + | student2 | Student2 | student2 | student2@example.com | + | student3 | Student3 | student3 | student3@example.com | + | student4 | Student4 | student4 | student4@example.com | + | student5 | Student5 | student5 | student5@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | + | student3 | C1 | student | + | student4 | C1 | student | + | student5 | C1 | student | + And the following "groups" exist: + | name | course | idnumber | + | Group 1 | C1 | G1 | + | Group 2 | C1 | G2 | + | Group 3 | C1 | G3 | + And the following "group members" exist: + | user | group | + | student1 | G1 | + | student2 | G1 | + | student3 | G2 | + | student4 | G3 | + And the following "activities" exist: + | activity | course | idnumber | name | assignsubmission_onlinetext_enabled | assignfeedback_comments_enabled | markingworkflow | teamsubmission | groupmode | submissiondrafts | + | assign | C1 | assign1 | Group Assign | 1 | 1 | 1 | 1 | 1 | 0 | + And the following "mod_assign > submissions" exist: + | assign | user | onlinetext | + | assign1 | student1 | Lorem | + | assign1 | student3 | Ipsum | + | assign1 | student4 | Dolor | + # Mark submissions. + And I am on the "Group Assign" "assign activity" page logged in as teacher1 + And I follow "View all submissions" + And I change window size to "large" + And I click on "Grade" "link" in the "Student1" "table_row" + And I set the field "Grade out of 100" to "50" + And I set the field "Marking workflow state" to "In review" + And I set the field "Feedback comments" to "Great job! Lol, not really." + And I set the field "Notify student" to "0" + And I press "Save changes" + And I am on the "Group Assign" "assign activity" page + And I follow "View all submissions" + And I click on "Grade" "link" in the "Student3" "table_row" + And I set the field "Grade out of 100" to "30" + And I set the field "Marking workflow state" to "Released" + And I set the field "Feedback comments" to "Needs to be improved." + And I set the field "Notify student" to "0" + And I press "Save changes" + And I log out + + Scenario: View submissions with marking workflow and using points as teacher + Given I entered the assign activity "Group Assign" on course "Course 1" as "teacher1" in the app + When I press "Groups" in the app + Then I should find "Submitted for grading" within "Student1" "ion-item" in the app + And I should find "In review" within "Student1" "ion-item" in the app + And I should find "Submitted for grading" within "Student2" "ion-item" in the app + And I should find "In review" within "Student2" "ion-item" in the app + And I should find "Submitted for grading" within "Student3" "ion-item" in the app + And I should find "Released" within "Student3" "ion-item" in the app + And I should find "Submitted for grading" within "Student4" "ion-item" in the app + And I should find "Not marked" within "Student4" "ion-item" in the app + And I should find "No submission" within "Student5" "ion-item" in the app + And I should not find "Not marked" within "Student5" "ion-item" in the app + + When I press "Student1" in the app + And I press "Grade" in the app + Then I should find "Submitted for grading" in the app + And I should find "50 / 100" within "Current grade in assignment" "ion-item" in the app + And I should find "-" within "Current grade in gradebook" "ion-item" in the app + And I should find "In review" within "Marking workflow state" "ion-item" in the app + And the field "Grade out of 100" matches value "50" in the app + And I should not find "Graded by" in the app + + When I press the back button in the app + And I press "Student3" in the app + And I press "Grade" in the app + Then I should find "Submitted for grading" in the app + And I should find "30" within "Current grade in gradebook" "ion-item" in the app + And I should find "Released" within "Marking workflow state" "ion-item" in the app + And I should find "Teacher teacher" within "Graded by" "ion-item" in the app + And the field "Grade out of 100" matches value "30" in the app + And I should not find "Current grade in assignment" in the app + + Scenario: Grade submissions with marking workflow and using points + Given I entered the assign activity "Group Assign" on course "Course 1" as "teacher1" in the app + And I press "Groups" in the app + And I press "Student1" in the app + And I press "Grade" in the app + When I set the field "Grade out of 100" to "60" in the app + And I press "Done" in the app + And I wait loading to finish in the app + And I press "Student1" in the app + And I press "Grade" in the app + Then I should find "60 / 100" within "Current grade in assignment" "ion-item" in the app + And I should find "-" within "Current grade in gradebook" "ion-item" in the app + And I should find "In review" within "Marking workflow state" "ion-item" in the app + And the field "Grade out of 100" matches value "60" in the app + + When I press the back button in the app + And I press "Student3" in the app + And I press "Grade" in the app + When I set the field "Grade out of 100" to "80" in the app + And I press "Done" in the app + And I wait loading to finish in the app + And I press "Student3" in the app + And I press "Grade" in the app + Then I should find "80" within "Current grade in gradebook" "ion-item" in the app + And I should find "Released" within "Marking workflow state" "ion-item" in the app + And I should find "Teacher teacher" within "Graded by" "ion-item" in the app + And the field "Grade out of 100" matches value "80" in the app + And I should not find "Current grade in assignment" in the app diff --git a/src/addons/mod/assign/tests/behat/marking_workflow.feature b/src/addons/mod/assign/tests/behat/marking_workflow.feature index 314468d2d..0ddc4c6cf 100755 --- a/src/addons/mod/assign/tests/behat/marking_workflow.feature +++ b/src/addons/mod/assign/tests/behat/marking_workflow.feature @@ -1,4 +1,4 @@ -@addon_mod_assign @app @javascript +@addon_mod_assign @app @javascript @lms_from4.5 Feature: Test marking workflow in assignment activity in app Background: @@ -43,7 +43,7 @@ Feature: Test marking workflow in assignment activity in app | assign1 | student4 | Dolor | # Mark submissions. And I am on the "Group Assign" "assign activity" page logged in as teacher1 - And I follow "View all submissions" + And I navigate to "Submissions" in current page administration And I change window size to "large" And I click on "Grade" "link" in the "Student1" "table_row" And I set the field "Grade out of 100" to "50" @@ -52,7 +52,7 @@ Feature: Test marking workflow in assignment activity in app And I set the field "Notify student" to "0" And I press "Save changes" And I am on the "Group Assign" "assign activity" page - And I follow "View all submissions" + And I navigate to "Submissions" in current page administration And I click on "Grade" "link" in the "Student3" "table_row" And I set the field "Grade out of 100" to "30" And I set the field "Marking workflow state" to "Released"