mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-67668 behat: Correct js pending check
Pending checks should only run when JS is running, but some uses were not apply this check.
This commit is contained in:
parent
621199b331
commit
a53c5b847e
1 changed files with 5 additions and 5 deletions
|
@ -848,11 +848,6 @@ EOF;
|
||||||
* @return bool Whether any JS is still pending completion.
|
* @return bool Whether any JS is still pending completion.
|
||||||
*/
|
*/
|
||||||
public function wait_for_pending_js() {
|
public function wait_for_pending_js() {
|
||||||
if (!$this->running_javascript()) {
|
|
||||||
// JS is not available therefore there is nothing to wait for.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return static::wait_for_pending_js_in_session($this->getSession());
|
return static::wait_for_pending_js_in_session($this->getSession());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,6 +858,11 @@ EOF;
|
||||||
* @return bool Whether any JS is still pending completion.
|
* @return bool Whether any JS is still pending completion.
|
||||||
*/
|
*/
|
||||||
public static function wait_for_pending_js_in_session(Session $session) {
|
public static function wait_for_pending_js_in_session(Session $session) {
|
||||||
|
if (!self::running_javascript_in_session($session)) {
|
||||||
|
// JS is not available therefore there is nothing to wait for.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// We don't use behat_base::spin() here as we don't want to end up with an exception
|
// We don't use behat_base::spin() here as we don't want to end up with an exception
|
||||||
// if the page & JSs don't finish loading properly.
|
// if the page & JSs don't finish loading properly.
|
||||||
for ($i = 0; $i < self::get_extended_timeout() * 10; $i++) {
|
for ($i = 0; $i < self::get_extended_timeout() * 10; $i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue