9 use Magento\CatalogSearch\Test\Page\CatalogsearchResult;
10 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Mtf\Fixture\FixtureInterface;
48 CatalogsearchResult $catalogSearchResult,
54 $cmsIndex->getSearchBlock()->search($sku);
56 $quantityAndStockStatus =
$product->getQuantityAndStockStatus();
57 $stockStatus = isset($quantityAndStockStatus[
'is_in_stock'])
58 ? $quantityAndStockStatus[
'is_in_stock']
61 $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem(
$product)->isVisible();
62 while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
63 $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem(
$product)->isVisible();
66 if (
$product->getVisibility() ===
'Catalog' || $stockStatus ===
'Out of Stock') {
67 $isVisible = !$isVisible;
71 \PHPUnit\Framework\Assert::assertTrue(
processAssert(CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, FixtureInterface $product)