Skip to content

Commit dbc2b5d

Browse files
committed
Merge branch 'MAGETWO-90968' into MPI-PR
2 parents f42d8b3 + c77653d commit dbc2b5d

File tree

4 files changed

+10
-34
lines changed

4 files changed

+10
-34
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function getItemProductBlock($productSku)
5151
*/
5252
public function clickUpdateQty()
5353
{
54-
$this->_rootElement->find($this->updateQty)->click();
54+
$button = $this->_rootElement->find($this->updateQty);
55+
if (!$button->isDisabled()) {
56+
$button->click();
57+
}
5558
}
5659
}

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Totals.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public function getAdjustmentFeeElement()
123123
*/
124124
public function clickUpdateTotals()
125125
{
126-
$this->_rootElement->find($this->updateTotalsSelector)->click();
126+
$button = $this->_rootElement->find($this->updateTotalsSelector);
127+
if (!$button->isDisabled()) {
128+
$button->click();
129+
}
127130
}
128131
}

dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderI
3030
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
3131
\PHPUnit_Framework_Assert::assertFalse(
3232
$salesOrderView->getPageActions()->isActionButtonVisible('Credit Memo'),
33-
'Credit memo button is present on order view page.'
33+
'Credit memo button should not be present on order view page.'
3434
);
3535
}
3636

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,8 @@ public function run()
9696
$this->orderCreditMemoNew->getFormBlock()->updateQty();
9797
}
9898

99-
$hasChangeTotals = $this->compareRefundTotalsData($refundData);
10099
$this->orderCreditMemoNew->getFormBlock()->fillFormData($refundData);
101-
if ($hasChangeTotals) {
102-
$this->orderCreditMemoNew->getTotalsBlock()->clickUpdateTotals();
103-
}
100+
$this->orderCreditMemoNew->getTotalsBlock()->clickUpdateTotals();
104101

105102
$this->orderCreditMemoNew->getFormBlock()->submit();
106103
}
@@ -121,31 +118,4 @@ protected function getCreditMemoIds()
121118
$this->salesOrderView->getOrderForm()->openTab('creditmemos');
122119
return $this->salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock()->getIds();
123120
}
124-
125-
/**
126-
* Compare refund total items.
127-
*
128-
* @param array $data
129-
* @return int
130-
*/
131-
private function compareRefundTotalsData($data)
132-
{
133-
$compareData = [
134-
'shipping_amount' =>
135-
$this->orderCreditMemoNew->getTotalsBlock()->getRefundShippingElement()->getValue(),
136-
'adjustment_positive' =>
137-
$this->orderCreditMemoNew->getTotalsBlock()->getAdjustmentRefundElement()->getValue(),
138-
'adjustment_negative' =>
139-
$this->orderCreditMemoNew->getTotalsBlock()->getAdjustmentFeeElement()->getValue(),
140-
];
141-
142-
$count = 0;
143-
foreach ($compareData as $key => $val) {
144-
if (isset($data['form_data'][$key])) {
145-
$count += ($val != $data['form_data'][$key] ? 1 : 0);
146-
}
147-
}
148-
149-
return $count;
150-
}
151121
}

0 commit comments

Comments
 (0)