Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,17 @@ public function waitForPageLoad($timeout = null)

$this->waitForJS('return document.readyState == "complete"', $timeout);
$this->waitForAjaxLoad($timeout);
$this->waitForLoadingMaskToDisappear();
$this->waitForLoadingMaskToDisappear($timeout);
}

/**
* Wait for all visible loading masks to disappear. Gets all elements by mask selector, then loops over them.
*
* @param integer $timeout
* @throws \Exception
* @return void
*/
public function waitForLoadingMaskToDisappear()
public function waitForLoadingMaskToDisappear($timeout)
{
foreach (self::$loadingMasksLocators as $maskLocator) {
// Get count of elements found for looping.
Expand All @@ -385,7 +386,7 @@ public function waitForLoadingMaskToDisappear()
for ($i = 1; $i <= count($loadingMaskElements); $i++) {
// Formatting and looping on i as we can't interact elements returned above
// eg. (//div[@data-role="spinner"])[1]
$this->waitForElementNotVisible("({$maskLocator})[{$i}]", 30);
$this->waitForElementNotVisible("({$maskLocator})[{$i}]", $timeout);
}
}
}
Expand Down