MDL-49110 behat: Do not poll within spin for non-javascript mode

This commit is contained in:
Tony Levi
2015-02-06 13:06:44 +08:00
committed by Rajesh Taneja
parent 96dc38c46a
commit bd8926f9f3
+11 -4
View File
@@ -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);
}
}
}