diff --git a/availability/condition/completion/tests/behat/availability_completion.feature b/availability/condition/completion/tests/behat/availability_completion.feature index a57094fb26a..0f4c121d968 100644 --- a/availability/condition/completion/tests/behat/availability_completion.feature +++ b/availability/condition/completion/tests/behat/availability_completion.feature @@ -52,5 +52,5 @@ Feature: availability_completion Then I should not see "Page 2" in the "region-main" "region" # Mark page 1 complete - When I click on ".togglecompletion .icon" "css_element" + When I toggle the manual completion state of "Page 1" Then I should see "Page 2" in the "region-main" "region" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 313a9a55da4..7324e75c31f 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -242,7 +242,7 @@ Feature: Award badges And I click on "Course 1" "link" in the "region-main" "region" Then I should not see "badges" And I am on "Course 1" course homepage - And I click on "Not completed: Test assignment name" "icon" + And I toggle the manual completion state of "Test assignment name" And I follow "Profile" in the user menu And I click on "Course 1" "link" in the "region-main" "region" Then I should see "Course Badge" @@ -296,7 +296,7 @@ Feature: Award badges And I click on "Course 1" "link" in the "region-main" "region" Then I should not see "badges" And I am on "Course 1" course homepage - And I click on "Not completed: Test assignment name" "icon" + And I toggle the manual completion state of "Test assignment name" And I log out # Completion cron won't mark the whole course completed unless the # individual criteria was marked completed more than a second ago. So diff --git a/badges/tests/behat/criteria_activity.feature b/badges/tests/behat/criteria_activity.feature index 55f92548f46..96bb361fec0 100644 --- a/badges/tests/behat/criteria_activity.feature +++ b/badges/tests/behat/criteria_activity.feature @@ -53,7 +53,8 @@ Feature: Award badges based on activity completion Scenario: Student earns a badge using activity completion, but does not get passing grade When I log in as "student1" And I am on "Course 1" course homepage - And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete + And the "Receive a grade" completion condition of "Test quiz name" is displayed as "failed" + And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo" And I follow "Test quiz name" And I press "Re-attempt quiz" And I set the field "False" to "1" diff --git a/completion/tests/behat/completion_course_page_checkboxes.feature b/completion/tests/behat/completion_course_page_display.feature similarity index 67% rename from completion/tests/behat/completion_course_page_checkboxes.feature rename to completion/tests/behat/completion_course_page_display.feature index 48005eee0c6..cd2bc387ad2 100644 --- a/completion/tests/behat/completion_course_page_checkboxes.feature +++ b/completion/tests/behat/completion_course_page_display.feature @@ -2,7 +2,7 @@ Feature: Show activity completion status or activity completion configuration on the course page In order to understand the configuration or status of an activity's completion As a user - I want to see an appropriate checkbox icon besides the activity + I need to see the appropriate completion information for each activity in the course homepage Background: Given the following "courses" exist: @@ -39,27 +39,27 @@ Feature: Show activity completion status or activity completion configuration on Given I log in as "student1" And I am on "Course 1" course homepage Then I should see "Your progress" - And the "Test forum name" "Forum" activity with "manual" completion shows a status completion checkbox - And the "Test assignment name" "Assign" activity with "auto" completion shows a status completion checkbox - And the "Test quiz name" "Quiz" activity does not show any completion checkbox + And the manual completion button of "Test forum name" is displayed as "Mark as done" + And the "View" completion condition of "Test assignment name" is displayed as "todo" + And there should be no completion information shown for "Test quiz name" Scenario: Show completion configuration to editing teachers Given I log in as "teacher1" And I am on "Course 1" course homepage Then I should not see "Your progress" - And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox - And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox - And the "Test quiz name" "Quiz" activity does not show any completion checkbox + And the manual completion button for "Test forum name" should be disabled + And "Test assignment name" should have the "View" completion condition + And there should be no completion information shown for "Test quiz name" And I am on "Course 1" course homepage with editing mode on And I should not see "Your progress" - And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox - And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox - And the "Test quiz name" "Quiz" activity does not show any completion checkbox + And the manual completion button for "Test forum name" should be disabled + And "Test assignment name" should have the "View" completion condition + And there should be no completion information shown for "Test quiz name" Scenario: Show completion configuration to non-editing teachers Given I log in as "teacher2" And I am on "Course 1" course homepage Then I should not see "Your progress" - And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox - And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox - And the "Test quiz name" "Quiz" activity does not show any completion checkbox + And the manual completion button for "Test forum name" should be disabled + And "Test assignment name" should have the "View" completion condition + And there should be no completion information shown for "Test quiz name" diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index f6b08268298..83f8df5d71e 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -31,8 +31,8 @@ Feature: Allow students to manually mark an activity as complete And I log out And I log in as "student1" And I am on "Course 1" course homepage - When I click on "Not completed: Test forum name. Select to mark as complete." "icon" - Then the "Test forum name" "forum" activity with "manual" completion should be marked as complete + When I toggle the manual completion state of "Test forum name" + Then the manual completion button of "Test forum name" is displayed as "Done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index f65c9fa29e4..f1550de3a1f 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -45,7 +45,7 @@ Feature: Restrict sections availability through completion or grade conditions And I am on "Course 1" course homepage Then I should see "Not available unless: The activity Test label is marked complete" And I should not see "Test page name" - And I click on "Not completed: Test label. Select to mark as complete." "icon" + And I toggle the manual completion state of "Test label" And I should see "Test page name" And I should not see "Not available unless: The activity Test label is marked complete" diff --git a/mod/forum/tests/behat/completion_condition_number_discussions.feature b/mod/forum/tests/behat/completion_condition_number_discussions.feature index 9218d171afe..94c84f17f0d 100644 --- a/mod/forum/tests/behat/completion_condition_number_discussions.feature +++ b/mod/forum/tests/behat/completion_condition_number_discussions.feature @@ -33,7 +33,7 @@ Feature: Set a certain number of discussions as a completion condition for a for And I log out And I log in as "student1" And I am on "Course 1" course homepage - Then the "Test forum name" "forum" activity with "auto" completion should be marked as not complete + And the "Start discussions: 2" completion condition of "Test forum name" is displayed as "todo" And I add a new discussion to "Test forum name" forum with: | Subject | Post 1 subject | | Message | Body 1 content | @@ -41,7 +41,7 @@ Feature: Set a certain number of discussions as a completion condition for a for | Subject | Post 2 subject | | Message | Body 2 content | And I am on "Course 1" course homepage - Then the "Test forum name" "forum" activity with "auto" completion should be marked as complete + Then the "Start discussions: 2" completion condition of "Test forum name" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/lesson/tests/behat/completion_condition_end_reached.feature b/mod/lesson/tests/behat/completion_condition_end_reached.feature index ad540acd734..0510e57b3ff 100644 --- a/mod/lesson/tests/behat/completion_condition_end_reached.feature +++ b/mod/lesson/tests/behat/completion_condition_end_reached.feature @@ -48,11 +48,11 @@ Feature: Set end of lesson reached as a completion condition for a lesson And I log out When I log in as "student1" And I am on "Course 1" course homepage - Then the "Test lesson" "lesson" activity with "auto" completion should be marked as not complete + Then the "Go through the activity to the end" completion condition of "Test lesson" is displayed as "todo" And I follow "Test lesson" And I press "Next page" And I am on "Course 1" course homepage - Then the "Test lesson" "lesson" activity with "auto" completion should be marked as not complete + And the "Go through the activity to the end" completion condition of "Test lesson" is displayed as "todo" And I am on "Course 1" course homepage And I follow "Test lesson" And I should see "You have seen more than one page of this lesson already." @@ -61,7 +61,7 @@ Feature: Set end of lesson reached as a completion condition for a lesson And I press "Next page" And I press "Next page" And I am on "Course 1" course homepage - Then the "Test lesson" "lesson" activity with "auto" completion should be marked as complete + And the "Go through the activity to the end" completion condition of "Test lesson" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/lesson/tests/behat/completion_condition_time_spent.feature b/mod/lesson/tests/behat/completion_condition_time_spent.feature index f2df0c0a5e0..af392fff799 100644 --- a/mod/lesson/tests/behat/completion_condition_time_spent.feature +++ b/mod/lesson/tests/behat/completion_condition_time_spent.feature @@ -50,7 +50,7 @@ Feature: Set time spent as a completion condition for a lesson And I log out When I log in as "student1" And I am on "Course 1" course homepage - Then the "Test lesson" "lesson" activity with "auto" completion should be marked as not complete + Then the "Spend at least 10 secs on this activity" completion condition of "Test lesson" is displayed as "todo" And I follow "Test lesson" And I press "Next page" # Add 1 sec delay so lesson knows a valid attempt has been made in past. @@ -59,7 +59,7 @@ Feature: Set time spent as a completion condition for a lesson And I should see "You completed this lesson in" And I should see ", which is less than the required time of 10 secs. You might need to attempt the lesson again." And I am on "Course 1" course homepage - And the "Test lesson" "lesson" activity with "auto" completion should be marked as not complete + And the "Spend at least 10 secs on this activity" completion condition of "Test lesson" is displayed as "todo" And I am on "Course 1" course homepage And I follow "Test lesson" And I press "Next page" @@ -67,7 +67,7 @@ Feature: Set time spent as a completion condition for a lesson And I press "Next page" And I should not see "You might need to attempt the lesson again." And I am on "Course 1" course homepage - And the "Test lesson" "lesson" activity with "auto" completion should be marked as complete + And the "Spend at least 10 secs on this activity" completion condition of "Test lesson" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/quiz/tests/behat/completion_condition_attempts_used.feature b/mod/quiz/tests/behat/completion_condition_attempts_used.feature index 370c9638276..49d6e257454 100644 --- a/mod/quiz/tests/behat/completion_condition_attempts_used.feature +++ b/mod/quiz/tests/behat/completion_condition_attempts_used.feature @@ -37,14 +37,16 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all Scenario: student1 uses up both attempts without passing When I log in as "student1" And I am on "Course 1" course homepage - And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete + And the "Receive a grade" completion condition of "Test quiz name" is displayed as "failed" + And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo" And I follow "Test quiz name" And I press "Re-attempt quiz" And I set the field "False" to "1" And I press "Finish attempt ..." And I press "Submit all and finish" And I am on "Course 1" course homepage - Then "Completed: Test quiz name" "icon" should exist in the "li.modtype_quiz" "css_element" + Then the "Receive a grade" completion condition of "Test quiz name" is displayed as "failed" + And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature b/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature index 3559a195438..a066a36ac8e 100644 --- a/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature +++ b/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature @@ -41,14 +41,14 @@ Feature: Set a quiz to be marked complete when the student completes a minimum a And I log out And I log in as "student1" And I am on "Course 1" course homepage - And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete + And the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "todo" And I follow "Test quiz name" And I press "Re-attempt quiz" And I set the field "False" to "1" And I press "Finish attempt ..." And I press "Submit all and finish" And I am on "Course 1" course homepage - Then "Completed: Test quiz name" "icon" should exist in the "Test quiz name" "list_item" + Then the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/quiz/tests/behat/completion_condition_passing_grade.feature b/mod/quiz/tests/behat/completion_condition_passing_grade.feature index d5ec91bcf99..2684ffa1d4b 100644 --- a/mod/quiz/tests/behat/completion_condition_passing_grade.feature +++ b/mod/quiz/tests/behat/completion_condition_passing_grade.feature @@ -34,12 +34,14 @@ Feature: Set a quiz to be marked complete when the student passes Scenario: student1 passes on the first try When I log in as "student1" And I am on "Course 1" course homepage - And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete + And the "Receive a grade" completion condition of "Test quiz name" is displayed as "todo" + And the "Receive a pass grade" completion condition of "Test quiz name" is displayed as "todo" And user "student1" has attempted "Test quiz name" with responses: | slot | response | | 1 | True | And I am on "Course 1" course homepage - Then "Completed: Test quiz name" "icon" should exist in the "li.modtype_quiz" "css_element" + Then the "Receive a grade" completion condition of "Test quiz name" is displayed as "done" + And the "Receive a pass grade" completion condition of "Test quiz name" is displayed as "done" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage diff --git a/mod/survey/tests/behat/survey_completion.feature b/mod/survey/tests/behat/survey_completion.feature index 0186b1f484c..c7d2cd3b4c8 100644 --- a/mod/survey/tests/behat/survey_completion.feature +++ b/mod/survey/tests/behat/survey_completion.feature @@ -30,10 +30,10 @@ Feature: A teacher can use activity completion to track a student progress And I log out When I log in as "student1" And I am on "Course 1" course homepage - And the "Test survey name" "survey" activity with "auto" completion should be marked as not complete + And the "View" completion condition of "Test survey name" is displayed as "todo" And I follow "Test survey name" And I am on "Course 1" course homepage - Then the "Test survey name" "survey" activity with "auto" completion should be marked as complete + Then the "View" completion condition of "Test survey name" is displayed as "done" Scenario: Require survey submission Given I add a "Survey" to section "1" and I fill the form with: @@ -45,8 +45,8 @@ Feature: A teacher can use activity completion to track a student progress And I log out When I log in as "student1" And I am on "Course 1" course homepage - And the "Test survey name" "survey" activity with "auto" completion should be marked as not complete + And the "View" completion condition of "Test survey name" is displayed as "todo" And I follow "Test survey name" And I press "Click here to continue" And I am on "Course 1" course homepage - Then the "Test survey name" "survey" activity with "auto" completion should be marked as complete + And the "View" completion condition of "Test survey name" is displayed as "done" diff --git a/report/progress/tests/behat/activity_completion_report.feature b/report/progress/tests/behat/activity_completion_report.feature index 4885029a17a..ae83fbbbf0b 100644 --- a/report/progress/tests/behat/activity_completion_report.feature +++ b/report/progress/tests/behat/activity_completion_report.feature @@ -30,13 +30,12 @@ Feature: Teacher can view and override users' activity completion data via the p # Student completes the activities, manual and automatic completion. Given I log in as "student1" And I am on "Course 1" course homepage - And "Not completed: my assignment. Select to mark as complete." "icon" should exist in the "my assignment" "list_item" - And "Not completed: my assignment 2" "icon" should exist in the "my assignment 2" "list_item" - And I click on "Not completed: my assignment. Select to mark as complete." "icon" - And "Completed: my assignment. Select to mark as not complete." "icon" should exist in the "my assignment" "list_item" + And the manual completion button of "my assignment" is displayed as "Mark as done" + And I toggle the manual completion state of "my assignment" + And the manual completion button of "my assignment" is displayed as "Done" And I click on "my assignment 2" "link" And I am on "Course 1" course homepage - And "Completed: my assignment 2" "icon" should exist in the "my assignment 2" "list_item" + And the "View" completion condition of "my assignment 2" is displayed as "done" And I log out # Teacher overrides the activity completion statuses to incomplete. When I log in as "teacher1" @@ -54,13 +53,13 @@ Feature: Teacher can view and override users' activity completion data via the p # Student can now complete the activities again, via normal means. Then I log in as "student1" And I am on "Course 1" course homepage - And "Not completed: my assignment (set by Teacher One). Select to mark as complete." "icon" should exist in the "my assignment" "list_item" - And "Not completed: my assignment 2 (set by Teacher One)" "icon" should exist in the "my assignment 2" "list_item" - And I click on "Not completed: my assignment (set by Teacher One). Select to mark as complete." "icon" - And "Completed: my assignment. Select to mark as not complete." "icon" should exist in the "my assignment" "list_item" + And the manual completion button of "my assignment" overridden by "Teacher One" is displayed as "Mark as done" + And the "View" completion condition of "my assignment 2" overridden by "Teacher One" is displayed as "todo" + And I toggle the manual completion state of "my assignment" + And the manual completion button of "my assignment" is displayed as "Done" And I click on "my assignment 2" "link" And I am on "Course 1" course homepage - And "Completed: my assignment 2" "icon" should exist in the "my assignment 2" "list_item" + And the "View" completion condition of "my assignment 2" is displayed as "done" And I log out # And the activity completion report should show the same. When I log in as "teacher1" @@ -90,7 +89,7 @@ Feature: Teacher can view and override users' activity completion data via the p # Then as a student, confirm that automatic completion checks are no longer triggered (such as after an assign submission). Then I log in as "student1" And I am on "Course 1" course homepage - And "Completed: my assignment 3 (set by Teacher One)" "icon" should exist in the "my assignment 3" "list_item" + And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher One" is displayed as "done" And I click on "my assignment 3" "link" And I press "Add submission" And I set the following fields to these values: @@ -98,10 +97,9 @@ Feature: Teacher can view and override users' activity completion data via the p And I press "Save changes" And I should see "Submitted for grading" And I am on "Course 1" course homepage - And "Completed: my assignment 3 (set by Teacher One)" "icon" should exist in the "my assignment 3" "list_item" + And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher One" is displayed as "done" # And Confirm that manual completion changes are still allowed. And I am on "Course 1" course homepage - And "Completed: my assignment (set by Teacher One). Select to mark as not complete." "icon" should exist in the "my assignment" "list_item" - And I click on "Completed: my assignment (set by Teacher One). Select to mark as not complete." "icon" - And "Not completed: my assignment. Select to mark as complete." "icon" should exist in the "my assignment" "list_item" - And I log out + And the manual completion button of "my assignment" overridden by "Teacher One" is displayed as "Done" + And I toggle the manual completion state of "my assignment" + And the manual completion button of "my assignment" is displayed as "Mark as done"