Skip to content

Commit

Permalink
MDL-49412 core_completion: Fix behat failures
Browse files Browse the repository at this point in the history
Part of MDL-45774
  • Loading branch information
lameze authored and abgreeve committed Apr 10, 2015
1 parent a1e9151 commit 39030d8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions completion/tests/behat/enable_manual_complete_mark.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions completion/tests/behat/restrict_activity_by_date.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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"
4 changes: 4 additions & 0 deletions completion/tests/behat/restrict_activity_by_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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"
6 changes: 6 additions & 0 deletions completion/tests/behat/restrict_section_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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"
9 changes: 7 additions & 2 deletions completion/tests/behat/teacher_manual_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

0 comments on commit 39030d8

Please sign in to comment.