MDL-49412 core_completion: Fix behat failures

Part of MDL-45774
This commit is contained in:
Simey Lameze
2015-04-10 17:18:24 +08:00
committed by Adrian Greeve
parent a1e9151a1a
commit 39030d8de3
5 changed files with 23 additions and 2 deletions
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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"