From 37d39fe34855aa43eb3d993fbf2d6604f6456253 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Wed, 21 May 2014 20:58:16 +1200 Subject: [PATCH] MDL-44711 course: fixed navigation expansion in course tests --- course/tests/behat/behat_course.php | 4 +--- course/tests/behat/max_number_sections.feature | 4 +--- lib/tests/behat/behat_navigation.php | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index cf86d896d3a..a306319a45b 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -122,9 +122,7 @@ class behat_course extends behat_base { public function i_go_to_the_courses_management_page() { return array( new Given('I am on homepage'), - new Given('I expand "' . get_string('administrationsite') . '" node'), - new Given('I expand "' . get_string('courses', 'admin') . '" node'), - new Given('I follow "' . get_string('coursemgmt', 'admin') . '"') + new Given('I navigate to "' . get_string('coursemgmt', 'admin') . '" node in "' . get_string('administrationsite') . ' > ' . get_string('courses', 'admin') . '"') ); } diff --git a/course/tests/behat/max_number_sections.feature b/course/tests/behat/max_number_sections.feature index c881ecd85a1..d3e7e55e282 100644 --- a/course/tests/behat/max_number_sections.feature +++ b/course/tests/behat/max_number_sections.feature @@ -12,9 +12,7 @@ Feature: The maximum number of weeks/topics in a course can be configured | user | course | role | | manager1 | Acceptance test site | manager | And I log in as "admin" - And I expand "Site administration" node - And I expand "Courses" node - And I follow "Course default settings" + And I navigate to "Course default settings" node in "Site administration > Courses" @javascript Scenario: The number of sections can be increased and the limits are applied to courses diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index 30e86b9d90a..505443571ed 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -63,7 +63,7 @@ class behat_navigation extends behat_base { $nodetextliteral = $this->getSession()->getSelectorsHandler()->xpathLiteral($text); $hasblocktree = "[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]"; $hasbranch = "[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]"; - $hascollapsed = "li[contains(concat(' ', normalize-space(@class), ' '), ' collapsed ') or @data-exandable='1']"; + $hascollapsed = "li[contains(concat(' ', normalize-space(@class), ' '), ' collapsed ') or @data-expandable='1']"; $notcollapsed = "li[not(contains(concat(' ', normalize-space(@class), ' '), ' collapsed '))]"; $match = "[normalize-space(.)={$nodetextliteral}]";