mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch '44711-28-r2' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
be38640dfa
@ -89,8 +89,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"
|
||||
@ -99,4 +98,4 @@ Feature: View my courses in navigation block
|
||||
And I should see "c1" in the "Navigation" "block"
|
||||
And I should not see "c2" in the "Navigation" "block"
|
||||
And I should see "c31" in the "Navigation" "block"
|
||||
And I should not see "c32" in the "Navigation" "block"
|
||||
And I should not see "c32" in the "Navigation" "block"
|
||||
|
@ -64,7 +64,7 @@ class behat_navigation extends behat_base {
|
||||
$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,8 +77,12 @@ class behat_navigation extends behat_base {
|
||||
$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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user