Skip to content

Commit

Permalink
MDL-57281 behat: deprecated step definition I navigate to node in
Browse files Browse the repository at this point in the history
Definition step deprecated and affected tests modified.
  • Loading branch information
vmdef committed Aug 20, 2018
1 parent a9428fa commit 02fda27
Show file tree
Hide file tree
Showing 233 changed files with 711 additions and 581 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Enable multiple accounts to have the same email address
Scenario: Enable registration of multiple accounts with the same email address
Given the following config values are set as admin:
| allowaccountssameemail | 1 |
When I navigate to "Add a new user" node in "Site administration>Users>Accounts"
When I navigate to "Users > Accounts > Add a new user" in site administration
And I set the following fields to these values:
| Username | testmultiemailuser1 |
| Choose an authentication method | Manual accounts |
Expand All @@ -35,7 +35,7 @@ Feature: Enable multiple accounts to have the same email address
Scenario: Disable registration of multiple accounts with the same email address
Given the following config values are set as admin:
| allowaccountssameemail | 0 |
When I navigate to "Add a new user" node in "Site administration>Users>Accounts"
When I navigate to "Users > Accounts > Add a new user" in site administration
And I set the following fields to these values:
| Username | testmultiemailuser1 |
| Choose an authentication method | Manual accounts |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Manage availability conditions
And the following config values are set as admin:
| enableavailability | 1 |
And I am on homepage
And I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
And I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration

# Having clicked on it, I should also see the list of plugins.
And I should see "Restriction by date"
Expand All @@ -34,7 +34,7 @@ Feature: Manage availability conditions
| Course 1 | C1 | topics |
And I log in as "admin"
And I am on site homepage
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration

# Check the icon is there (it should be a Hide icon, meaning is currently visible).
Then "Hide" "icon" should exist in the "Restriction by date" "table_row"
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Feature: Set up contextual data for tests
| student1 | CHSB |
| student1 | CHC |
When I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
And I navigate to "Users > Accounts > Cohorts" in site administration
Then the following should exist in the "cohorts" table:
| Name | Cohort size |
| System cohort A | 1 |
Expand Down
6 changes: 3 additions & 3 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 "Course 1" course homepage
And I navigate to "Reset" node in "Course administration"
And I navigate to "Reset" in current page administration
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
And the "Unenrol users" select box should contain "No roles"
Expand Down Expand Up @@ -131,12 +131,12 @@ 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 "Course 1" course homepage
And I navigate to "Edit settings" node in "Course administration"
And I navigate to "Edit settings" in current page 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"
And the field with xpath "//input[@name='idnumber']" does not match value ""
And I press "Save and display"
And I navigate to "Edit settings" node in "Course administration"
And I navigate to "Edit settings" in current page administration
And the field "Course ID number" matches value "Course id number"

Scenario: with JS disabled all form fields getters and setters works as expected
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/list_steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: List the system steps definitions
Background:
Given I am on homepage
And I log in as "admin"
And I navigate to "Acceptance testing" node in "Site administration > Development"
And I navigate to "Development > Acceptance testing" in site administration

@javascript
Scenario: Accessing the list
Expand Down
18 changes: 9 additions & 9 deletions admin/tool/filetypes/tests/behat/add_filetypes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Add customised file types

Scenario: Add a new file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
And I press "Add"
# Try setting all the form fields, not just the optional ones.
And I set the following fields to these values:
Expand All @@ -24,7 +24,7 @@ Feature: Add customised file types

Scenario: Update an existing file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
When I click on "Edit 7z" "link"
And I set the following fields to these values:
| Extension | doc |
Expand All @@ -37,7 +37,7 @@ Feature: Add customised file types

Scenario: Change the text option (was buggy)
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
When I click on "Edit 7z" "link"
And I set the following fields to these values:
| Description type | Custom description specified in this form |
Expand All @@ -51,7 +51,7 @@ Feature: Add customised file types

Scenario: Try to select a text option without entering a value.
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
When I click on "Edit dmg" "link"
And I set the field "Description type" to "Custom description"
And I press "Save changes"
Expand All @@ -66,15 +66,15 @@ Feature: Add customised file types

