mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-69136 behat: Support find on a NodeElement
This commit is contained in:
parent
c11e2517a7
commit
3450387277
@ -119,6 +119,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user