Skip to content

MQE-1142: Use timeout value when waitForLoadingMaskToDisappear #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2018
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