Skip to content
Permalink
Browse files

MDL-44711 block_navigation: fixed typo in behat tests

  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed May 20, 2014
1 parent d4a84d8 commit 5d946b7458810cb5532b438aa8e5ecab66120b47
Showing with 8 additions and 6 deletions.
  1. +1 −2 blocks/navigation/tests/behat/view_my_courses.feature
  2. +7 −4 lib/tests/behat/behat_navigation.php
@@ -92,8 +92,7 @@ Feature: View my courses in navigation block
And I expand "cat1" node
And I should see "c1" in the "Navigation" "block"
And I expand "c1" node
Then I should not see "
And I should see "cat1" in the "Navigation" "block"
Then I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should see "cat31" in the "Navigation" "block"
@@ -64,7 +64,7 @@ protected function get_node_text_node($text, $branch = false, $collapsed = null,
$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']";
$notcollapsed = "[not(contains(concat(' ', normalize-space(@class), ' '), ' collapsed '))]";
$notcollapsed = "li[not(contains(concat(' ', normalize-space(@class), ' '), ' collapsed '))]";
$match = "[normalize-space(.)={$nodetextliteral}]";
// Avoid problems with quotes.
@@ -77,11 +77,14 @@ protected function get_node_text_node($text, $branch = false, $collapsed = null,
$iscollapsed = 'li';
}
$xpath = "//ul{$hasblocktree}//li{$notcollapsed}/ul/{$iscollapsed}/p{$isbranch}/a{$match}|";
$xpath .= "//ul{$hasblocktree}//li{$notcollapsed}/ul/{$iscollapsed}/p{$isbranch}/span{$match}";
// First check root nodes.
$xpath = "//ul{$hasblocktree}/$hascollapsed/p{$isbranch}/span{$match}|";
// Next search for the node containing the text within a link.
$xpath .= "//ul{$hasblocktree}//{$notcollapsed}/ul/{$iscollapsed}/p{$isbranch}/a{$match}|";
// Finally search for the node containing the text within a span.
$xpath .= "//ul{$hasblocktree}//{$notcollapsed}/ul/{$iscollapsed}/p{$isbranch}/span{$match}";
$node = $this->find('xpath', $xpath, $exception);
$this->ensure_node_is_visible($node);
return $node;
}

0 comments on commit 5d946b7

Please sign in to comment.
You can’t perform that action at this time.