Skip to content

Commit

Permalink
MDL-58265 core_test: replace all uses of I follow course steps
Browse files Browse the repository at this point in the history
Part of MDL-55611 epic.
  • Loading branch information
lameze authored and Damyon Wiese committed Apr 3, 2017
1 parent 95f11fd commit c987d1b
Show file tree
Hide file tree
Showing 454 changed files with 1,691 additions and 1,696 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: Highlight non-inherited permissions

@javascript
Scenario: Override a permission
Given I follow "Course fullname"
Given I am on course page "Course fullname"
And I navigate to "Users > Permissions" in current page administration
And I select "Manager (0)" from the "roleid" singleselect
And I click on "Prohibit" "radio" in the "View added and updated modules in recent activity block" "table_row"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
And I expand all fieldsets
Expand Down
30 changes: 15 additions & 15 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Feature: Set up contextual data for tests
| Grouping 2 | C1 | GG2 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
And I should see "Group 2"
Expand Down Expand Up @@ -88,7 +88,7 @@ Feature: Set up contextual data for tests
| mod/forum:replynews | Prevent | editingteacher | Course | C1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Users > Permissions" in current page administration
And I set the field "Advanced role override" to "Student (1)"
Then "mod/forum:editanypost" capability has "Allow" permission
Expand All @@ -108,7 +108,7 @@ Feature: Set up contextual data for tests
| user | course | role |
| student1 | C1 | student |
When I log in as "student1"
And I follow "Course 1"
And I am on course page "Course 1"
Then I should see "Topic 1"

Scenario: Add role assigns
Expand Down Expand Up @@ -145,23 +145,23 @@ Feature: Set up contextual data for tests
And I log out
And I log in as "user2"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user3"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user4"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user5"
And I should see "You are logged in as"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I should see "You can not enrol yourself in this course."

Scenario: Add modules
Expand Down Expand Up @@ -200,7 +200,7 @@ Feature: Set up contextual data for tests
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
# And I should see "Test assignment22 name"
Expand Down Expand Up @@ -262,7 +262,7 @@ Feature: Set up contextual data for tests
| GG1 | G1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Users > Groups" in current page administration
Then the "groups" select box should contain "Group 1 (1)"
And the "groups" select box should contain "Group 2 (1)"
Expand Down Expand Up @@ -321,7 +321,7 @@ Feature: Set up contextual data for tests
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on course index
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "View > Grader report" in the course gradebook
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
Expand All @@ -345,7 +345,7 @@ Feature: Set up contextual data for tests
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
Expand Down Expand Up @@ -374,7 +374,7 @@ Feature: Set up contextual data for tests
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Scales" in the course gradebook
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
Expand All @@ -396,7 +396,7 @@ Feature: Set up contextual data for tests
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
Expand Down Expand Up @@ -425,7 +425,7 @@ Feature: Set up contextual data for tests
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
Expand All @@ -443,5 +443,5 @@ Feature: Set up contextual data for tests
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
Then I should see "Online users"
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/datetime_strings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: Transform date time string arguments
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I follow "Test assignment name"
And I should see "##yesterday##l, j F Y##"
And I log out
4 changes: 2 additions & 2 deletions admin/tool/behat/tests/behat/edit_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Edit capabilities

Scenario: Course capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Users > Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
Expand All @@ -45,7 +45,7 @@ Feature: Edit capabilities

Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | I'm the name |
Expand Down
12 changes: 6 additions & 6 deletions admin/tool/behat/tests/behat/get_and_set_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Feature: Verify that all form fields values can be get and set
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Reset" node in "Course administration"
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
Expand All @@ -49,7 +49,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 "President, Baker"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I follow "Test this one"
And I press "Create page"
Expand Down Expand Up @@ -100,7 +100,7 @@ Feature: Verify that all form fields values can be get and set
| Default format | HTML |
| Force format | 1 |
And I press "Cancel"
And I follow "Course 1"
And I am on course page "Course 1"
# Radio - Checking "I set the field" and "the field matches value".
And I add a "Choice" to section "1" and I fill the form with:
| Choice name | Test choice name |
Expand All @@ -116,7 +116,7 @@ Feature: Verify that all form fields values can be get and set
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Edit settings" node in "Course administration"
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
Expand All @@ -129,7 +129,7 @@ Feature: Verify that all form fields values can be get and set

