diff --git a/admin/tests/behat/behat_admin.php b/admin/tests/behat/behat_admin.php index b2fd07083cf..2d365c4f279 100644 --- a/admin/tests/behat/behat_admin.php +++ b/admin/tests/behat/behat_admin.php @@ -63,7 +63,7 @@ class behat_admin extends behat_base { $submitsearch = $this->find('css', 'form input[type=submit][name=search]'); $submitsearch->press(); - $this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); // Admin settings does not use the same DOM structure than other moodle forms // but we also need to use lib/behat/form_field/* to deal with the different moodle form elements. diff --git a/config-dist.php b/config-dist.php index baff6db15e7..9e570628bc8 100644 --- a/config-dist.php +++ b/config-dist.php @@ -813,6 +813,12 @@ $CFG->admin = 'admin'; // Example: // $CFG->behat_usedeprecated = true; // +// If you are using a slow machine, it may help to increase the timeouts that Behat uses. The +// following example will increase timeouts by a factor of 3 (using 30 seconds instead of 10 +// seconds, for instance). +// Example: +// $CFG->behat_increasetimeout = 3; +// // Including feature files from directories outside the dirroot is possible if required. The setting // requires that the running user has executable permissions on all parent directories in the paths. // Example: diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index ee06c76f9d7..1039cfa83c1 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -348,7 +348,7 @@ class behat_course extends behat_base { $showlink->click(); if ($this->running_javascript()) { - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); $this->i_wait_until_section_is_available($sectionnumber); } } @@ -382,7 +382,7 @@ class behat_course extends behat_base { ); if ($this->running_javascript()) { - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); $this->i_wait_until_section_is_available($sectionnumber); } } diff --git a/group/tests/behat/behat_groups.php b/group/tests/behat/behat_groups.php index e314e68efae..21a550989cf 100644 --- a/group/tests/behat/behat_groups.php +++ b/group/tests/behat/behat_groups.php @@ -67,13 +67,13 @@ class behat_groups extends behat_base { $script = "Syn.trigger('change', {}, {{ELEMENT}})"; $driver->triggerSynScript($select->getXpath(), $script); } - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); // Here we don't need to wait for the AJAX response. $this->find_button(get_string('adduserstogroup', 'group'))->click(); // Wait for add/remove members page to be loaded. - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); // Getting the option and selecting it. $select = $this->find_field('addselect'); @@ -86,7 +86,7 @@ class behat_groups extends behat_base { $this->find_button(get_string('add'))->click(); // Wait for the page to load. - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); // Returning to the main groups page. $this->find_button(get_string('backtogroups', 'group'))->click(); diff --git a/lib/behat/behat_base.php b/lib/behat/behat_base.php index cd8f0dc4d46..750251bb754 100644 --- a/lib/behat/behat_base.php +++ b/lib/behat/behat_base.php @@ -60,16 +60,28 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { * A reduced timeout for cases where self::TIMEOUT is too much * and a simple $this->getSession()->getPage()->find() could not * be enough. + * + * @deprecated since Moodle 3.7 MDL-64979 - please use get_reduced_timeout() instead + * @todo MDL-64982 This will be deleted in Moodle 4.1 + * @see behat_base::get_reduced_timeout() */ const REDUCED_TIMEOUT = 2; /** * The timeout for each Behat step (load page, wait for an element to load...). + * + * @deprecated since Moodle 3.7 MDL-64979 - please use get_timeout() instead + * @todo MDL-64982 This will be deleted in Moodle 4.1 + * @see behat_base::get_timeout() */ const TIMEOUT = 6; /** * And extended timeout for specific cases. + * + * @deprecated since Moodle 3.7 MDL-64979 - please use get_extended_timeout() instead + * @todo MDL-64982 This will be deleted in Moodle 4.1 + * @see behat_base::get_extended_timeout() */ const EXTENDED_TIMEOUT = 10; @@ -167,7 +179,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { // How much we will be waiting for the element to appear. if (!$timeout) { - $timeout = self::TIMEOUT; + $timeout = self::get_timeout(); $microsleep = false; } else { // Spinning each 0.1 seconds if the timeout was forced as we understand @@ -308,13 +320,13 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { // Using default timeout which is pretty high. if (!$timeout) { - $timeout = self::TIMEOUT; + $timeout = self::get_timeout(); } if ($microsleep) { - // Will sleep 1/10th of a second by default for self::TIMEOUT seconds. + // Will sleep 1/10th of a second by default for self::get_timeout() seconds. $loops = $timeout * 10; } else { - // Will sleep for self::TIMEOUT seconds. + // Will sleep for self::get_timeout() seconds. $loops = $timeout; } @@ -516,7 +528,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { return false; }, array('selector' => $selector, 'locator' => $locator), - self::EXTENDED_TIMEOUT, + self::get_extended_timeout(), $exception, true ); @@ -550,7 +562,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { return false; }, array('selector' => $selector, 'locator' => $locator), - self::EXTENDED_TIMEOUT, + self::get_extended_timeout(), $exception, true ); @@ -582,7 +594,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { return false; }, $node, - self::EXTENDED_TIMEOUT, + self::get_extended_timeout(), $exception, true ); @@ -617,7 +629,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { return false; }, array($node, $attribute, $attributevalue), - self::EXTENDED_TIMEOUT, + self::get_extended_timeout(), $exception, true ); @@ -755,7 +767,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { public static function wait_for_pending_js_in_session(Session $session) { // 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. - for ($i = 0; $i < self::EXTENDED_TIMEOUT * 10; $i++) { + for ($i = 0; $i < self::get_extended_timeout() * 10; $i++) { $pending = ''; try { $jscode = trim(preg_replace('/\s+/', ' ', ' @@ -796,11 +808,13 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { } // Timeout waiting for JS to complete. It will be caught and forwarded to behat_hooks::i_look_for_exceptions(). - // It is unlikely that Javascript code of a page or an AJAX request needs more than self::EXTENDED_TIMEOUT seconds + // It is unlikely that Javascript code of a page or an AJAX request needs more than get_extended_timeout() seconds // to be loaded, although when pages contains Javascript errors M.util.js_complete() can not be executed, so the // number of JS pending code and JS completed code will not match and we will reach this point. - throw new \Exception('Javascript code and/or AJAX requests are not ready after ' . self::EXTENDED_TIMEOUT . - ' seconds. There is a Javascript error or the code is extremely slow.'); + throw new \Exception('Javascript code and/or AJAX requests are not ready after ' . + self::get_extended_timeout() . + ' seconds. There is a Javascript error or the code is extremely slow. ' . + 'If you are using a slow machine, consider setting $CFG->behat_increasetimeout.'); } /** @@ -1029,4 +1043,54 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { $driver->click($xpath); } } + + /** + * Gets the required timeout in seconds. + * + * @param int $timeout One of the TIMEOUT constants + * @return int Actual timeout (in seconds) + */ + protected static function get_real_timeout(int $timeout) : int { + global $CFG; + if (!empty($CFG->behat_increasetimeout)) { + return $timeout * $CFG->behat_increasetimeout; + } else { + return $timeout; + } + } + + /** + * Gets the default timeout. + * + * The timeout for each Behat step (load page, wait for an element to load...). + * + * @return int Timeout in seconds + */ + public static function get_timeout() : int { + return self::get_real_timeout(6); + } + + /** + * Gets the reduced timeout. + * + * A reduced timeout for cases where self::get_timeout() is too much + * and a simple $this->getSession()->getPage()->find() could not + * be enough. + * + * @return int Timeout in seconds + */ + public static function get_reduced_timeout() : int { + return self::get_real_timeout(2); + } + + /** + * Gets the extended timeout. + * + * A longer timeout for cases where the normal timeout is not enough. + * + * @return int Timeout in seconds + */ + public static function get_extended_timeout() : int { + return self::get_real_timeout(10); + } } diff --git a/lib/behat/form_field/behat_form_filemanager.php b/lib/behat/form_field/behat_form_filemanager.php index c5025392eae..7d709496696 100644 --- a/lib/behat/form_field/behat_form_filemanager.php +++ b/lib/behat/form_field/behat_form_filemanager.php @@ -62,7 +62,7 @@ class behat_form_filemanager extends behat_form_field { public function get_value() { // Wait until DOM and JS is ready. - $this->session->wait(behat_base::TIMEOUT, behat_base::PAGE_READY_JS); + $this->session->wait(behat_base::get_timeout(), behat_base::PAGE_READY_JS); // Get the label to restrict the files to this single form field. $fieldlabel = $this->get_field_locator(); diff --git a/lib/behat/form_field/behat_form_passwordunmask.php b/lib/behat/form_field/behat_form_passwordunmask.php index aef507c02d1..43cf3720d5f 100644 --- a/lib/behat/form_field/behat_form_passwordunmask.php +++ b/lib/behat/form_field/behat_form_passwordunmask.php @@ -67,7 +67,7 @@ JS; $this->field->keyDown(13); $this->field->keyPress(13); $this->field->keyUp(13); - $this->session->wait(behat_base::TIMEOUT * 1000, behat_base::PAGE_READY_JS); + $this->session->wait(behat_base::get_timeout() * 1000, behat_base::PAGE_READY_JS); } } } diff --git a/lib/behat/form_field/behat_form_select.php b/lib/behat/form_field/behat_form_select.php index 279f52b47d5..071c0d40595 100644 --- a/lib/behat/form_field/behat_form_select.php +++ b/lib/behat/form_field/behat_form_select.php @@ -94,7 +94,7 @@ class behat_form_select extends behat_form_field { } } } - $this->session->wait(behat_base::TIMEOUT * 1000, behat_base::PAGE_READY_JS); + $this->session->wait(behat_base::get_timeout() * 1000, behat_base::PAGE_READY_JS); } } diff --git a/lib/tests/behat/behat_app.php b/lib/tests/behat/behat_app.php index 8a5b23813dc..fee3f56d903 100644 --- a/lib/tests/behat/behat_app.php +++ b/lib/tests/behat/behat_app.php @@ -307,7 +307,7 @@ class behat_app extends behat_base { return 'mainpage'; } throw new DriverException('Moodle app login URL prompt not found'); - }, self::EXTENDED_TIMEOUT, 30); + }, behat_base::get_extended_timeout(), 30); // If it's the login page, we automatically fill in the URL and leave it on the user/pass // page. If it's the main page, we just leave it there. diff --git a/lib/tests/behat/behat_forms.php b/lib/tests/behat/behat_forms.php index 9e7fc138a86..354cdb495a0 100644 --- a/lib/tests/behat/behat_forms.php +++ b/lib/tests/behat/behat_forms.php @@ -126,7 +126,7 @@ class behat_forms extends behat_base { "//a[contains(concat(' ', @class, ' '), ' fheader ') and @aria-expanded = 'false']"; $collapseexpandlink = $this->find('xpath', $expandallxpath . '|' . $expandonlysection, - false, false, self::REDUCED_TIMEOUT); + false, false, behat_base::get_reduced_timeout()); $collapseexpandlink->click(); } catch (ElementNotFoundException $e) { diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index 7adcfd9e1c8..e446e32f20c 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -174,7 +174,7 @@ class behat_general extends behat_base { return true; }, $iframename, - self::EXTENDED_TIMEOUT + behat_base::get_extended_timeout() ); } @@ -271,7 +271,7 @@ class behat_general extends behat_base { return; } - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); } /** @@ -604,10 +604,10 @@ class behat_general extends behat_base { "[count(descendant::*[contains(., $xpathliteral)]) = 0]"; // We should wait a while to ensure that the page is not still loading elements. - // Waiting less than self::TIMEOUT as we already waited for the DOM to be ready and + // Waiting less than self::get_timeout() as we already waited for the DOM to be ready and // all JS to be executed. try { - $nodes = $this->find_all('xpath', $xpath, false, false, self::REDUCED_TIMEOUT); + $nodes = $this->find_all('xpath', $xpath, false, false, self::get_reduced_timeout()); } catch (ElementNotFoundException $e) { // All ok. return; @@ -644,7 +644,7 @@ class behat_general extends behat_base { return true; }, array('nodes' => $nodes, 'text' => $text), - self::REDUCED_TIMEOUT, + behat_base::get_reduced_timeout(), false, true ); @@ -728,7 +728,7 @@ class behat_general extends behat_base { // We should wait a while to ensure that the page is not still loading elements. // Giving preference to the reliability of the results rather than to the performance. try { - $nodes = $this->find_all('xpath', $xpath, false, $container, self::REDUCED_TIMEOUT); + $nodes = $this->find_all('xpath', $xpath, false, $container, self::get_reduced_timeout()); } catch (ElementNotFoundException $e) { // All ok. return; @@ -754,7 +754,7 @@ class behat_general extends behat_base { return true; }, array('nodes' => $nodes, 'text' => $text, 'element' => $element), - self::REDUCED_TIMEOUT, + behat_base::get_reduced_timeout(), false, true ); @@ -932,7 +932,7 @@ class behat_general extends behat_base { return $context->getSession()->getPage()->findAll($args['selector'], $args['locator']); }, $params, - self::REDUCED_TIMEOUT, + behat_base::get_reduced_timeout(), $exception, false ); @@ -1124,7 +1124,7 @@ class behat_general extends behat_base { // Would be better to use a 1 second sleep because the element should not be there, // but we would need to duplicate the whole find_all() logic to do it, the benefit of // changing to 1 second sleep is not significant. - $this->find($selector, $locator, false, $containernode, self::REDUCED_TIMEOUT); + $this->find($selector, $locator, false, $containernode, behat_base::get_reduced_timeout()); } catch (ElementNotFoundException $e) { // It passes. return; @@ -1390,7 +1390,7 @@ class behat_general extends behat_base { return $this->download_file_from_link($link); }, array('link' => $link), - self::EXTENDED_TIMEOUT, + behat_base::get_extended_timeout(), $exception ); @@ -1433,7 +1433,7 @@ class behat_general extends behat_base { return $this->download_file_from_link($link); }, array('link' => $link), - self::EXTENDED_TIMEOUT, + behat_base::get_extended_timeout(), $exception ); diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index a869ea06548..68dcf9fecf1 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -555,13 +555,13 @@ class behat_hooks extends behat_base { * @AfterScenario @_switch_window */ public function after_scenario_switchwindow(AfterScenarioScope $scope) { - for ($count = 0; $count < self::EXTENDED_TIMEOUT; $count++) { + for ($count = 0; $count < behat_base::get_extended_timeout(); $count++) { try { $this->getSession()->restart(); break; } catch (DriverException $e) { // Wait for timeout and try again. - sleep(self::TIMEOUT); + sleep(self::get_timeout()); } } // If session is not restarted above then it will try to start session before next scenario diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index eeab30e3e7f..78c9262cdee 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -275,7 +275,7 @@ class behat_navigation extends behat_base { $jscondition = '(document.evaluate("' . $pnode->getXpath() . '", document, null, '. 'XPathResult.ANY_TYPE, null).iterateNext().getAttribute(\'data-loaded\') == "true")'; - $this->getSession()->wait(self::EXTENDED_TIMEOUT * 1000, $jscondition); + $this->getSession()->wait(behat_base::get_extended_timeout() * 1000, $jscondition); } } } diff --git a/lib/tests/behat/behat_permissions.php b/lib/tests/behat/behat_permissions.php index d4c4fb8ecd9..4cba909e320 100644 --- a/lib/tests/behat/behat_permissions.php +++ b/lib/tests/behat/behat_permissions.php @@ -105,7 +105,7 @@ class behat_permissions extends behat_base { $advancedtoggle->click(); // Wait for the page to load. - $this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); } } catch (Exception $e) { // We already are in advanced mode. diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 9f3bb180689..b7a649aea2c 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -19,6 +19,9 @@ attribute on forms to avoid collisions in forms loaded in AJAX requests. and all their settings moved to admin/message.php (see MDL-64495). Please use admin_page_managemessageoutputs class instead. * A new parameter $lang has been added to mustache_template_source_loader->load_with_dependencies() method so it is possible for Mustache to request string in a specific language. +* Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and REDUCED_TIMEOUT have been + deprecated. Please instead use the functions behat_base::get_timeout(), get_extended_timeout(), + and get_reduced_timeout(). These allow for timeouts to be increased by a setting in config.php. === 3.6 === diff --git a/mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php b/mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php index 276ada99c02..fb9f4b2960c 100644 --- a/mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php +++ b/mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php @@ -100,6 +100,6 @@ class behat_assignfeedback_editpdf extends behat_base { ]; $js = implode(' && ', $conditions); - $this->getSession()->wait(self::TIMEOUT * 1000, "({$js})"); + $this->getSession()->wait(self::get_timeout() * 1000, "({$js})"); } } diff --git a/mod/feedback/tests/behat/behat_mod_feedback.php b/mod/feedback/tests/behat/behat_mod_feedback.php index 17c0a65a92c..e95581de263 100644 --- a/mod/feedback/tests/behat/behat_mod_feedback.php +++ b/mod/feedback/tests/behat/behat_mod_feedback.php @@ -139,7 +139,7 @@ class behat_mod_feedback extends behat_base { return $behatgeneralcontext->download_file_from_link($link); }, array('link' => $link), - self::EXTENDED_TIMEOUT, + behat_base::get_extended_timeout(), $exception ); diff --git a/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php b/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php index a4d09645853..b69913b580f 100644 --- a/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php +++ b/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php @@ -72,7 +72,7 @@ class behat_workshopallocation_manual extends behat_base { $this->find('xpath', $xpathtd."/descendant::input[@value=$go]")->click(); } else { // With Javascript we just wait for the page to reload. - $this->getSession()->wait(self::EXTENDED_TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(behat_base::get_extended_timeout(), self::PAGE_READY_JS); } // Check the success string to appear. $allocatedtext = behat_context_helper::escape( diff --git a/repository/tests/behat/behat_filepicker.php b/repository/tests/behat/behat_filepicker.php index ce22d703541..368dcb49dab 100644 --- a/repository/tests/behat/behat_filepicker.php +++ b/repository/tests/behat/behat_filepicker.php @@ -294,7 +294,7 @@ class behat_filepicker extends behat_base { $selectfilebutton->click(); // We wait for all the JS to finish as it is performing an action. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); if ($overwriteaction !== false) { $overwritebutton = $this->find_button($overwriteaction); @@ -302,7 +302,7 @@ class behat_filepicker extends behat_base { $overwritebutton->click(); // We wait for all the JS to finish. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); } } diff --git a/repository/upload/tests/behat/behat_repository_upload.php b/repository/upload/tests/behat/behat_repository_upload.php index 6f90d82a5f2..a8d9bf827ee 100644 --- a/repository/upload/tests/behat/behat_repository_upload.php +++ b/repository/upload/tests/behat/behat_repository_upload.php @@ -161,7 +161,7 @@ class behat_repository_upload extends behat_base { $submit->press(); // We wait for all the JS to finish as it is performing an action. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); if ($overwriteaction !== false) { $overwritebutton = $this->find_button($overwriteaction); @@ -169,7 +169,7 @@ class behat_repository_upload extends behat_base { $overwritebutton->click(); // We wait for all the JS to finish. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); } } diff --git a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_admin.php b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_admin.php index 19419cef81c..4f385a68f21 100644 --- a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_admin.php +++ b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_admin.php @@ -52,7 +52,7 @@ class behat_theme_bootstrapbase_behat_admin extends behat_admin { // We expect admin block to be visible, otherwise go to homepage. if (!$this->getSession()->getPage()->find('css', '.block_settings')) { $this->getSession()->visit($this->locate_path('/')); - $this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); } // Search by label. @@ -61,7 +61,7 @@ class behat_theme_bootstrapbase_behat_admin extends behat_admin { $submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]'); $submitsearch->press(); - $this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + $this->wait(self::get_timeout() * 1000, self::PAGE_READY_JS); // Admin settings does not use the same DOM structure than other moodle forms // but we also need to use lib/behat/form_field/* to deal with the different moodle form elements. diff --git a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_filepicker.php b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_filepicker.php index 962db2d2ce8..70b5857e293 100644 --- a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_filepicker.php +++ b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_filepicker.php @@ -198,7 +198,7 @@ class behat_theme_bootstrapbase_behat_filepicker extends behat_filepicker { $selectfilebutton->click(); // We wait for all the JS to finish as it is performing an action. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); if ($overwriteaction !== false) { $overwritebutton = $this->find_button($overwriteaction); @@ -206,7 +206,7 @@ class behat_theme_bootstrapbase_behat_filepicker extends behat_filepicker { $overwritebutton->click(); // We wait for all the JS to finish. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); } } diff --git a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_repository_upload.php b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_repository_upload.php index cace980f26d..2c1181935de 100644 --- a/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_repository_upload.php +++ b/theme/bootstrapbase/tests/behat/behat_theme_bootstrapbase_behat_repository_upload.php @@ -99,7 +99,7 @@ class behat_theme_bootstrapbase_behat_repository_upload extends behat_repository $submit->press(); // We wait for all the JS to finish as it is performing an action. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); if ($overwriteaction !== false) { $overwritebutton = $this->find_button($overwriteaction); @@ -107,7 +107,7 @@ class behat_theme_bootstrapbase_behat_repository_upload extends behat_repository $overwritebutton->click(); // We wait for all the JS to finish. - $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + $this->getSession()->wait(self::get_timeout(), self::PAGE_READY_JS); } }