Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Swatches
Test
Constraint
AssertSwatchesAreVisibleOnCategoryPage.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Swatches\Test\Constraint
;
7
8
use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
9
use Magento\Cms\Test\Page\CmsIndex;
10
use Magento\Mtf\Constraint\AbstractConstraint;
11
use Magento\Mtf\Fixture\FixtureInterface;
12
16
class
AssertSwatchesAreVisibleOnCategoryPage
extends
AbstractConstraint
17
{
24
public
function
processAssert
(
25
CatalogCategoryView $catalogCategoryView,
26
CmsIndex $cmsIndex,
27
FixtureInterface
$product
28
) {
29
$this->openCategoryPage($cmsIndex,
$product
);
30
31
$isSwatchesBlockVisible = $catalogCategoryView->getListSwatchesProductBlock()
32
->getProductItem(
$product
)->isSwatchesBlockVisible();
33
34
\PHPUnit\Framework\Assert::assertTrue(
35
$isSwatchesBlockVisible,
36
'Swatches are absent on category page.'
37
);
38
}
39
47
private
function
openCategoryPage(
48
CmsIndex $cmsIndex,
49
FixtureInterface
$product
50
) {
51
$categoryIds =
$product
->getCategoryIds();
52
$categoryName = reset($categoryIds);
53
$cmsIndex->open();
54
$cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
55
}
56
62
public
function
toString
()
63
{
64
return
'Swatches visibility is correct.'
;
65
}
66
}
Magento\Swatches\Test\Constraint
Definition:
AssertProductPriceWithSelectedSwatchOnCategoryPage.php:6
Magento\Swatches\Test\Constraint\AssertSwatchesAreVisibleOnCategoryPage\processAssert
processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, FixtureInterface $product)
Definition:
AssertSwatchesAreVisibleOnCategoryPage.php:24
Magento\Swatches\Test\Constraint\AssertSwatchesAreVisibleOnCategoryPage\toString
toString()
Definition:
AssertSwatchesAreVisibleOnCategoryPage.php:62
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Swatches\Test\Constraint\AssertSwatchesAreVisibleOnCategoryPage
Definition:
AssertSwatchesAreVisibleOnCategoryPage.php:16