@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Then I follow "Course 1"
Then I am on course page "Course 1"
And I navigate to "Users > Groups" in current page administration
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
Expand All @@ -141,7 +141,7 @@ Feature: Verify that all form fields values can be get and set
And the "members" select box should contain "Student 2"
And the "members" select box should not contain "Student 3"
# Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values".
And I follow "Course 1"
And I am on course page "Course 1"
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson |
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/manipulate_forms.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Forms manipulation
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Quiz" to section "1"
When I expand all fieldsets
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/filetypes/tests/behat/add_filetypes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Feature: Add customised file types
And I press "Save changes"
# Create a resource activity and add it to a course
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
When I add a "File" to section "1"
And I set the following fields to these values:
Expand Down
12 changes: 6 additions & 6 deletions admin/tool/monitor/tests/behat/rule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: tool_monitor_rule
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I click on "Enable" "link"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I press "Add a new rule"
And I set the following fields to these values:
Expand Down Expand Up @@ -46,7 +46,7 @@ Feature: tool_monitor_rule
Scenario: Add a rule on course level
Given I log in as "teacher1"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I press "Add a new rule"
And I set the following fields to these values:
Expand All @@ -66,7 +66,7 @@ Feature: tool_monitor_rule

Scenario: Delete a rule on course level
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I click on "Delete rule" "link"
Then I should see "Are you sure you want to delete the rule \"New rule course level\"?"
Expand All @@ -76,7 +76,7 @@ Feature: tool_monitor_rule

Scenario: Edit a rule on course level
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I click on "Edit rule" "link"
And I set the following fields to these values:
Expand All @@ -95,7 +95,7 @@ Feature: tool_monitor_rule

Scenario: Duplicate a rule on course level
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I click on "Duplicate rule" "link" in the "New rule course level" "table_row"
Then I should see "Rule successfully duplicated"
Expand Down Expand Up @@ -154,7 +154,7 @@ Feature: tool_monitor_rule

Scenario: Duplicate a rule on site level
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I click on "Duplicate rule" "link" in the "New rule site level" "table_row"
Then I should see "Rule successfully duplicated"
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/monitor/tests/behat/subscription.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: tool_monitor_subscriptions
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I click on "Enable" "link"
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I press "Add a new rule"
And I set the following fields to these values:
Expand Down Expand Up @@ -133,7 +133,7 @@ Feature: tool_monitor_subscriptions
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
And I am on site homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I trigger cron
And I am on site homepage
When I click on ".popover-region-notifications" "css_element"
Expand Down
8 changes: 4 additions & 4 deletions admin/tool/recyclebin/tests/behat/backup_user_data.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: Backup user data
@javascript
Scenario: Delete and restore a quiz with user data
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Quiz" to section "1" and I fill the form with:
| Name | Quiz 1 |
Expand All @@ -44,7 +44,7 @@ Feature: Backup user data
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I follow "Course 1"
And I am on course page "Course 1"
And I follow "Quiz 1"
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
Expand All @@ -55,7 +55,7 @@ Feature: Backup user data
And I should see "5.00 out of 10.00"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I delete "Quiz 1" activity
And I run all adhoc tasks
Expand All @@ -64,7 +64,7 @@ Feature: Backup user data
And I click on "Restore" "link" in the "region-main" "region"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I am on course page "Course 1"
When I navigate to "User report" in the course gradebook
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
8 changes: 4 additions & 4 deletions admin/tool/recyclebin/tests/behat/basic_functionality.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Basic recycle bin functionality

Scenario: Restore a deleted assignment
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assign |
Expand All @@ -38,7 +38,7 @@ Feature: Basic recycle bin functionality
And I should see "'Test assign' has been restored"
And I wait to be redirected
And I am on homepage
And I follow "Course 1"
And I am on course page "Course 1"
And I should see "Test assign" in the "Topic 1" "section"

Scenario: Restore a deleted course
Expand All @@ -64,7 +64,7 @@ Feature: Basic recycle bin functionality
@javascript
Scenario: Deleting a single item from the recycle bin
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assign |
Expand All @@ -84,7 +84,7 @@ Feature: Basic recycle bin functionality
@javascript
Scenario: Deleting all the items from the recycle bin
Given I log in as "teacher1"
And I follow "Course 1"
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assign 1 |
Expand Down
3 changes: 1 addition & 2 deletions admin/tool/uploaduser/tests/behat/upload_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Feature: Upload users
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "[email protected]"
And I am on site homepage
And I follow "Maths"
And I am on course page "Maths"
And I navigate to "Users > Groups" in current page administration
And I set the field "groups" to "Section 1 (1)"
And the "members" select box should contain "Tom Jones"
Expand Down
Loading

0 comments on commit c987d1b

Please sign in to comment.