9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
11 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
12 use Magento\Sales\Test\Page\Adminhtml\OrderInvoiceNew;
13 use Magento\Sales\Test\Page\Adminhtml\OrderCreditMemoNew;
14 use Magento\Mtf\Fixture\InjectableFixture;
87 OrderIndex $orderIndex,
96 $orderIndex->getSalesOrderGrid()->openFirstRow();
102 $message =
'Prices on order view page should be equal to defined in dataset.';
103 \PHPUnit\Framework\Assert::assertEquals(
$prices, array_filter($actualPrices),
$message);
109 $message =
'Prices on invoice new page should be equal to defined in dataset.';
110 \PHPUnit\Framework\Assert::assertEquals(
$prices, array_filter($actualPrices),
$message);
116 $message =
'Prices on invoice page should be equal to defined in dataset.';
117 \PHPUnit\Framework\Assert::assertEquals(
$prices, array_filter($actualPrices),
$message);
123 $message =
'Prices on credit memo new page should be equal to defined in dataset.';
124 \PHPUnit\Framework\Assert::assertEquals(
125 array_diff_key(
$prices, [
'shipping_excl_tax' =>
null,
'shipping_incl_tax' =>
null]),
126 array_filter($actualPrices),
134 $message =
'Prices on credit memo page should be equal to defined in dataset.';
135 \PHPUnit\Framework\Assert::assertEquals(
$prices, array_filter($actualPrices),
$message);
148 'category_special_price',
149 'category_price_excl_tax',
150 'category_price_incl_tax',
151 'product_view_price',
152 'product_view_special_price',
153 'product_view_price_excl_tax',
154 'product_view_price_incl_tax' 156 foreach ($deletePrices as $key) {
157 if (array_key_exists($key,
$prices)) {
174 $viewBlock = $this->salesOrderView->getItemsOrderedBlock();
175 $actualPrices[
'cart_item_price_excl_tax'] = $viewBlock->getItemPriceExclTax(
$product->getName());
176 $actualPrices[
'cart_item_price_incl_tax'] = $viewBlock->getItemPriceInclTax(
$product->getName());
177 $actualPrices[
'cart_item_subtotal_excl_tax'] = $viewBlock->getItemSubExclTax(
$product->getName());
178 $actualPrices[
'cart_item_subtotal_incl_tax'] = $viewBlock->getItemSubInclTax(
$product->getName());
179 return $actualPrices;
191 $productBlock = $this->orderInvoiceNew->getFormBlock()->getItemsBlock()->getItemProductBlock(
$product);
192 $actualPrices[
'cart_item_price_excl_tax'] = $productBlock->getItemPriceExclTax();
193 $actualPrices[
'cart_item_price_incl_tax'] = $productBlock->getItemPriceInclTax();
194 $actualPrices[
'cart_item_subtotal_excl_tax'] = $productBlock->getItemSubExclTax();
195 $actualPrices[
'cart_item_subtotal_incl_tax'] = $productBlock->getItemSubInclTax();
196 return $actualPrices;
208 $productBlock = $this->orderCreditMemoNew->getFormBlock()->getItemsBlock()->getItemProductBlock(
$product);
209 $actualPrices[
'cart_item_price_excl_tax'] = $productBlock->getItemPriceExclTax();
210 $actualPrices[
'cart_item_price_incl_tax'] = $productBlock->getItemPriceInclTax();
211 $actualPrices[
'cart_item_subtotal_excl_tax'] = $productBlock->getItemSubExclTax();
212 $actualPrices[
'cart_item_subtotal_incl_tax'] = $productBlock->getItemSubInclTax();
213 return $actualPrices;
223 return 'Prices on backend after order creation is correct.';
getOrderTotals($actualPrices)
getInvoiceNewPrices($actualPrices, InjectableFixture $product)
getInvoiceNewTotals($actualPrices)
getCreditMemoNewTotals($actualPrices)
getOrderPrices($actualPrices, InjectableFixture $product)
processAssert(array $prices, InjectableFixture $product, OrderIndex $orderIndex, SalesOrderView $salesOrderView, OrderInvoiceNew $orderInvoiceNew, OrderCreditMemoNew $orderCreditMemoNew)
getCreditMemoNewPrices($actualPrices, InjectableFixture $product)