mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-58948 behat: catch ElementNotFoundException
Another valid exception that can be thrown from a Mink driver is the ElementNotFoundException when an element has gone missing.
This commit is contained in:
parent
3cf0d01a61
commit
f5459099ae
2 changed files with 5 additions and 0 deletions
|
@ -114,6 +114,8 @@ class behat_form_field {
|
|||
// If the JS handler attached to keydown or keypress destroys the element
|
||||
// the later events may trigger errors because form element no longer exist
|
||||
// or is not visible. Ignore such exceptions here.
|
||||
} catch (\Behat\Mink\Exception\ElementNotFoundException $e) {
|
||||
// Other Mink drivers can throw this for the same reason as above.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -634,6 +634,9 @@ class behat_general extends behat_base {
|
|||
} catch (WebDriver\Exception\NoSuchElement $e) {
|
||||
// Do nothing just return, as element is no more on page.
|
||||
return true;
|
||||
} catch (ElementNotFoundException $e) {
|
||||
// Do nothing just return, as element is no more on page.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue