Skip to content

Commit c57f9e0

Browse files
committed
MQE-592: Audit Test Cases on Firefox/Chrome on Windows/OSX
- add changes for MagentoWebDriver wait and pageload timeout settings
1 parent 8c36bce commit c57f9e0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Codeception\Exception\ModuleException;
1818
use Codeception\Util\Uri;
1919
use Codeception\Util\ActionSequence;
20+
use Magento\Setup\Exception;
2021
use Yandex\Allure\Adapter\Support\AttachmentSupport;
2122

2223
/**
@@ -270,9 +271,16 @@ public function searchAndMultiSelectOption($select, array $options, $requireActi
270271
*
271272
* @param int $timeout
272273
*/
273-
public function waitForAjaxLoad($timeout = 15)
274+
public function waitForAjaxLoad($timeout = null)
274275
{
275-
$this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout);
276+
$timeout = $timeout ?? $this->_getConfig()['pageload_timeout'];
277+
278+
try {
279+
$this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout);
280+
} catch (\Exception $exceptione) {
281+
$this->debug("js never executed, performing {$timeout} second wait.");
282+
$this->wait($timeout);
283+
}
276284
$this->wait(1);
277285
}
278286

@@ -281,8 +289,10 @@ public function waitForAjaxLoad($timeout = 15)
281289
*
282290
* @param int $timeout
283291
*/
284-
public function waitForPageLoad($timeout = 15)
292+
public function waitForPageLoad($timeout = null)
285293
{
294+
$timeout = $timeout ?? $this->_getConfig()['pageload_timeout'];
295+
286296
$this->waitForJS('return document.readyState == "complete"', $timeout);
287297
$this->waitForAjaxLoad($timeout);
288298
$this->waitForLoadingMaskToDisappear();
@@ -350,7 +360,7 @@ public function parseFloat($floatString){
350360
/**
351361
* @param int $category
352362
* @param string $locale
353-
*/
363+
*/
354364
public function mSetLocale(int $category, $locale)
355365
{
356366
if (self::$localeAll[$category] == $locale) {

0 commit comments

Comments
 (0)