11
11
use Magento \Catalog \Test \Fixture \Category ;
12
12
use Magento \Catalog \Test \Page \Category \CatalogCategoryView ;
13
13
use Magento \Catalog \Test \Page \Product \CatalogProductView ;
14
+ use Magento \Cms \Test \Page \CmsIndex ;
14
15
use Magento \Mtf \Client \BrowserInterface ;
15
16
use Magento \Mtf \Constraint \AbstractConstraint ;
16
17
@@ -22,13 +23,15 @@ class AssertProductViewBreadcrumbsCategory extends AbstractConstraint
22
23
/**
23
24
* @param CatalogCategoryView $catalogCategoryView
24
25
* @param CatalogProductView $catalogProductView
26
+ * @param CmsIndex $cmsIndex
25
27
* @param BrowserInterface $browser
26
28
* @param CatalogProductSimple $product
27
29
* @return void
28
30
*/
29
31
public function processAssert (
30
32
CatalogCategoryView $ catalogCategoryView ,
31
33
CatalogProductView $ catalogProductView ,
34
+ CmsIndex $ cmsIndex ,
32
35
BrowserInterface $ browser ,
33
36
CatalogProductSimple $ product
34
37
) {
@@ -40,7 +43,8 @@ public function processAssert(
40
43
41
44
/** @var Category $category */
42
45
foreach ($ categories as $ category ) {
43
- $ browser ->open ($ _ENV ['app_frontend_url ' ] . $ category ->getUrlKey () . '.html ' );
46
+ $ cmsIndex ->open ();
47
+ $ cmsIndex ->getTopmenu ()->selectCategoryByName ($ category ->getName ());
44
48
45
49
$ productItem = $ catalogCategoryView ->getListProductBlock ()->getProductItem ($ product );
46
50
\PHPUnit_Framework_Assert::assertTrue (
0 commit comments