-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[MFTF] Refactoring AdminCreateCreditMemoBankTransferPaymentTest #33671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnnaAPak
wants to merge
9
commits into
magento:2.4-develop
Choose a base branch
from
AnnaAPak:ref-AdminCreateCreditMemoBankTransferPaymentTest
base: 2.4-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
deceabb
refactored to decrease execution time
AnnaAPak 5144c2b
Merge branch '2.4-develop' into ref-AdminCancelTheCreatedOrderWithCas…
AnnaAPak eb02d6f
Merge branch 'ref-AdminCancelTheCreatedOrderWithCashOnDeliveryPayment…
AnnaAPak 7c7cdec
refactored AdminCreateCreditMemoBankTransferPaymentTest
AnnaAPak 84ad384
Merge branch '2.4-develop' into ref-AdminCreateCreditMemoBankTransfer…
AnnaAPak bbab545
Merge branch '2.4-develop' into ref-AdminCreateCreditMemoBankTransfer…
f527e04
Merge branch '2.4-develop' into ref-AdminCreateCreditMemoBankTransfer…
AnnaAPak 8cccec6
Merge branch 'ref-AdminCreateCreditMemoBankTransferPaymentTest' of gi…
AnnaAPak 07409ee
Merge branch '2.4-develop' into ref-AdminCreateCreditMemoBankTransfer…
AnnaAPak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreditMemoTabOnOrderViewPageActionGroup.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminClickCreditMemoTabOnOrderViewPageActionGroup"> | ||
<annotations> | ||
<description>Clicks Credit Memo Tab on the Order View page</description> | ||
</annotations> | ||
|
||
<click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemoTab"/> | ||
<waitForPageLoad stepKey="waitForTabLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
.../Sales/Test/Mftf/ActionGroup/AdminClickViewLinkOfLatestMemoOnCreditMemoTabActionGroup.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminClickViewLinkOfLatestMemoOnCreditMemoTabActionGroup"> | ||
<annotations> | ||
<description>Clicks the "View" link of latest Credit Memo in Grid on the Credit Memo Tab of the OrderView page</description> | ||
</annotations> | ||
|
||
<click selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="clickView"/> | ||
<waitForPageLoad stepKey="waitForCreditMemo"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithBankTransferPaymentTest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminCreateCreditMemoWithBankTransferPaymentTest"> | ||
<annotations> | ||
<stories value="Credit memo entity"/> | ||
<title value="Create Credit Memo with Payment=Bank Transfer"/> | ||
<description value="Create Credit Memo with Bank Transfer Payment and assert 0 shipping refund"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-15862"/> | ||
<group value="sales"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> | ||
|
||
<createData entity="Simple_US_Customer" stepKey="createCustomer"/> | ||
<createData entity="_defaultCategory" stepKey="createCategory"/> | ||
<createData entity="defaultSimpleProduct" stepKey="createProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<magentoCLI command="config:set {{enabledBankTransferPaymentOrder.label}} {{enabledBankTransferPaymentOrder.value}}" stepKey="enableBankTransfer"/> | ||
|
||
<createData entity="CustomerCart" stepKey="createCustomerCart"> | ||
<requiredEntity createDataKey="createCustomer"/> | ||
</createData> | ||
<createData entity="CustomerCartItem" stepKey="addCartItem"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
<requiredEntity createDataKey="createProduct"/> | ||
</createData> | ||
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</createData> | ||
<updateData createDataKey="createCustomerCart" entity="BankTransferPaymentMethod" stepKey="submitOrder"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</updateData> | ||
<createData entity="Invoice" stepKey="invoiceOrderOne"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</createData> | ||
</before> | ||
<after> | ||
<magentoCLI command="config:set {{disabledBankTransferPaymentOrder.label}} {{disabledBankTransferPaymentOrder.value}}" stepKey="disableBankTransfer"/> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminOpenOrderViewPageByOrderIdActionGroup" stepKey="openOrder"> | ||
<argument name="orderId" value="$createCustomerCart.return$"/> | ||
</actionGroup> | ||
|
||
<getData entity="GetOrderData" stepKey="getOrderData"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</getData> | ||
|
||
<actionGroup ref="AdminOpenAndFillCreditMemoRefundActionGroup" stepKey="fillCreditMemoRefund"> | ||
<argument name="itemQtyToRefund" value="1"/> | ||
<argument name="shippingRefund" value="0"/> | ||
<argument name="adjustmentRefund" value="5"/> | ||
<argument name="adjustmentFee" value="10"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminClickRefundOfflineOnNewMemoPageActionGroup" stepKey="clickRefundOffline"/> | ||
|
||
<see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the credit memo." stepKey="assertRefundSuccessCreateMessage"/> | ||
<dontSeeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="assertNoCreditMemoButton"/> | ||
|
||
<actionGroup ref="AdminClickCreditMemoTabOnOrderViewPageActionGroup" stepKey="clickCreditMemoTab"/> | ||
<grabTextFrom selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="grabMemoId"/> | ||
<assertNotEmpty stepKey="assertMemoIdIsNotEmpty" after="grabMemoId"> | ||
<actualResult type="const">$grabMemoId</actualResult> | ||
</assertNotEmpty> | ||
<actionGroup ref="AdminClickViewLinkOfLatestMemoOnCreditMemoTabActionGroup" stepKey="clickView"/> | ||
<see selector="{{AdminCreditMemoViewTotalSection.subtotal}}" userInput="$560.00" stepKey="seeSubtotal"/> | ||
<see selector="{{AdminCreditMemoViewTotalSection.adjustmentRefund}}" userInput="$5.00" stepKey="seeAdjustmentRefund"/> | ||
<see selector="{{AdminCreditMemoViewTotalSection.adjustmentFee}}" userInput="$10.00" stepKey="seeAdjustmentFee"/> | ||
<see selector="{{AdminCreditMemoViewTotalSection.grandTotal}}" userInput="$555.00" stepKey="assertRefundOnCreditMemoTab"/> | ||
<see userInput="$$createProduct.name$$" selector="{{AdminCreditMemoViewItemsSection.productName}}" stepKey="seeProductName"/> | ||
<see userInput="$$createProduct.price$$" selector="{{AdminCreditMemoViewItemsSection.productPrice}}" stepKey="seePricePerItem"/> | ||
<see userInput="1" selector="{{AdminCreditMemoViewItemsSection.productQty}}" stepKey="seeQty"/> | ||
|
||
<actionGroup ref="AdminAssertRefundInRefundsGridActionGroup" stepKey="assertRefund"> | ||
<argument name="orderId" value="$getOrderData.increment_id$"/> | ||
<argument name="memoId" value="{$grabMemoId}"/> | ||
<argument name="refundStatus" value="Refunded"/> | ||
<argument name="refundedTotal" value="$555.00"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> | ||
<argument name="Customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="onAccountPage"/> | ||
<actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/> | ||
<actionGroup ref="StorefrontClickRefundTabCustomerOrderViewActionGroup" stepKey="clickRefund"/> | ||
<see selector="{{StorefrontCustomerOrderSection.grandTotalRefund}}" userInput="555.00" stepKey="seeGrandTotal"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it can move to new ActionGroup |
||
</test> | ||
</tests> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can move to new ActionGroup