9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
12 use Magento\Catalog\Test\Page\Product\CatalogProductView;
13 use Magento\Mtf\Fixture\InjectableFixture;
15 use Magento\Checkout\Test\Page\CheckoutCart;
32 public function processAssert(
34 CatalogCategoryView $catalogCategoryView,
35 CatalogProductView $catalogProductView,
41 $cmsIndex->getTopmenu()->selectCategoryByName(
$product->getCategoryIds()[0]);
42 $catalogCategoryView->getListProductBlock()->getProductItem(
$product)->open();
44 if (
$product->hasData(
'checkout_data') ||
$product->getMsrpDisplayActualPriceType() ===
'In Cart') {
45 $catalogProductView->getViewBlock()->addToCart(
$product);
47 $catalogProductView->getMsrpViewBlock()->openMapBlock();
48 $catalogProductView->getMsrpViewBlock()->getMapBlock()->addToCart();
50 $catalogProductView->getMessagesBlock()->waitSuccessMessage();
52 $checkoutCart->open();
54 $priceData =
$product->getDataFieldConfig(
'price')[
'source']->getPriceData();
55 $productPrice = isset($priceData[
'category_price']) ? $priceData[
'category_price'] :
$product->getPrice();
56 $unitPrice = $checkoutCart->getCartBlock()->getCartItem(
$product)->getPrice();
57 \PHPUnit\Framework\Assert::assertEquals($productPrice, $unitPrice,
'Incorrect unit price is displayed in Cart');
67 return "Displayed Product MAP data in Shopping Cart is correct.";