MDL-49412 core_completion: Fix behat failures
authorSimey Lameze <simey@moodle.com>
Thu, 2 Apr 2015 09:13:38 +0000 (17:13 +0800)
committerAdrian Greeve <adrian@moodle.com>
Fri, 10 Apr 2015 09:18:24 +0000 (17:18 +0800)
Part of MDL-45774

completion/tests/behat/enable_manual_complete_mark.feature
completion/tests/behat/restrict_activity_by_date.feature
completion/tests/behat/restrict_activity_by_grade.feature
completion/tests/behat/restrict_section_availability.feature
completion/tests/behat/teacher_manual_completion.feature

index bcd93e6..e587a2c 100644 (file)
@@ -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"
index db9a37a..8362672 100644 (file)
@@ -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"
index 5607307..edd2143 100644 (file)
@@ -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"
index 41f2bf7..24dc3d7 100644 (file)
@@ -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"
index 6df1130..d8a5090 100644 (file)
@@ -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"