11 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
13 use Magento\Mtf\Fixture\FixtureInterface;
27 protected function assertPrice(FixtureInterface $bundle, CatalogCategoryView $catalogCategoryView)
30 $priceData = $bundle->getDataFieldConfig(
'price')[
'source']->getPriceData();
32 $priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem($bundle)->getPriceBlock();
34 if ($bundle->hasData(
'special_price')) {
35 $priceLow = $priceBlock->getPrice();
37 $priceLow = ($bundle->getPriceView() ==
'Price Range')
38 ? $priceBlock->getPriceFrom()
39 : $priceBlock->getPrice();
42 \PHPUnit\Framework\Assert::assertEquals(
43 $priceData[
'price_from'],
45 'Bundle price From on category page is not correct.' 47 if ($bundle->getPriceView() ==
'Price Range') {
48 \PHPUnit\Framework\Assert::assertEquals(
49 $priceData[
'price_to'],
50 $priceBlock->getPriceTo(),
51 'Bundle price To on category page is not correct.' 63 return 'Bundle price on category page is not correct.';
assertPrice(FixtureInterface $product, CatalogCategoryView $catalogCategoryView)