-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[MFTF]: Refactoring of AdminCreateInvoiceTest #31009
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
Merged
magento-engcom-team
merged 10 commits into
magento:2.4-develop
from
AnnaAPak:ref-AdminCreateInvoiceTest
Jan 6, 2021
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9ffcdc6
refactoring of AdminCreateInvoiceTest
AnnaAPak 0c14e5f
refactored
AnnaAPak ea99547
wrap openOrder action with ActionGroup
AnnaAPak 3e46731
deprecating old test
AnnaAPak d157d42
AdminCreateInvoiceTest deprecated
AnnaAPak 3d5060f
update with 2.4-develop
AnnaAPak b23cad2
refactored
AnnaAPak 2d8be9c
refactored
AnnaAPak ce7a351
refactored
AnnaAPak 83dab7e
Merge branch '2.4-develop' into ref-AdminCreateInvoiceTest
engcom-Charlie 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
66 changes: 66 additions & 0 deletions
66
app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.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,66 @@ | ||
<?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="AdminInvoiceOrderTest"> | ||
<annotations> | ||
<features value="Sales"/> | ||
<stories value="Create an Invoice via the Admin"/> | ||
<title value="Admin should be able to create an invoice"/> | ||
<description value="Admin should be able to create an invoice"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MAGETWO-72096"/> | ||
<group value="sales"/> | ||
</annotations> | ||
|
||
<before> | ||
<createData entity="_defaultCategory" stepKey="createCategory"/> | ||
<createData entity="_defaultProduct" stepKey="createSimpleProductApi"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
<createData entity="GuestCart" stepKey="createGuestCart"/> | ||
<createData entity="SimpleCartItem" stepKey="addCartItem"> | ||
<requiredEntity createDataKey="createGuestCart"/> | ||
<requiredEntity createDataKey="createSimpleProductApi"/> | ||
</createData> | ||
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> | ||
<requiredEntity createDataKey="createGuestCart"/> | ||
</createData> | ||
<updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> | ||
<requiredEntity createDataKey="createGuestCart"/> | ||
</updateData> | ||
|
||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
|
||
</before> | ||
|
||
<after> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder"> | ||
<argument name="entityId" value="$createGuestCart.return$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/> | ||
|
||
<actionGroup ref="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" stepKey="filterInvoiceGridByOrderId"> | ||
<argument name="orderId" value="$createGuestCart.return$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/> | ||
|
||
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkIfOrderStatusIsProcessing"> | ||
<argument name="status" value="Processing"/> | ||
</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.
Ideally, we should remove all side effects created in the test. That means that it would be great to remove the
GuestCart
as well after the test, if possible.Thanks
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.
@rogyar, I suggest there is no need/possibility to delete
GuestCart
after the test - as we place the order during the test. In addition, there is nooperation
withtype="delete"
in the GuestCartMeta.xml - probably because of the same logic.Please, correct me if I'm mistaken.
Thanks.
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.
It's more or less what I was expecting. Just wanted to double-check, maybe we already have a routine for removing the quote.
Nevermind then, thank you for checking.