File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,15 @@ class View extends Block
20
20
*
21
21
* @var string
22
22
*/
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"] ' ;
24
32
25
33
/**
26
34
* Description CSS selector.
@@ -72,4 +80,20 @@ public function getProductsFromRecentlyViewedBlock()
72
80
}
73
81
return $ products ;
74
82
}
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
+ }
75
99
}
You can’t perform that action at this time.
0 commit comments