Scenario: Delete an existing file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
When I click on "Delete 7z" "link"
Then I should see "Are you absolutely sure you want to remove .7z?"
And I press "Yes"
And I should see "Deleted" in the "7z" "table_row"

Scenario: Delete a custom file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
And I press "Add"
And I set the following fields to these values:
| Extension | frog |
Expand All @@ -86,7 +86,7 @@ Feature: Add customised file types

Scenario: Revert changes to deleted file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
When I click on "Delete 7z" "link"
And I press "Yes"
And I follow "Restore 7z to Moodle defaults"
Expand All @@ -95,7 +95,7 @@ Feature: Add customised file types

Scenario: Revert changes to updated file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
And I click on "Edit 7z" "link"
And I set the following fields to these values:
| Type groups | document |
Expand All @@ -110,7 +110,7 @@ Feature: Add customised file types
| fullname | shortname |
| Course 1 | C1 |
And I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I navigate to "Server > File types" in site administration
And I press "Add"
And I set the following fields to these values:
| Extension | frog |
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/httpsreplace/tests/behat/httpsreplace.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Feature: View the httpsreplace report

@javascript
Scenario: Go to the HTTPS replace report screen. Make sure broken domains are reported.
When I navigate to "HTTP security" node in "Site administration > Security"
When I navigate to "Security > HTTP security" in site administration
And I follow "HTTPS conversion tool"
And I press "Continue"
Then I should see "intentionally.unavailable"

@javascript
Scenario: Use the find and replace tool.
When I navigate to "HTTP security" node in "Site administration > Security"
When I navigate to "Security > HTTP security" in site administration
And I follow "HTTPS conversion tool"
And I press "Continue"
And I set the field "I understand the risks of this operation" to "1"
Expand Down
16 changes: 8 additions & 8 deletions admin/tool/langimport/tests/behat/manage_langpacks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ Feature: Manage language packs

Scenario: Install language pack
Given I log in as "admin"
And I navigate to "Language packs" node in "Site administration > Language"
And I navigate to "Language > Language packs" in site administration
When I set the field "Available language packs" to "en_ar"
And I press "Install selected language pack(s)"
Then I should see "Language pack 'en_ar' was successfully installed"
And the "Installed language packs" select box should contain "en_ar"
And I navigate to "Live logs" node in "Site administration > Reports"
And I navigate to "Reports > Live logs" in site administration
And I should see "The language pack 'en_ar' was installed."
And I log out

Scenario: Update language pack
Given outdated langpack 'en_ar' is installed
And I log in as "admin"
And I navigate to "Language packs" node in "Site administration > Language"
And I navigate to "Language > Language packs" in site administration
When I press "Update all installed language packs"
Then I should see "Language pack 'en_ar' was successfully updated"
And I should see "Language pack update completed"
And I navigate to "Live logs" node in "Site administration > Reports"
And I navigate to "Reports > Live logs" in site administration
And I should see "The language pack 'en_ar' was updated."
And I log out

Scenario: Try to uninstall language pack
Given I log in as "admin"
And I navigate to "Language packs" node in "Site administration > Language"
And I navigate to "Language > Language packs" in site administration
And I set the field "Available language packs" to "en_ar"
And I press "Install selected language pack(s)"
When I set the field "Installed language packs" to "en_ar"
Expand All @@ -42,17 +42,17 @@ Feature: Manage language packs
Then I should see "Language pack 'en_ar' was uninstalled"
And the "Installed language packs" select box should not contain "en_ar"
And the "Available language packs" select box should contain "en_ar"
And I navigate to "Live logs" node in "Site administration > Reports"
And I navigate to "Reports > Live logs" in site administration
And I should see "The language pack 'en_ar' was removed."
And I should see "Language pack uninstalled"
And I log out

