Commit 776f4bd8 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

MDL-72179 behat: Make use of page resolvers

parent f14dbe00
...@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker" And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker" And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one" And I am on the "Test this one" "wiki activity" page
And I press "Create page" And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values". # Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values: When I set the following fields to these values:
...@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked. # Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1" And I set the field "Force format" to "1"
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test this one" "wiki activity" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration And I navigate to "Edit settings" in current page administration
And I expand all fieldsets And I expand all fieldsets
And the field "Force format" matches value "1" And the field "Force format" matches value "1"
...@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" unticked. # Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to "" And I set the field "Force format" to ""
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test this one" "wiki activity" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration And I navigate to "Edit settings" in current page administration
And I expand all fieldsets And I expand all fieldsets
And the field "Force format" matches value "" And the field "Force format" matches value ""
...@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values: And I set the following fields to these values:
| Force format | 1 | | Force format | 1 |
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test this one" "wiki activity" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration And I navigate to "Edit settings" in current page administration
And I expand all fieldsets And I expand all fieldsets
And the following fields match these values: And the following fields match these values:
...@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values: And I set the following fields to these values:
| Force format | | | Force format | |
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test this one" "wiki activity" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration And I navigate to "Edit settings" in current page administration
And I expand all fieldsets And I expand all fieldsets
And the following fields match these values: And the following fields match these values:
...@@ -126,14 +122,13 @@ Feature: Verify that all form fields values can be get and set ...@@ -126,14 +122,13 @@ Feature: Verify that all form fields values can be get and set
| section | 1 | | section | 1 |
| allowupdate | 1 | | allowupdate | 1 |
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Test choice name" And I am on the "Test choice name" "choice activity editing" page
And I navigate to "Edit settings" in current page administration
And I set the field "Option 1" to "one" And I set the field "Option 1" to "one"
And I set the field "Option 2" to "two" And I set the field "Option 2" to "two"
And I set the field "Option 3" to "three" And I set the field "Option 3" to "three"
And I press "Save and return to course" And I press "Save and return to course"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Test choice name" And I am on the "Test choice name" "choice activity" page
And I set the field "one" to "1" And I set the field "one" to "1"
And I press "Save my choice" And I press "Save my choice"
And the field "one" matches value "1" And the field "one" matches value "1"
...@@ -183,31 +178,23 @@ Feature: Verify that all form fields values can be get and set ...@@ -183,31 +178,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel" And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386. # Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked. # Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage And I am on the "Test choice name" "choice activity editing" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I set the field "Display description on course page" to "1" And I set the field "Display description on course page" to "1"
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test choice name" "choice activity editing" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And the field "Display description on course page" matches value "1" And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value "" And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked. # Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to "" And I set the field "Display description on course page" to ""
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test choice name" "choice activity editing" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And the field "Display description on course page" matches value "" And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1" And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked. # Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values: And I set the following fields to these values:
| Display description on course page | 1 | | Display description on course page | 1 |
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test choice name" "choice activity editing" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And the following fields match these values: And the following fields match these values:
| Display description on course page | 1 | | Display description on course page | 1 |
And the following fields do not match these values: And the following fields do not match these values:
...@@ -216,9 +203,7 @@ Feature: Verify that all form fields values can be get and set ...@@ -216,9 +203,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values: And I set the following fields to these values:
| Display description on course page | | | Display description on course page | |
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Test this one" And I am on the "Test choice name" "choice activity editing" page
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And the following fields match these values: And the following fields match these values:
| Display description on course page | | | Display description on course page | |
And the following fields do not match these values: And the following fields do not match these values:
......
...@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page. ...@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page.
| activity | name | intro | course | idnumber | completion | completionview | | activity | name | intro | course | idnumber | completion | completionview |
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 | | page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 | | page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I log in as "admin" And I am on the "Course 1" course page logged in as admin
And I am on site homepage
And I follow "Course 1"
And I follow "Competencies" And I follow "Competencies"
And I press "Add competencies to course" And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible And "Competency picker" "dialogue" should be visible
...@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page. ...@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page.
And "Competency picker" "dialogue" should be visible And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue" And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on "Course 1" course homepage And I am on the PageName1 "page activity editing" page
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I follow "Expand all" And I follow "Expand all"
And I set the field "Course competencies" to "Test-Comp1" And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course" And I press "Save and return to course"
...@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page. ...@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript @javascript
Scenario: Go to the competency course competencies page. Scenario: Go to the competency course competencies page.
When I log in as "student1" Given I am on the "Course 1" course page logged in as student1
And I am on site homepage When I follow "Competencies"
And I follow "Course 1"
And I follow "Competencies"
Then I should see "Test-Comp1" Then I should see "Test-Comp1"
And I should see "Test-Comp2" And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1" And I set the field "Filter competencies by resource or activity" to "PageName1"
...@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page. ...@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript @javascript
Scenario: None course competencies page. Scenario: None course competencies page.
When I log in as "student1" When I am on the PageName1 "page activity" page logged in as student1
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content" Then I should see "Test page content"
...@@ -42,9 +42,7 @@ Feature: Backup user data ...@@ -42,9 +42,7 @@ Feature: Backup user data
| Feedback for the response 'True'. | So you think it is true | | Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false | | Feedback for the response 'False'. | So you think it is false |
And I log out And I log out
And I log in as "student1" When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I am on "Course 1" course homepage
And I follow "Quiz 1"
And I press "Attempt quiz now" And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question" And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question" And I click on "False" "radio" in the "Second question" "question"
......
...@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug ...@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue" And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2" And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
And I press "Save and return to course" And I press "Save and return to course"
And I should see "Not available unless:" in the ".activity.glossary" "css_element" Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element" And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element" And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
And I follow "TestGlossary"
# Behat will automatically check there is no error on this page. # Behat will automatically check there is no error on this page.
Then I should see "TestGlossary" And I am on the TestGlossary "glossary activity" page
And I should see "TestGlossary"
...@@ -86,13 +86,12 @@ Feature: availability_grade ...@@ -86,13 +86,12 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10" And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course" And I press "Save and return to course"
And I log out
# Log in as student without a grade yet. # Log in as student without a grade yet.
When I log out When I am on the "A1" "assign activity" page logged in as student1
And I log in as "student1"
And I am on "Course 1" course homepage
# Do the assignment. # Do the assignment.
And I follow "A1"
And I click on "Add submission" "button" And I click on "Add submission" "button"
And I set the field "Online text" to "Q" And I set the field "Online text" to "Q"
And I click on "Save changes" "button" And I click on "Save changes" "button"
...@@ -103,25 +102,22 @@ Feature: availability_grade ...@@ -103,25 +102,22 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region" And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region" And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region" And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher. # Log back in as teacher.
When I log out When I am on the "A1" "assign activity" page logged in as teacher1
And I log in as "teacher1"
And I am on "Course 1" course homepage
# Give the assignment 40%. # Give the assignment 40%.
And I follow "A1"
And I navigate to "View all submissions" in current page administration And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has s@example.com in it. # Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row" And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40" And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button" And I click on "Save changes" "button"
And I click on "Edit settings" "link" And I click on "Edit settings" "link"
And I log out
# Log back in as student. # Log back in as student.
And I log out And I am on the "Course 1" course page logged in as student1
And I log in as "student1"
And I am on "Course 1" course homepage
# Check pages are visible. # Check pages are visible.
Then I should see "P2" in the "region-main" "region" Then I should see "P2" in the "region-main" "region"
......
...@@ -96,8 +96,7 @@ Feature: availability_profile ...@@ -96,8 +96,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button" And I click on "Save and return to course" "button"
# Edit it again and check the setting still works. # Edit it again and check the setting still works.
When I follow "P1" When I am on the P1 "page activity editing" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets And I expand all fieldsets
Then the field "User profile field" matches value "Super field" Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman" And the field "Value to compare against" matches value "Bananaman"
......
...@@ -51,19 +51,19 @@ Feature: Award badges based on activity completion ...@@ -51,19 +51,19 @@ Feature: Award badges based on activity completion
And I log out And I log out
Scenario: Student earns a badge using activity completion, but does not get passing grade Scenario: Student earns a badge using activity completion, but does not get passing grade
When I log in as "student1" Given I log in as "student1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And the "Receive a grade" completion condition of "Test quiz name" is displayed as "failed" 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 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" When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz" And I press "Re-attempt quiz"
And I set the field "False" to "1" And I set the field "False" to "1"
And I press "Finish attempt ..." And I press "Finish attempt ..."
And I press "Submit all and finish" And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue" And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
And I log out And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Badges > Manage badges" in current page administration And I navigate to "Badges > Manage badges" in current page administration
And I follow "Course Badge" And I follow "Course Badge"
And I should see "Recipients (1)" Then I should see "Recipients (1)"
...@@ -27,9 +27,7 @@ Feature: Course overview block show users their progress on courses ...@@ -27,9 +27,7 @@ Feature: Course overview block show users their progress on courses
Then I should not see "0%" in the "Course overview" "block" Then I should not see "0%" in the "Course overview" "block"
Scenario: User complete activity and verify his progress Scenario: User complete activity and verify his progress
Given I log in as "teacher1" Given I am on the "Test choice 1" "choice activity" page logged in as teacher1
And I am on "Course 1" course homepage with editing mode on
And I follow "Test choice 1"
And I navigate to "Edit settings" in current page administration And I navigate to "Edit settings" in current page administration
And I set the following fields to these values: And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met | | Completion tracking | Show activity as complete when conditions are met |
...@@ -40,8 +38,8 @@ Feature: Course overview block show users their progress on courses ...@@ -40,8 +38,8 @@ Feature: Course overview block show users their progress on courses
And I click on "All (except removed from view)" "button" in the "Course overview" "block" And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block" Then I should see "Course 1" in the "Course overview" "block"
And I should see "0%" in the "Course overview" "block" And I should see "0%" in the "Course overview" "block"
And I am on "Course 1" course homepage
And I follow "Test choice 1" And I am on the "Test choice 1" "choice activity" page
And I follow "Dashboard" in the user menu And I follow "Dashboard" in the user menu
And I click on "All (except removed from view)" "button" in the "Course overview" "block" And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I should see "100%" in the "Course overview" "block" And I should see "100%" in the "Course overview" "block"
...@@ -19,7 +19,7 @@ Feature: The private files block allows users to store files privately in moodle ...@@ -19,7 +19,7 @@ Feature: The private files block allows users to store files privately in moodle
| page | C1 | page1 | Test page name | Test page description | | page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1" And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name" And I am on the "Test page name" "page activity" page
And I add the "Private files" block And I add the "Private files" block
And I should see "No files available" in the "Private files" "block" And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..." When I follow "Manage private files..."
......
...@@ -16,24 +16,20 @@ Feature: The recently accessed items block allows users to easily access their m ...@@ -16,24 +16,20 @@ Feature: The recently accessed items block allows users to easily access their m
| user | course | role | | user | course | role |
| student1 | C1 | student | | student1 | C1 | student |
| student1 | C2 | student | | student1 | C2 | student |
And I log in as "admin" And the following "activity" exists:
And I am on "Course 1" course homepage | course | C1 |
And I turn editing mode on | activity | forum |
And I add a "Forum" to section "1" and I fill the form with: | idnumber | Test forum name |
| Forum name | Test forum name | | name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I log out
And I log in as "student1" And I log in as "student1"
When I press "Customise this page" And I press "Customise this page"
And I add the "Recently accessed items" block And I add the "Recently accessed items" block
Scenario: User has not accessed any item Scenario: User has not accessed any item
Then I should see "No recent items" in the "Recently accessed items" "block" Then I should see "No recent items" in the "Recently accessed items" "block"
Scenario: User has accessed some items Scenario: User has accessed some items
Given I am on "Course 1" course homepage Given I change window size to "large"
When I follow "Test forum name" When I am on the "Test forum name" "forum activity" page
And I follow "Dashboard" in the user menu And I follow "Dashboard" in the user menu
And I change window size to "large"
Then I should see "Test forum name" in the "Recently accessed items" "block" Then I should see "Test forum name" in the "Recently accessed items" "block"
...@@ -36,12 +36,10 @@ Feature: Restrict activity availability through date conditions ...@@ -36,12 +36,10 @@ Feature: Restrict activity availability through date conditions
| x[year] | 2037 | | x[year] | 2037 |
And I press "Save and return to course" And I press "Save and return to course"
And I log out And I log out
When I log in as "student1" When I am on the "Course 1" course page logged in as student1
And I am on "Course 1" course homepage
Then I should see "Available from 31 December 2037" Then I should see "Available from 31 December 2037"
And "Test assignment 1" "link" should not exist in the "page" "region"
And "Test assignment 1" activity should be dimmed And "Test assignment 1" activity should be dimmed
And "Test assignment 1" "link" should not exist
And I log out
@javascript @javascript
Scenario: Show activity hidden to students when available until date is in past Scenario: Show activity hidden to students when available until date is in past
...@@ -60,6 +58,5 @@ Feature: Restrict activity availability through date conditions ...@@ -60,6 +58,5 @@ Feature: Restrict activity availability through date conditions
And I click on ".availability-item .availability-eye img" "css_element" And I click on ".availability-item .availability-eye img" "css_element"
And I press "Save and return to course" And I press "Save and return to course"
And I log out And I log out
When I log in as "student1" When I am on the "Course 1" course page logged in as student1
And I am on "Course 1" course homepage Then I should not see "Test assignment 2" in the "page" "region"
Then I should not see "Test assignment 2"
...@@ -17,13 +17,16 @@ Feature: Restrict activity availability through grade conditions ...@@ -17,13 +17,16 @@ Feature: Restrict activity availability through grade conditions
| user | course | role | | user | course | role |
| teacher1 | C1 | editingteacher | | teacher1 | C1 | editingteacher |
| student1 | C1 | student | | student1 | C1 | student |
And I log in as "teacher1" And the following "activity" exists:
| course | C1 |
| activity | assign |
| idnumber | Grade assignment |
| name | Grade assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
And I am on the "Course 1" course page logged in as teacher1
And I am on "Course 1" course homepage with editing mode on And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Grade assignment |
| Description | Grade this assignment to revoke restriction on restricted assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
# Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action. # Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
And I add a "Page" to section "2" And I add a "Page" to section "2"
And I expand all fieldsets And I expand all fieldsets
...@@ -31,15 +34,15 @@ Feature: Restrict activity availability through grade conditions ...@@ -31,15 +34,15 @@ Feature: Restrict activity availability through grade conditions
And I click on "Grade" "button" in the "Add restriction..." "dialogue" And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I click on "min" "checkbox" And I click on "min" "checkbox"
And I set the following fields to these values: And I set the following fields to these values:
| Name | Test page name | | Name | Test page name |
| Description | Restricted page, till grades in Grade assignment is at least 20% | | Description | Restricted page, till grades in Grade assignment is at least 20% |
| Page content | Test page contents | | Page content | Test page contents |
| id | Grade assignment | | id | Grade assignment |
| minval | 20 | | minval | 20 |
And I press "Save and return to course" And I press "Save and return to course"
And I log out And I log out
When I log in as "student1"
And I am on "Course 1" course homepage When I am on the "Course 1" course page logged in as student1
Then I should see "Not available unless: You achieve a required score in Grade assignment" Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be dimmed And "Test page name" activity should be dimmed
And "Test page name" "link" should not exist And "Test page name" "link" should not exist
...@@ -50,9 +53,8 @@ Feature: Restrict activity availability through grade conditions ...@@ -50,9 +53,8 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes" And I press "Save changes"
And I should see "Submitted for grading" And I should see "Submitted for grading"
And I log out And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I follow "Grade assignment"
And I navigate to "View all submissions" in current page administration And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student First" "table_row" And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values: And I set the following fields to these values:
...@@ -60,7 +62,7 @@ Feature: Restrict activity availability through grade conditions ...@@ -60,7 +62,7 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes" And I press "Save changes"
And I follow "Edit settings" And I follow "Edit settings"
And I log out And I log out
And I log in as "student1"
And I am on "Course 1" course homepage And I am on the "Course 1" course page logged in as student1
And "Test page name" activity should be visible And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment" And I should not see "Not available unless: You achieve a required score in Grade assignment"