From d295418ee631baa3309bae604a37131f117cef02 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 10 Mar 2014 13:31:01 +0800 Subject: [PATCH] MDL-44440 behat: Changing , for > as a navigation tree nodes separator Using greater than as seems a more natural separator than the comma when separating nodes which have a hierarchy relation. --- admin/tests/behat/upload_users.feature | 2 +- admin/tool/behat/tests/behat/list_steps.feature | 2 +- admin/tool/uploadcourse/tests/behat/create.feature | 2 +- admin/tool/uploadcourse/tests/behat/update.feature | 2 +- badges/tests/behat/award_badge.feature | 4 ++-- .../tests/behat/block_activity_modules.feature | 2 +- blocks/tests/behat/manage_blocks.feature | 2 +- cohort/tests/behat/add_cohort.feature | 2 +- cohort/tests/behat/behat_cohort.php | 4 ++-- cohort/tests/behat/upload_cohort_users.feature | 2 +- lib/tests/behat/behat_navigation.php | 4 ++-- lib/tests/behat/behat_permissions.php | 4 +++- 12 files changed, 17 insertions(+), 15 deletions(-) diff --git a/admin/tests/behat/upload_users.feature b/admin/tests/behat/upload_users.feature index c2e61a183ae..add26458158 100644 --- a/admin/tests/behat/upload_users.feature +++ b/admin/tests/behat/upload_users.feature @@ -14,7 +14,7 @@ Feature: Upload users | Section 1 | math102 | S1 | | Section 3 | math102 | S3 | And I log in as "admin" - And I navigate to "Upload users" node in "Site administration,Users,Accounts" + And I navigate to "Upload users" node in "Site administration > Users > Accounts" When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filemanager And I press "Upload users" Then I should see "Upload users preview" diff --git a/admin/tool/behat/tests/behat/list_steps.feature b/admin/tool/behat/tests/behat/list_steps.feature index 19cd8ef5d07..834390c5fa9 100644 --- a/admin/tool/behat/tests/behat/list_steps.feature +++ b/admin/tool/behat/tests/behat/list_steps.feature @@ -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 "Acceptance testing" node in "Site administration > Development" @javascript Scenario: Accessing the list diff --git a/admin/tool/uploadcourse/tests/behat/create.feature b/admin/tool/uploadcourse/tests/behat/create.feature index d2b877e1364..e585250708b 100644 --- a/admin/tool/uploadcourse/tests/behat/create.feature +++ b/admin/tool/uploadcourse/tests/behat/create.feature @@ -9,7 +9,7 @@ Feature: An admin can create courses using a CSV file | fullname | shortname | category | | First course | C1 | 0 | And I log in as "admin" - And I navigate to "Upload courses" node in "Site administration,Courses" + And I navigate to "Upload courses" node in "Site administration > Courses" @javascript Scenario: Creation of unexisting courses diff --git a/admin/tool/uploadcourse/tests/behat/update.feature b/admin/tool/uploadcourse/tests/behat/update.feature index ff87bd5ef29..28ff6abdfb2 100644 --- a/admin/tool/uploadcourse/tests/behat/update.feature +++ b/admin/tool/uploadcourse/tests/behat/update.feature @@ -9,7 +9,7 @@ Feature: An admin can update courses using a CSV file | fullname | shortname | category | | Some random name | C1 | 0 | And I log in as "admin" - And I navigate to "Upload courses" node in "Site administration,Courses" + And I navigate to "Upload courses" node in "Site administration > Courses" @javascript Scenario: Updating a course fullname diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 8fe96bcbef9..32214316f16 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -7,7 +7,7 @@ Feature: Award badges @javascript Scenario: Award profile badge Given I log in as "admin" - And I navigate to "Add a new badge" node in "Site administration,Badges" + And I navigate to "Add a new badge" node in "Site administration > Badges" And I fill the moodle form with: | Name | Profile Badge | | Description | Test badge description | @@ -42,7 +42,7 @@ Feature: Award badges | teacher | teacher | 1 | teacher1@asd.com | | student | student | 1 | student1@asd.com | And I log in as "admin" - And I navigate to "Add a new badge" node in "Site administration,Badges" + And I navigate to "Add a new badge" node in "Site administration > Badges" And I fill the moodle form with: | Name | Site Badge | | Description | Site badge description | diff --git a/blocks/activity_modules/tests/behat/block_activity_modules.feature b/blocks/activity_modules/tests/behat/block_activity_modules.feature index e75307c18a3..5ee0f1981b6 100644 --- a/blocks/activity_modules/tests/behat/block_activity_modules.feature +++ b/blocks/activity_modules/tests/behat/block_activity_modules.feature @@ -6,7 +6,7 @@ Feature: Block activity modules Background: Given I log in as "admin" - And I navigate to "Manage activities" node in "Site administration,Plugins,Activity modules" + And I navigate to "Manage activities" node in "Site administration > Plugins > Activity modules" And I click on "//a[@title=\"Show\"]" "xpath_element" in the "Feedback" "table_row" And I click on "//a[@title=\"Show\"]" "xpath_element" in the "Assignment (2.2)" "table_row" diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index e2783b52cb3..8255f24f12d 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -15,7 +15,7 @@ Feature: Block appearances | user | course | role | | teacher1 | C1 | editingteacher | And I log in as "admin" - And I navigate to "Theme selector" node in "Site administration,Appearance,Themes" + And I navigate to "Theme selector" node in "Site administration > Appearance > Themes" And I click on "Change theme" "button" in the "Default" "table_row" And I click on "Use theme" "button" in the "Afterburner" "table_row" And I press "Continue" diff --git a/cohort/tests/behat/add_cohort.feature b/cohort/tests/behat/add_cohort.feature index 675e30facf2..d2b5f8c84c3 100644 --- a/cohort/tests/behat/add_cohort.feature +++ b/cohort/tests/behat/add_cohort.feature @@ -12,7 +12,7 @@ Feature: Add cohorts of users | user3 | Third | User | third@user.com | | user4 | Forth | User | forth@user.com | And I log in as "admin" - And I navigate to "Cohorts" node in "Site administration,Users,Accounts" + And I navigate to "Cohorts" node in "Site administration > Users > Accounts" And I press "Add" And I fill the moodle form with: | Name | Test cohort name | diff --git a/cohort/tests/behat/behat_cohort.php b/cohort/tests/behat/behat_cohort.php index 8644a9e4821..e01a3dbc2c0 100644 --- a/cohort/tests/behat/behat_cohort.php +++ b/cohort/tests/behat/behat_cohort.php @@ -64,8 +64,8 @@ class behat_cohort extends behat_base { if (!$this->getSession()->getPage()->find('css', 'input#cohort_search_q')) { $parentnodes = get_string('administrationsite') . - ',' . get_string('users', 'admin') . - ',' . get_string('accounts', 'admin'); + ' > ' . get_string('users', 'admin') . + ' > ' . get_string('accounts', 'admin'); $steps = array_merge( array( diff --git a/cohort/tests/behat/upload_cohort_users.feature b/cohort/tests/behat/upload_cohort_users.feature index 02e08f131f1..46e688b3fa2 100644 --- a/cohort/tests/behat/upload_cohort_users.feature +++ b/cohort/tests/behat/upload_cohort_users.feature @@ -22,7 +22,7 @@ Feature: Upload users to a cohort And I follow "Course 2" And I add "Cohort sync" enrolment method with: | Cohort | Cohort 2 | - When I navigate to "Upload users" node in "Site administration,Users,Accounts" + When I navigate to "Upload users" node in "Site administration > Users > Accounts" And I upload "lib/tests/fixtures/upload_users_cohorts.csv" file to "File" filemanager And I press "Upload users" And I press "Upload users" diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index eb3ead19ae0..f723ea3e71d 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -113,7 +113,7 @@ class behat_navigation extends behat_base { } /** - * Click link in navigation tree that matches the text in parentnode/s (comma seperated if more then one) + * Click link in navigation tree that matches the text in parentnode/s (seperated using greater-than character if more than one) * * @Given /^I navigate to "(?P(?:[^"]|\\")*)" node in "(?P(?:[^"]|\\")*)"$/ * @@ -128,7 +128,7 @@ class behat_navigation extends behat_base { $siteadminstr = get_string('administrationsite'); // Create array of all parentnodes. - $parentnodes = explode(',', $parentnodes); + $parentnodes = array_map('trim', explode('>', $parentnodes)); $countparentnode = count($parentnodes); // If JS is disabled and Site administration is not expanded we diff --git a/lib/tests/behat/behat_permissions.php b/lib/tests/behat/behat_permissions.php index 87fbe7c80c0..4ad6a4f9f05 100644 --- a/lib/tests/behat/behat_permissions.php +++ b/lib/tests/behat/behat_permissions.php @@ -50,7 +50,9 @@ class behat_permissions extends behat_base { */ public function i_set_the_following_system_permissions_of_role($rolename, $table) { - $parentnodes = get_string('administrationsite') . ',' . get_string('users', 'admin') . ',' . get_string('permissions', 'role'); + $parentnodes = get_string('administrationsite') . ' > ' . + get_string('users', 'admin') . ' > ' . + get_string('permissions', 'role'); return array( new Given('I am on homepage'), new Given('I navigate to "' . get_string('defineroles', 'role') . '" node in "' . $parentnodes . '"'),