-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[MFTF] Cancel created orders after checks on frontend #27698
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
[MFTF] Cancel created orders after checks on frontend #27698
Conversation
Hi @elevinskii. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
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.
Could you - by the way - extract the Tests to separate files? (There are 2 tests in the same file)
--- EDIT ---
I see that you used outdated 2.4-develop
, that's why you have 2 tests in same file. Now these tests were isolated.
<!--Cancel orders--> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> | ||
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="goToOrdersPage"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitAfterClearFilters"/> |
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.
If there's no such action - you can add it to AdminOrdersGridClearFiltersActionGroup
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.
That's done - I've added wait action in the end of AdminOrdersGridClearFiltersActionGroup
and did small refactoring for tests where this action group is used.
# Conflicts: # app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml
Sorry, overlooked that. Now the branch is updated. |
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.
✔️ Thank you for your contribution
<!--Cancel orders--> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> | ||
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="goToOrdersPage"/> | ||
<actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn"> | ||
<argument name="columnLabel" value="Customer Email"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterOrdersByCustomerEmail"> | ||
<argument name="filterInputName" value="customer_email"/> | ||
<argument name="filterValue" value="{{CustomerEntityOne.email}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyFilters"/> | ||
<actionGroup ref="AdminGridBulkActionGroup" stepKey="cancelOrders"> | ||
<argument name="actionLabel" value="Cancel"/> | ||
</actionGroup> |
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.
Awesome! Perfect test example ❗
Hi @lbajsarowicz, thank you for the review.
|
@magento run all tests |
… mftf-checkout-cancel-orders
@magento run all tests |
… mftf-checkout-cancel-orders � Conflicts: � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersReleasePendingOrderTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml � app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml
@magento run all tests |
@magento run all tests |
@elevinskii please, take a look at failed test |
Hi @elevinskii. Please, take a look at a failed tests. Can you fix them? |
The risk was set to |
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.
✔️ Looks correct for me.
Hi @lbajsarowicz, thank you for the review. |
QA not applicable |
Hi @elevinskii, thank you for your contribution! |
Description
According to the isolation guidelines of Magento Functional Test Framework, all data created during tests have to be deleted. As we can't delete created orders - there's no way to delete an order neither via backend or webapi - I suppose it'd be an good idea to cancel them.
https://devdocs.magento.com/mftf/docs/guides/test-isolation.html
Updated
CheckCheckoutSuccessPageAsRegisterCustomerTest
andCheckCheckoutSuccessPageAsGuestTest
after blocks, to cancel all orders which have been created in these tests.New Action Groups
AdminGridBulkActionGroup
- massive action for all rows on Admin Grid pageAdminGridColumnShowActionGroup
- shows new column on Admin Grid pageQuestions or comments
I spent so much time, trying to cancel orders by ids via webapi - but still don't know how to do that in MFTF. If someone has any thoughts or ideas - they'd be appreciated.
Resolved issues: