Skip to content

Commit 4a25d5e

Browse files
author
Volodymyr Kublytskyi
committed
Deliver magento-partners/magento2ce#26: Fixed UpdateSimpleProductEntityTestVariation14 FAT failure
1 parent fe3ffc5 commit 4a25d5e

File tree

1 file changed

+25
-1
lines changed
  • dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category

1 file changed

+25
-1
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ class View extends Block
2020
*
2121
* @var string
2222
*/
23-
protected $recentlyViewedProducts = './/*[contains(@class,"widget")]//strong[@class="product-item-name"]';
23+
protected $recentlyViewedProducts =
24+
'.//*[contains(@class,"block-viewed-products-grid")]//strong[@class="product-item-name"]';
25+
26+
/**
27+
* New Products selectors.
28+
*
29+
* @var string
30+
*/
31+
protected $newProducts = './/*[contains(@class,"block-new-products")]//strong[@class="product-item-name"]';
2432

2533
/**
2634
* Description CSS selector.
@@ -72,4 +80,20 @@ public function getProductsFromRecentlyViewedBlock()
7280
}
7381
return $products;
7482
}
83+
84+
/**
85+
* Get products from Catalog New Products List block.
86+
*
87+
* @return array
88+
*/
89+
public function getProductsFromCatalogNewProductsListBlock()
90+
{
91+
$products = [];
92+
$this->waitForElementVisible($this->newProducts, Locator::SELECTOR_XPATH);
93+
$productNames = $this->_rootElement->getElements($this->newProducts, Locator::SELECTOR_XPATH);
94+
foreach ($productNames as $productName) {
95+
$products[] = $productName->getText();
96+
}
97+
return $products;
98+
}
7599
}

0 commit comments

Comments
 (0)