File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed
app/code/Magento/Sales/Test/Mftf/ActionGroup
dev/tests/functional/tests/app/Magento/Sales/Test
Block/Adminhtml/Order/Creditmemo Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 43
43
</arguments >
44
44
<amOnPage url =" {{AdminOrderPage.url(orderId)}}" stepKey =" navigateToOrderPage" />
45
45
<click selector =" {{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey =" clickCreditMemo" />
46
+ <waitForElementVisible selector =" {{AdminHeaderSection.pageTitle}}" stepKey =" waitForPageTitle" />
46
47
<see selector =" {{AdminHeaderSection.pageTitle}}" userInput =" New Memo" stepKey =" seeNewMemoPageTitle" />
47
48
</actionGroup >
48
49
<actionGroup name =" SubmitCreditMemoActionGroup" >
49
50
<waitForElementVisible selector =" {{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey =" waitButtonEnabled" />
50
51
<click selector =" {{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey =" clickSubmitCreditMemo" />
51
52
<waitForElementVisible selector =" {{AdminMessagesSection.successMessage}}" stepKey =" waitForMessageAppears" />
52
53
<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" />
55
54
</actionGroup >
56
55
<actionGroup name =" UpdateCreditMemoTotalsActionGroup" >
57
56
<waitForElementVisible selector =" {{AdminCreditMemoTotalSection.updateTotals}}" stepKey =" waitUpdateTotalsButtonEnabled" />
58
57
<click selector =" {{AdminCreditMemoTotalSection.updateTotals}}" stepKey =" clickUpdateTotals" />
59
- <waitForLoadingMaskToDisappear stepKey =" waitForUpdateTotals" />
60
58
</actionGroup >
61
59
</actionGroups >
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class Totals extends \Magento\Sales\Test\Block\Adminhtml\Order\Totals
49
49
private $ adjustmentFeeSelector = '#adjustment_negative ' ;
50
50
51
51
/**
52
- * ' Update Totals button css selector.
52
+ * Update Totals button css selector.
53
53
*
54
54
* @var string
55
55
*/
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function run()
95
95
if ($ this ->compare ($ items , $ refundData )) {
96
96
$ this ->orderCreditMemoNew ->getFormBlock ()->updateQty ();
97
97
}
98
- $ hasChangeTotals = $ this ->compareRefundTotalsData ($ refundData );
98
+ $ hasChangeTotals = $ this ->isTotalsDataChanged ($ refundData );
99
99
$ this ->orderCreditMemoNew ->getFormBlock ()->fillFormData ($ refundData );
100
100
if ($ hasChangeTotals ) {
101
101
$ this ->orderCreditMemoNew ->getTotalsBlock ()->clickUpdateTotals ();
@@ -122,12 +122,12 @@ protected function getCreditMemoIds()
122
122
}
123
123
124
124
/**
125
- * Compare refund total items .
125
+ * Is totals data changed .
126
126
*
127
127
* @param array $data
128
- * @return int
128
+ * @return bool
129
129
*/
130
- private function compareRefundTotalsData (array $ data ): int
130
+ private function isTotalsDataChanged (array $ data ): bool
131
131
{
132
132
$ compareData = [
133
133
'shipping_amount ' =>
@@ -138,8 +138,8 @@ private function compareRefundTotalsData(array $data): int
138
138
$ this ->orderCreditMemoNew ->getTotalsBlock ()->getAdjustmentFeeElement ()->getValue (),
139
139
];
140
140
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 ]) {
143
143
return false ;
144
144
}
145
145
}
You can’t perform that action at this time.
0 commit comments