Scenario: Try to uninstall English language pack
Given I log in as "admin"
And I navigate to "Language packs" node in "Site administration > Language"
And I navigate to "Language > Language packs" in site administration
When I set the field "Installed language packs" to "en"
And I press "Uninstall selected language pack(s)"
Then I should see "The English language pack cannot be uninstalled."
And I navigate to "Live logs" node in "Site administration > Reports"
And I navigate to "Reports > Live logs" in site administration
And I should not see "Language pack uninstalled"
And I log out
2 changes: 1 addition & 1 deletion admin/tool/monitor/tests/behat/disabled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Enable/disable managment of the event monitor

Scenario: Tool is disabled by default.
Given I log in as "admin"
When I navigate to "Event monitoring rules" node in "Site administration > Reports"
When I navigate to "Reports > Event monitoring rules" in site administration
Then I should see "Event monitoring is currently disabled"
And I should see "Enable"
And I should not see "Add a new rule"
Expand Down
22 changes: 11 additions & 11 deletions admin/tool/monitor/tests/behat/rule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Feature: tool_monitor_rule
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
Expand All @@ -29,7 +29,7 @@ Feature: tool_monitor_rule
| minutes | 1 |
| Notification message | The forum post was created. {modulelink} |
And I press "Save changes"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule site level |
Expand All @@ -45,7 +45,7 @@ Feature: tool_monitor_rule
Scenario: Add a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
When I press "Add a new rule"
And I set the following fields to these values:
| name | New rule |
Expand All @@ -65,7 +65,7 @@ Feature: tool_monitor_rule
Scenario: Delete a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
When I click on "Delete rule" "link"
Then I should see "Are you sure you want to delete the rule \"New rule course level\"?"
And I press "Continue"
Expand All @@ -75,7 +75,7 @@ Feature: tool_monitor_rule
Scenario: Edit a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
When I click on "Edit rule" "link"
And I set the following fields to these values:
| name | New rule quiz |
Expand All @@ -94,7 +94,7 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
When I click on "Duplicate rule" "link" in the "New rule course level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r1" "css_element" should appear before "#toolmonitorrules_r2" "css_element"
Expand All @@ -106,7 +106,7 @@ Feature: tool_monitor_rule

Scenario: Add a rule on site level
Given I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
When I press "Add a new rule"
And I set the following fields to these values:
| name | New rule |
Expand All @@ -125,7 +125,7 @@ Feature: tool_monitor_rule

Scenario: Delete a rule on site level
Given I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
When I click on "Delete rule" "link"
Then I should see "Are you sure you want to delete the rule \"New rule site level\"?"
And I press "Continue"
Expand All @@ -134,7 +134,7 @@ Feature: tool_monitor_rule

Scenario: Edit a rule on site level
Given I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
When I click on "Edit rule" "link"
And I set the following fields to these values:
| name | New Rule Quiz |
Expand All @@ -153,7 +153,7 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on site level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
When I click on "Duplicate rule" "link" in the "New rule site level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r2" "css_element" should appear after "#toolmonitorrules_r1" "css_element"
Expand Down
8 changes: 4 additions & 4 deletions admin/tool/monitor/tests/behat/subscription.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Feature: tool_monitor_subscriptions
| teacher2 | C1 | teacher |
| teacher2 | C2 | editingteacher |
And I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I navigate to "Reports > Event monitoring rules" in current page administration
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
Expand All @@ -34,7 +34,7 @@ Feature: tool_monitor_subscriptions
| minutes | 1 |
| Notification message | The course was viewed. {modulelink} |
And I press "Save changes"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I navigate to "Reports > Event monitoring rules" in site administration
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule site level |
Expand All @@ -45,7 +45,7 @@ Feature: tool_monitor_subscriptions
| minutes | 1 |
| Notification message | The course was viewed. {modulelink} |
And I press "Save changes"
And I navigate to "Define roles" node in "Site administration > Users > Permissions"
And I navigate to "Users > Permissions > Define roles" in site administration
And I follow "Non-editing teacher"
And I press "Edit"
And I click on "tool/monitor:managerules" "checkbox"
Expand Down
Loading

0 comments on commit 02fda27

Please sign in to comment.