9 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
11 use Magento\Checkout\Test\Page\CheckoutCart;
12 use Magento\Cms\Test\Page\CmsIndex;
13 use Magento\Customer\Test\Fixture\Address;
14 use Magento\Mtf\Constraint\AbstractConstraint;
15 use Magento\Mtf\Fixture\FixtureFactory;
16 use Magento\Mtf\Fixture\FixtureInterface;
17 use Magento\Mtf\Fixture\InjectableFixture;
84 abstract protected function getTotals($actualPrices);
107 FixtureFactory $fixtureFactory
114 $address = $fixtureFactory->createByCode(
'address', [
'dataset' =>
'US_address_NY']);
115 $shipping = [
'shipping_service' =>
'Flat Rate',
'shipping_method' =>
'Fixed'];
118 $productCategory =
$product->getCategoryIds()[0];
126 $this->checkoutCart->open();
128 $actualPrices = $this->
getCartPrices($product, $actualPrices);
129 $actualPrices = $this->
getTotals($actualPrices);
131 $message =
'Prices from dataset should be equal to prices on frontend.';
132 \PHPUnit\Framework\Assert::assertEquals(
$prices, $actualPrices,
$message);
143 $this->cmsIndex->open();
144 $this->cmsIndex->getTopmenu()->selectCategoryByName($productCategory);
156 $actualPrices[
'cart_item_price_excl_tax'] =
157 $this->checkoutCart->getCartBlock()->getCartItem(
$product)->getPriceExclTax();
158 $actualPrices[
'cart_item_price_incl_tax'] =
159 $this->checkoutCart->getCartBlock()->getCartItem(
$product)->getPriceInclTax();
160 $actualPrices[
'cart_item_subtotal_excl_tax'] =
161 $this->checkoutCart->getCartBlock()->getCartItem(
$product)->getSubtotalPriceExclTax();
162 $actualPrices[
'cart_item_subtotal_incl_tax'] =
163 $this->checkoutCart->getCartBlock()->getCartItem(
$product)->getSubtotalPriceInclTax();
165 return $actualPrices;
177 $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax(
$address);
178 $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping);
188 return 'Prices on front is correct.';
openCategory($productCategory)
processAssert(InjectableFixture $product, array $prices, $qty, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, FixtureFactory $fixtureFactory)
getProductPagePrices($actualPrices)
fillEstimateBlock(Address $address, $shipping)
getCartPrices(InjectableFixture $product, $actualPrices)
getCategoryPrices(FixtureInterface $product, $actualPrices)