From 39030d8de31a8a3e47dae145d583e4007b587297 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 2 Apr 2015 17:13:38 +0800 Subject: [PATCH] MDL-49412 core_completion: Fix behat failures Part of MDL-45774 --- .../tests/behat/enable_manual_complete_mark.feature | 3 +++ completion/tests/behat/restrict_activity_by_date.feature | 3 +++ .../tests/behat/restrict_activity_by_grade.feature | 4 ++++ .../tests/behat/restrict_section_availability.feature | 6 ++++++ completion/tests/behat/teacher_manual_completion.feature | 9 +++++++-- 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index bcd93e69d3596..e587a2cafa98e 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -21,6 +21,7 @@ Feature: Allow students to manually mark an activity as complete | enablecompletion | 1 | | enableavailability | 1 | And I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I turn editing mode on And I click on "Edit settings" "link" in the "Administration" "block" @@ -33,10 +34,12 @@ Feature: Allow students to manually mark an activity as complete Then "Student First" user has not completed "Test forum name" activity And I log out And I log in as "student1" + And I am on site homepage And I follow "Course 1" And I press "Mark as complete: Test forum name" And I log out And I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I expand "Reports" node And I follow "Activity completion" diff --git a/completion/tests/behat/restrict_activity_by_date.feature b/completion/tests/behat/restrict_activity_by_date.feature index db9a37a73246f..83626729f8196 100644 --- a/completion/tests/behat/restrict_activity_by_date.feature +++ b/completion/tests/behat/restrict_activity_by_date.feature @@ -19,6 +19,7 @@ Feature: Restrict activity availability through date conditions And the following config values are set as admin: | enableavailability | 1 | And I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I turn editing mode on # Adding the page like this because id_available*_enabled needs to be clicked to trigger the action. @@ -40,6 +41,7 @@ Feature: Restrict activity availability through date conditions And I press "Save and return to course" And I log out When I log in as "student1" + And I am on site homepage And I follow "Course 1" Then I should see "Available from 31 December 2037" And "Test assignment 1" activity should be hidden @@ -63,5 +65,6 @@ Feature: Restrict activity availability through date conditions And I press "Save and return to course" And I log out When I log in as "student1" + And I am on site homepage And I follow "Course 1" Then I should not see "Test assignment 2" diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature index 5607307ccd1cf..edd2143f8615e 100644 --- a/completion/tests/behat/restrict_activity_by_grade.feature +++ b/completion/tests/behat/restrict_activity_by_grade.feature @@ -20,6 +20,7 @@ Feature: Restrict activity availability through grade conditions And the following config values are set as admin: | enableavailability | 1 | And I log in as "teacher1" + #And I am on site homepage And I follow "Course 1" And I turn editing mode on And I add a "Assignment" to section "1" and I fill the form with: @@ -42,6 +43,7 @@ Feature: Restrict activity availability through grade conditions And I press "Save and return to course" And I log out When I log in as "student1" + And I am on site homepage And I follow "Course 1" Then I should see "Not available unless: You achieve a required score in Grade assignment" And "Test page name" activity should be hidden @@ -53,6 +55,7 @@ Feature: Restrict activity availability through grade conditions And I should see "Submitted for grading" And I log out And I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I follow "Grade assignment" And I follow "View/grade all submissions" @@ -62,6 +65,7 @@ Feature: Restrict activity availability through grade conditions And I press "Save changes" And I log out And I log in as "student1" + And I am on site homepage And I follow "Course 1" And "Test page name" activity should be visible And I should not see "Not available unless: You achieve a required score in Grade assignment" diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index 41f2bf734c52a..24dc3d79a809d 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -23,6 +23,7 @@ Feature: Restrict sections availability through completion or grade conditions @javascript Scenario: Show section greyed-out to student when completion condition is not satisfied Given I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I turn editing mode on And I click on "Edit settings" "link" in the "Administration" "block" @@ -46,6 +47,7 @@ Feature: Restrict sections availability through completion or grade conditions And I press "Save changes" And I log out And I log in as "student1" + And I am on site homepage And I follow "Course 1" Then I should see "Not available unless: The activity Test label is marked complete" And I should not see "Test page name" @@ -56,6 +58,7 @@ Feature: Restrict sections availability through completion or grade conditions @javascript Scenario: Show section greyed-out to student when grade condition is not satisfied Given I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I turn editing mode on And I add a "Assignment" to section "1" and I fill the form with: @@ -78,6 +81,7 @@ Feature: Restrict sections availability through completion or grade conditions And I press "Save changes" And I log out When I log in as "student1" + And I am on site homepage And I follow "Course 1" Then I should see "Not available unless: You achieve a required score in Grade assignment" And "Test page name" activity should be hidden @@ -89,6 +93,7 @@ Feature: Restrict sections availability through completion or grade conditions And I should see "Submitted for grading" And I log out And I log in as "teacher1" + And I am on site homepage And I follow "Course 1" And I follow "Grade assignment" And I follow "View/grade all submissions" @@ -98,6 +103,7 @@ Feature: Restrict sections availability through completion or grade conditions And I press "Save changes" And I log out And I log in as "student1" + And I am on site homepage And I follow "Course 1" And "Test page name" activity should be visible And I should not see "Not available unless: You achieve a required score in Grade assignment" diff --git a/completion/tests/behat/teacher_manual_completion.feature b/completion/tests/behat/teacher_manual_completion.feature index 6df1130c7a6a9..d8a50907f7149 100644 --- a/completion/tests/behat/teacher_manual_completion.feature +++ b/completion/tests/behat/teacher_manual_completion.feature @@ -19,7 +19,9 @@ Feature: Allow teachers to manually mark users as complete when configured And the following config values are set as admin: | enablecompletion | 1 | And I log in as "admin" - And I am on homepage + And I set the following administration settings values: + | Enable completion tracking | 1 | + And I am on site homepage And I follow "Completion course" And completion tracking is "Enabled" in current course And I follow "Course completion" @@ -29,17 +31,20 @@ Feature: Allow teachers to manually mark users as complete when configured And I add the "Course completion status" block And I log out And I log in as "student1" + And I am on site homepage And I follow "Completion course" And I should see "Status: Not yet started" And I log out When I log in as "teacher1" + And I am on site homepage And I follow "Completion course" And I follow "View course report" And I should see "Student First" And I follow "Click to mark user complete" And I trigger cron - And I am on homepage + And I am on site homepage And I log out Then I log in as "student1" + And I am on site homepage And I follow "Completion course" And I should see "Status: Complete"