diff --git a/admin/tests/behat/upload_users.feature b/admin/tests/behat/upload_users.feature index 847a632642d..7194144fffe 100644 --- a/admin/tests/behat/upload_users.feature +++ b/admin/tests/behat/upload_users.feature @@ -14,11 +14,7 @@ Feature: Upload users | Section 1 | math102 | S1 | | Section 3 | math102 | S3 | And I log in as "admin" - And I collapse "Front page settings" node - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - And I follow "Upload users" + 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/basic_actions.feature b/admin/tool/behat/tests/behat/basic_actions.feature index 73d9a1aeb2b..6460eb25e3e 100644 --- a/admin/tool/behat/tests/behat/basic_actions.feature +++ b/admin/tool/behat/tests/behat/basic_actions.feature @@ -40,7 +40,7 @@ Feature: Page contents assertions And I log in as "admin" And I follow "Course 1" When I dock "Administration" block - Then I should not see "Question bank" in the "region-pre" "region" + Then I should not see "Question bank" in the ".block-region" "css_element" And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element" @javascript @@ -50,4 +50,4 @@ Feature: Page contents assertions | Course 1 | C1 | 0 | And I log in as "admin" When I dock "Administration" block - Then I should not see "Turn editing on" in the "region-pre" "region" + Then I should not see "Turn editing on" in the ".block-region" "css_element" diff --git a/admin/tool/behat/tests/behat/list_steps.feature b/admin/tool/behat/tests/behat/list_steps.feature index 8061f4ed88c..3e4d31e2434 100644 --- a/admin/tool/behat/tests/behat/list_steps.feature +++ b/admin/tool/behat/tests/behat/list_steps.feature @@ -7,9 +7,7 @@ Feature: List the system steps definitions Background: Given I am on homepage And I log in as "admin" - And I expand "Site administration" node - And I expand "Development" node - And I follow "Acceptance testing" + And I navigate to "Acceptance testing" node in "Site administration > Development" @javascript Scenario: Accessing the list diff --git a/admin/tool/behat/tests/behat/manipulate_forms.feature b/admin/tool/behat/tests/behat/manipulate_forms.feature index fdde569e48c..3696b81e865 100644 --- a/admin/tool/behat/tests/behat/manipulate_forms.feature +++ b/admin/tool/behat/tests/behat/manipulate_forms.feature @@ -7,8 +7,7 @@ Feature: Forms manipulation @javascript Scenario: Basic forms manipulation Given I log in as "admin" - And I follow "Admin User" - And I follow "Edit profile" + And I navigate to "Edit profile" node in "My profile settings" When I set the field "First name" to "Field value" And I set the field "Text editor" to "Plain text area" And I set the field "Unmask" to "1" diff --git a/admin/tool/behat/tests/behat/nasty_strings.feature b/admin/tool/behat/tests/behat/nasty_strings.feature index d713f8ad9d9..5466d42ddf2 100644 --- a/admin/tool/behat/tests/behat/nasty_strings.feature +++ b/admin/tool/behat/tests/behat/nasty_strings.feature @@ -10,8 +10,7 @@ Feature: Transform steps arguments | fullname | shortname | category | | Course 1 | C1 | 0 | And I log in as "admin" - And I follow "Admin User" - And I follow "Edit profile" + And I navigate to "Edit profile" node in "My profile settings" Scenario: Use nasty strings on steps arguments When I set the field "Surname" to "$NASTYSTRING1" diff --git a/admin/tool/uploadcourse/tests/behat/create.feature b/admin/tool/uploadcourse/tests/behat/create.feature index 026fe92feac..eed6fabfc62 100644 --- a/admin/tool/uploadcourse/tests/behat/create.feature +++ b/admin/tool/uploadcourse/tests/behat/create.feature @@ -9,9 +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 expand "Site administration" node - And I expand "Courses" node - And I follow "Upload 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 b505af6c3bf..b574b66aa16 100644 --- a/admin/tool/uploadcourse/tests/behat/update.feature +++ b/admin/tool/uploadcourse/tests/behat/update.feature @@ -9,9 +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 expand "Site administration" node - And I expand "Courses" node - And I follow "Upload courses" + And I navigate to "Upload courses" node in "Site administration > Courses" @javascript Scenario: Updating a course fullname diff --git a/auth/tests/behat/behat_auth.php b/auth/tests/behat/behat_auth.php index e0d62380733..9ac8d1571dd 100644 --- a/auth/tests/behat/behat_auth.php +++ b/auth/tests/behat/behat_auth.php @@ -69,21 +69,9 @@ class behat_auth extends behat_base { // Wait for the homepage to be ready. $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); - // Checking if we need to click the navbar button to show the navigation menu, it - // is hidden by default when using clean theme and a medium or small size screen size. - - // The DOM and the JS should be all ready and loaded. Running without spinning - // as this is a widely used step and we can not spend time here trying to see - // a DOM node that is not always there (at the moment clean is not even the - // default theme...). - $navbuttonjs = "return ( - Y.one('.btn-navbar') && - Y.one('.btn-navbar').getComputedStyle('display') !== 'none' - )"; - - // Adding an extra click we need to show the 'Log in' link. - if ($this->getSession()->getDriver()->evaluateScript($navbuttonjs)) { - array_unshift($steps, new Given('I click on ".btn-navbar" "css_element"')); + // If it is needed, it expands the navigation bar with the 'Log in' link. + if ($clicknavbar = $this->get_expand_navbar_step()) { + array_unshift($steps, $clicknavbar); } return $steps; @@ -95,7 +83,50 @@ class behat_auth extends behat_base { * @Given /^I log out$/ */ public function i_log_out() { - return new When('I follow "' . get_string('logout') . '"'); + + $steps = array(new When('I follow "' . get_string('logout') . '"')); + + // No need to check anything else if we run without JS. + if (!$this->running_javascript()) { + return $steps; + } + + // If it is needed, it expands the navigation bar with the 'Log out' link. + if ($clicknavbar = $this->get_expand_navbar_step()) { + array_unshift($steps, $clicknavbar); + } + + return $steps; } + /** + * Returns a step to open the navigation bar if it is needed. + * + * The top log in and log out links are hidden when middle or small + * size windows (or devices) are used. This step returns a step definition + * clicking to expand the navbar if it is hidden. + * + * @return Given|bool A step definition or false if there is no need to show the navbar. + */ + protected function get_expand_navbar_step() { + + // Checking if we need to click the navbar button to show the navigation menu, it + // is hidden by default when using clean theme and a medium or small screen size. + + // The DOM and the JS should be all ready and loaded. Running without spinning + // as this is a widely used step and we can not spend time here trying to see + // a DOM node that is not always there (at the moment clean is not even the + // default theme...). + $navbuttonjs = "return ( + Y.one('.btn-navbar') && + Y.one('.btn-navbar').getComputedStyle('display') !== 'none' + )"; + + // Adding an extra click we need to show the 'Log in' link. + if (!$this->getSession()->getDriver()->evaluateScript($navbuttonjs)) { + return false; + } + + return new Given('I click on ".btn-navbar" "css_element"'); + } } diff --git a/auth/tests/behat/login.feature b/auth/tests/behat/login.feature index a9d8e671bfd..3641b912083 100644 --- a/auth/tests/behat/login.feature +++ b/auth/tests/behat/login.feature @@ -6,12 +6,12 @@ Feature: Authentication Scenario: Log in with the predefined admin user with Javascript disabled Given I log in as "admin" - Then I should see "You are logged in as Admin User" + Then I should see "You are logged in as Admin User" in the "page-footer" "region" @javascript Scenario: Log in with the predefined admin user with Javascript enabled Given I log in as "admin" - Then I should see "You are logged in as Admin User" + Then I should see "You are logged in as Admin User" in the "page-footer" "region" Scenario: Log in as an existing admin user filling the form Given the following "users" exist: @@ -22,7 +22,7 @@ Feature: Authentication And I set the field "Username" to "testuser" And I set the field "Password" to "testuser" And I press "Log in" - Then I should see "You are logged in as" + Then I should see "You are logged in as" in the "page-footer" "region" Scenario: Log in as an unexisting user filling the form Given the following "users" exist: @@ -38,4 +38,4 @@ Feature: Authentication Scenario: Log out Given I log in as "admin" When I log out - Then I should see "You are not logged in" + Then I should see "You are not logged in" in the "page-footer" "region" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 38939da8435..ffe9b3d8bc0 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -7,9 +7,7 @@ Feature: Award badges @javascript Scenario: Award profile badge Given I log in as "admin" - And I expand "Site administration" node - And I expand "Badges" node - And I follow "Add a new badge" + And I navigate to "Add a new badge" node in "Site administration > Badges" And I set the following fields to these values: | Name | Profile Badge | | Description | Test badge description | @@ -44,9 +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 expand "Site administration" node - And I expand "Badges" node - And I follow "Add a new badge" + And I navigate to "Add a new badge" node in "Site administration > Badges" And I set the following fields to these values: | 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 b210f5a4a2b..8763deaaf1d 100644 --- a/blocks/activity_modules/tests/behat/block_activity_modules.feature +++ b/blocks/activity_modules/tests/behat/block_activity_modules.feature @@ -6,10 +6,7 @@ Feature: Block activity modules Background: Given I log in as "admin" - And I expand "Site administration" node - And I expand "Plugins" node - And I expand "Activity modules" node - And I follow "Manage activities" + 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" Scenario: Add activities block on the frontpage diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index c96d963fcc0..bd66fea7112 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -15,10 +15,7 @@ Feature: Block appearances | user | course | role | | teacher1 | C1 | editingteacher | And I log in as "admin" - And I expand "Site administration" node - And I expand "Appearance" node - And I expand "Themes" node - And I follow "Theme selector" + 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 ae54a010f00..bb6db425795 100644 --- a/cohort/tests/behat/add_cohort.feature +++ b/cohort/tests/behat/add_cohort.feature @@ -12,11 +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 collapse "Front page settings" node - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - And I follow "Cohorts" + And I navigate to "Cohorts" node in "Site administration > Users > Accounts" And I press "Add" And I set the following fields to these values: | Name | Test cohort name | diff --git a/cohort/tests/behat/behat_cohort.php b/cohort/tests/behat/behat_cohort.php index adeb88b3b77..0f982db01c6 100644 --- a/cohort/tests/behat/behat_cohort.php +++ b/cohort/tests/behat/behat_cohort.php @@ -60,14 +60,13 @@ class behat_cohort extends behat_base { // With JS enabled we should expand a few tree nodes. if ($this->running_javascript()) { + $parentnodes = get_string('administrationsite') . ' > ' . + get_string('users', 'admin') . ' > ' . + get_string('accounts', 'admin'); $steps = array_merge( array( new Given('I am on homepage'), - new Given('I collapse "' . get_string('frontpagesettings', 'admin') . '" node'), - new Given('I expand "' . get_string('administrationsite') . '" node'), - new Given('I expand "' . get_string('users', 'admin') . '" node'), - new Given('I expand "' . get_string('accounts', 'admin') . '" node'), - new Given('I follow "' . get_string('cohorts', 'cohort') . '"') + new Given('I navigate to "' . get_string('cohorts', 'cohort') . '" node in "' . $parentnodes . '"') ), $steps ); diff --git a/cohort/tests/behat/upload_cohort_users.feature b/cohort/tests/behat/upload_cohort_users.feature index 8f3341b48c9..80b1b4e5712 100644 --- a/cohort/tests/behat/upload_cohort_users.feature +++ b/cohort/tests/behat/upload_cohort_users.feature @@ -22,11 +22,7 @@ Feature: Upload users to a cohort And I follow "Course 2" And I add "Cohort sync" enrolment method with: | Cohort | Cohort 2 | - And I collapse "Course administration" node - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - When I follow "Upload users" + 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/behat/classes/behat_selectors.php b/lib/behat/classes/behat_selectors.php index 48688b077f5..d9d9246f60a 100644 --- a/lib/behat/classes/behat_selectors.php +++ b/lib/behat/classes/behat_selectors.php @@ -89,7 +89,7 @@ XPATH //div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' '))] | //div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]/descendant::h2[normalize-space(.) = %locator%]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')] XPATH , 'region' => << <<find('xpath', $xpath, $exception); $node->click(); } + + /** + * 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(?:[^"]|\\")*)"$/ + * + * @throws ExpectationException + * @param string $nodetext navigation node to click. + * @param string $parentnodes comma seperated list of parent nodes. + * @return void + */ + public function i_navigate_to_node_in($nodetext, $parentnodes) { + + // Site admin is different and needs special treatment. + $siteadminstr = get_string('administrationsite'); + + // Create array of all parentnodes. + $parentnodes = array_map('trim', explode('>', $parentnodes)); + $countparentnode = count($parentnodes); + + // If JS is disabled and Site administration is not expanded we + // should follow it, so all the lower-level nodes are available. + if (!$this->running_javascript()) { + if ($parentnodes[0] === $siteadminstr) { + // We don't know if there if Site admin is already expanded so + // don't wait, it is non-JS and we already waited for the DOM. + if ($siteadminlink = $this->getSession()->getPage()->find('named', array('link', "'" . $siteadminstr . "'"))) { + $siteadminlink->click(); + } + } + } + + // Expand first node, and get it. + $node = $this->get_top_navigation_node($parentnodes[0]); + + // Expand parent, sub-parent nodes in navigation if js enabled. + if ($node->hasClass('collapsed') || ($node->hasAttribute('data-loaded') && $node->getAttribute('data-loaded') == 0)) { + $xpath = "/p[contains(concat(' ', normalize-space(@class), ' '), ' tree_item ')]/span"; + $nodetoexpand = $node->find('xpath', $xpath); + + if ($this->running_javascript()) { + $this->ensure_node_is_visible($nodetoexpand); + $nodetoexpand->click(); + + // Site administration node needs to be expanded. + if ($parentnodes[0] === $siteadminstr) { + $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + } + } + } + + // If sub-parent nodes then get to the last one. + if ($countparentnode > 1) { + for ($i = 1; $i < $countparentnode; $i++) { + $node = $this->get_navigation_node($parentnodes[$i], $node); + + // Keep expanding all sub-parents if js enabled. + if ($this->running_javascript()) { + $xpath = "/p[contains(concat(' ', normalize-space(@class), ' '), ' tree_item ')]"; + if ($node->hasClass('collapsed')) { + $nodetoexpand = $node->find('xpath', $xpath); + if ($this->running_javascript()) { + $this->ensure_node_is_visible($nodetoexpand); + $nodetoexpand->click(); + } + } + } + } + } + + // Finally, click on requested node under navigation. + $nodetextliteral = $this->getSession()->getSelectorsHandler()->xpathLiteral($nodetext); + $xpath = "/ul/li/p[contains(concat(' ', normalize-space(@class), ' '), ' tree_item ')]" . + "/a[normalize-space(.)=" . $nodetextliteral . "]"; + $node = $node->find('xpath', $xpath); + + // Throw exception if no node found. + if (!$node) { + throw new ExpectationException('Navigation node "' . $nodetext . '" not found under "' . + $parentnodes . '"', $this->getSession()); + } + + if ($this->running_javascript()) { + $this->ensure_node_is_visible($node); + } + + $node->click(); + } + + /** + * Helper function to get top navigation node in tree. + * + * @throws ExpectationException if note not found. + * @param string $nodetext name of top navigation node in tree. + * @return NodeElement + */ + protected function get_top_navigation_node($nodetext) { + + // Avoid problems with quotes. + $nodetextliteral = $this->getSession()->getSelectorsHandler()->xpathLiteral($nodetext); + $exception = new ExpectationException('Top navigation node "' . $nodetext . ' not found in "', $this->getSession()); + + // First find in navigation block. + $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' content ')]" . + "/ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]" . + "/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "/ul/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "[p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/span[normalize-space(.)=" . $nodetextliteral ."]]" . + "|" . + "//div[contains(concat(' ', normalize-space(@class), ' '), ' content ')]/div" . + "/ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]" . + "/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "/ul/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "[p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/span[normalize-space(.)=" . $nodetextliteral ."]]" . + "|" . + "//div[contains(concat(' ', normalize-space(@class), ' '), ' content ')]/div" . + "/ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]" . + "/li[p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/span[normalize-space(.)=" . $nodetextliteral ."]]"; + $node = $this->find('xpath', $xpath, $exception); + + return $node; + } + + /** + * Helper function to get sub-navigation node. + * + * @throws ExpectationException if note not found. + * @param string $nodetext node to find. + * @param NodeElement $parentnode parent navigation node. + * @return NodeElement. + */ + protected function get_navigation_node($nodetext, $parentnode = null) { + + // Avoid problems with quotes. + $nodetextliteral = $this->getSession()->getSelectorsHandler()->xpathLiteral($nodetext); + + $xpath = "/ul/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "[child::p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/child::span[normalize-space(.)=" . $nodetextliteral ."]]"; + $node = $parentnode->find('xpath', $xpath); + if (!$node) { + $xpath = "/ul/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "[child::p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/child::a[normalize-space(.)=" . $nodetextliteral ."]]"; + $node = $parentnode->find('xpath', $xpath); + } + + if (!$node) { + throw new ExpectationException('Sub-navigation node "' . $nodetext . '" not found under "' . + $parentnode->getText() . '"', $this->getSession()); + } + return $node; + } } diff --git a/lib/tests/behat/behat_permissions.php b/lib/tests/behat/behat_permissions.php index 37928cfdf82..94dcd33612c 100644 --- a/lib/tests/behat/behat_permissions.php +++ b/lib/tests/behat/behat_permissions.php @@ -50,13 +50,12 @@ 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'); return array( new Given('I am on homepage'), - new Given('I collapse "' . get_string('frontpagesettings', 'admin') . '" node'), - new Given('I expand "' . get_string('administrationsite') . '" node'), - new Given('I expand "' . get_string('users', 'admin') . '" node'), - new Given('I expand "' . get_string('permissions', 'role') . '" node'), - new Given('I follow "' . get_string('defineroles', 'role') . '"'), + new Given('I navigate to "' . get_string('defineroles', 'role') . '" node in "' . $parentnodes . '"'), new Given('I follow "Edit ' . $this->escape($rolename) . ' role"'), new Given('I fill the capabilities form with the following permissions:', $table), new Given('I press "' . get_string('savechanges') . '"') diff --git a/mod/forum/tests/behat/track_read_posts.feature b/mod/forum/tests/behat/track_read_posts.feature index 9fae0c8798a..c6217f5a97a 100644 --- a/mod/forum/tests/behat/track_read_posts.feature +++ b/mod/forum/tests/behat/track_read_posts.feature @@ -59,7 +59,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos And I follow "Test forum name" And I follow "Track unread posts" And I wait to be redirected - And I follow "1" + And I click on "1" "link" in the "Admin User" "table_row" And I follow "Course 1" And I should not see "1 unread post" @@ -156,7 +156,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos And I follow "Test forum name" And I follow "Track unread posts" And I wait to be redirected - And I follow "1" + And I click on "1" "link" in the "Admin User" "table_row" And I follow "Course 1" And I should not see "1 unread post" diff --git a/repository/upload/tests/behat/upload_file.feature b/repository/upload/tests/behat/upload_file.feature index 9a46088f68a..199bed37e5e 100644 --- a/repository/upload/tests/behat/upload_file.feature +++ b/repository/upload/tests/behat/upload_file.feature @@ -10,12 +10,11 @@ Feature: Upload files | fullname | shortname | category | | Course 1 | C1 | 0 | And I log in as "admin" - And I follow "Admin User" - And I follow "My private files" + When I navigate to "My private files" node in "My profile" And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager Then I should see "1" elements in "Files" filemanager And I should see "empty.txt" in the "div.fp-content" "css_element" - When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as: + And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as: | Save as | empty_copy.txt | Then I should see "2" elements in "Files" filemanager And I should see "empty.txt" diff --git a/user/tests/behat/edituserpassword.feature b/user/tests/behat/edituserpassword.feature index 8bff06662f0..0c5232c939d 100644 --- a/user/tests/behat/edituserpassword.feature +++ b/user/tests/behat/edituserpassword.feature @@ -8,10 +8,7 @@ Feature: Enable/disable password field based on authentication selected. Scenario: Verify the password field is enabled/disabled based on authentication selected, in user edit advanced page. Given I log in as "admin" And I follow "My home" - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - When I follow "Add a new user" + When I navigate to "Add a new user" node in "Site administration > Users > Accounts" Then the "newpassword" "field" should be enabled And I set the field "auth" to "Web services authentication" And the "newpassword" "field" should be disabled