Skip to content

Commit 8387253

Browse files
committed
MC-17003: Update Totals button is missing from Credit Memo page
1 parent b6ecc10 commit 8387253

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@
4343
</arguments>
4444
<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="navigateToOrderPage"/>
4545
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/>
46+
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/>
4647
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/>
4748
</actionGroup>
4849
<actionGroup name="SubmitCreditMemoActionGroup">
4950
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/>
5051
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/>
5152
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForMessageAppears"/>
5253
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/>
53-
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
54-
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}$grabOrderId" stepKey="seeViewOrderPageCreditMemo"/>
5554
</actionGroup>
5655
<actionGroup name="UpdateCreditMemoTotalsActionGroup">
5756
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="waitUpdateTotalsButtonEnabled"/>
5857
<click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/>
59-
<waitForLoadingMaskToDisappear stepKey="waitForUpdateTotals"/>
6058
</actionGroup>
6159
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Totals extends \Magento\Sales\Test\Block\Adminhtml\Order\Totals
4949
private $adjustmentFeeSelector = '#adjustment_negative';
5050

5151
/**
52-
* 'Update Totals button css selector.
52+
* Update Totals button css selector.
5353
*
5454
* @var string
5555
*/

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function run()
9595
if ($this->compare($items, $refundData)) {
9696
$this->orderCreditMemoNew->getFormBlock()->updateQty();
9797
}
98-
$hasChangeTotals = $this->compareRefundTotalsData($refundData);
98+
$hasChangeTotals = $this->isTotalsDataChanged($refundData);
9999
$this->orderCreditMemoNew->getFormBlock()->fillFormData($refundData);
100100
if ($hasChangeTotals) {
101101
$this->orderCreditMemoNew->getTotalsBlock()->clickUpdateTotals();
@@ -122,12 +122,12 @@ protected function getCreditMemoIds()
122122
}
123123

124124
/**
125-
* Compare refund total items.
125+
* Is totals data changed.
126126
*
127127
* @param array $data
128-
* @return int
128+
* @return bool
129129
*/
130-
private function compareRefundTotalsData(array $data): int
130+
private function isTotalsDataChanged(array $data): bool
131131
{
132132
$compareData = [
133133
'shipping_amount' =>
@@ -138,8 +138,8 @@ private function compareRefundTotalsData(array $data): int
138138
$this->orderCreditMemoNew->getTotalsBlock()->getAdjustmentFeeElement()->getValue(),
139139
];
140140

141-
foreach ($compareData as $key => $val) {
142-
if (isset($data['form_data'][$key]) && $val != $data['form_data'][$key]) {
141+
foreach ($compareData as $fieldName => $fieldValue) {
142+
if (isset($data['form_data'][$fieldName]) && $fieldValue != $data['form_data'][$fieldName]) {
143143
return false;
144144
}
145145
}

0 commit comments

Comments
 (0)