mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'behat_goutte_nowait' of https://github.com/tlevi/moodle
This commit is contained in:
commit
8448af7d86
@ -302,6 +302,11 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
$loops = $timeout;
|
||||
}
|
||||
|
||||
// DOM will never change on non-javascript case; do not wait or try again.
|
||||
if (!$this->running_javascript()) {
|
||||
$loops = 1;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $loops; $i++) {
|
||||
// We catch the exception thrown by the step definition to execute it again.
|
||||
try {
|
||||
@ -320,10 +325,12 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($microsleep) {
|
||||
usleep(100000);
|
||||
} else {
|
||||
sleep(1);
|
||||
if ($this->running_javascript()) {
|
||||
if ($microsleep) {
|
||||
usleep(100000);
|
||||
} else {
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,10 @@ class behat_forms extends behat_base {
|
||||
* @return void
|
||||
*/
|
||||
protected function expand_all_fields() {
|
||||
// Expand only if JS mode, else not needed.
|
||||
if (!$this->running_javascript()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We already know that we waited for the DOM and the JS to be loaded, even the editor
|
||||
// so, we will use the reduced timeout as it is a common task and we should save time.
|
||||
|
Loading…
x
Reference in New Issue
Block a user