10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
12 use Magento\Mtf\Fixture\FixtureInterface;
28 $priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem(
$product)->getPriceBlock();
29 $priceData =
$product->getDataFieldConfig(
'price')[
'source']->getPriceData();
30 $price = isset($priceData[
'category_price']) ? $priceData[
'category_price'] :
$product->getPrice();
31 \PHPUnit\Framework\Assert::assertEquals(
32 number_format(
$price, 2,
'.',
''),
33 $priceBlock->isOldPriceVisible() ? $priceBlock->getOldPrice() : $priceBlock->getPrice(),
34 'Product regular price on category page is not correct.' 37 if (
$product->hasData(
'special_price')) {
38 \PHPUnit\Framework\Assert::assertEquals(
39 number_format(
$product->getSpecialPrice(), 2,
'.',
''),
40 $priceBlock->getSpecialPrice(),
41 'Product special price on category page is not correct.' assertPrice(FixtureInterface $product, CatalogCategoryView $catalogCategoryView)