Skip to content

Commit bdb8340

Browse files
authored
MQE-579: waitForLoadingMaskToDisappear fails sometimes when two loading masks match the same selector
- Added parenthesis according to the AC.
1 parent 5fcbc02 commit bdb8340

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ public function waitForPageLoad($timeout = 15)
204204
public function waitForLoadingMaskToDisappear()
205205
{
206206
foreach( self::$loadingMasksLocators as $maskLocator) {
207+
// Get count of elements found for looping.
208+
// Elements are NOT useful for interaction, as they cannot be fed to codeception actions.
207209
$loadingMaskElements = $this->_findElements($maskLocator);
208210
for ($i = 1; $i <= count($loadingMaskElements); $i++) {
209-
$this->waitForElementNotVisible("{$maskLocator}[{$i}]", 30);
211+
// Formatting and looping on i as we can't interact elements returned above
212+
// eg. (//div[@data-role="spinner"])[1]
213+
$this->waitForElementNotVisible("({$maskLocator})[{$i}]", 30);
210214
}
211215
}
212216
}

0 commit comments

Comments
 (0)