mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'wip-mdl-58056' of https://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
7ebe17f38a
2 changed files with 13 additions and 5 deletions
|
@ -241,8 +241,9 @@ class behat_forms extends behat_base {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function i_set_the_field_with_xpath_to($fieldxpath, $value) {
|
public function i_set_the_field_with_xpath_to($fieldxpath, $value) {
|
||||||
$fieldNode = $this->find('xpath', $fieldxpath);
|
$fieldnode = $this->find('xpath', $fieldxpath);
|
||||||
$field = behat_field_manager::get_form_field($fieldNode, $this->getSession());
|
$this->ensure_node_is_visible($fieldnode);
|
||||||
|
$field = behat_field_manager::get_form_field($fieldnode, $this->getSession());
|
||||||
$field->set_value($value);
|
$field->set_value($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -624,8 +624,16 @@ class behat_general extends behat_base {
|
||||||
function($context, $args) {
|
function($context, $args) {
|
||||||
|
|
||||||
foreach ($args['nodes'] as $node) {
|
foreach ($args['nodes'] as $node) {
|
||||||
|
// If element is removed from dom, then just exit.
|
||||||
|
try {
|
||||||
|
// If element is visible then throw exception, so we keep spinning.
|
||||||
if ($node->isVisible()) {
|
if ($node->isVisible()) {
|
||||||
throw new ExpectationException('"' . $args['text'] . '" text was found in the page', $context->getSession());
|
throw new ExpectationException('"' . $args['text'] . '" text was found in the page',
|
||||||
|
$context->getSession());
|
||||||
|
}
|
||||||
|
} catch (WebDriver\Exception\NoSuchElement $e) {
|
||||||
|
// Do nothing just return, as element is no more on page.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,7 +645,6 @@ class behat_general extends behat_base {
|
||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue