Skip to content

Commit adbf60f

Browse files
MAGETWO-59698: [FT] CreateWidgetEntityTestVariation4 fails to get element
1 parent 43904db commit adbf60f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Links/CompareLink.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class CompareLink extends Block
2020
*/
2121
protected $qtyCompareProducts = '.compare .counter.qty';
2222

23+
/**
24+
* Locator value for Compare Products link.
25+
*
26+
* @var string
27+
*/
28+
protected $linkCompareProducts = '[data-role="compare-products-link"] a.compare';
29+
2330
/**
2431
* Get qty of Products in Compare list.
2532
*
@@ -32,4 +39,14 @@ public function getQtyInCompareList()
3239
preg_match_all('/^\d+/', $compareProductLink->getText(), $matches);
3340
return $matches[0][0];
3441
}
42+
43+
/**
44+
* Wait for compare products link to appear
45+
*
46+
* @return void
47+
*/
48+
public function waitForCompareProductsLinks()
49+
{
50+
$this->waitForElementVisible($this->linkCompareProducts);
51+
}
3552
}

dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetRecentlyComparedProducts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ protected function addProducts(array $products)
118118
protected function removeCompareProducts()
119119
{
120120
$this->cmsIndex->open();
121+
$this->cmsIndex->getCompareLinkBlock()->waitForCompareProductsLinks();
121122
$this->cmsIndex->getLinksBlock()->openLink("Compare Products");
122123
$this->catalogProductCompare->getCompareProductsBlock()->removeAllProducts();
123124
}

0 commit comments

Comments
 (0)