Merge branch 'MDL-69136-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE

This commit is contained in:
Jake Dallimore
2020-07-06 10:45:48 +08:00
2 changed files with 9 additions and 4 deletions
+5
View File
@@ -107,6 +107,11 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
* @return NodeElement
*/
protected function find($selector, $locator, $exception = false, $node = false, $timeout = false) {
if ($selector === 'NodeElement' && is_a($locator, NodeElement::class)) {
// Support a NodeElement being passed in for use in step chaining.
return $locator;
}
// Returns the first match.
$items = $this->find_all($selector, $locator, $exception, $node, $timeout);
return count($items) ? reset($items) : null;
+4 -4
View File
@@ -193,7 +193,7 @@ class behat_navigation extends behat_base {
// We just want to expand the node, we don't want to follow it.
$node = $node->getParent();
}
$node->click();
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
}
/**
@@ -217,7 +217,7 @@ class behat_navigation extends behat_base {
// We just want to expand the node, we don't want to follow it.
$node = $node->getParent();
}
$node->click();
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
}
/**
@@ -267,7 +267,7 @@ class behat_navigation extends behat_base {
// don't wait, it is non-JS and we already waited for the DOM.
$siteadminlink = $this->getSession()->getPage()->find('named_exact', array('link', "'" . $siteadminstr . "'"));
if ($siteadminlink) {
$siteadminlink->click();
$this->execute('behat_general::i_click_on', [$siteadminlink, 'NodeElement']);
}
}
}
@@ -325,7 +325,7 @@ class behat_navigation extends behat_base {
implode($parentnodes, ' > ') . '"', $this->getSession());
}
$nodetoclick->click();
$this->execute('behat_general::i_click_on', [$nodetoclick, 'NodeElement']);
}
/**