Skip to content

[MFTF] Refactoring of AdminCreateOrderAddProductCheckboxTest #31016

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup">
<annotations>
<description>Adds the provided Simple Product to an Order. Checks if checkbox is checked. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description>
</annotations>

<seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked" after="selectProduct"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AnnaAPak. Thank you for your work. Please, correct me if I'm wrong, but this action group is supposed to add a product to the order. But I see only the seeCheckboxIsChecked assertion in the action group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rogyar. Yes, it extends AddSimpleProductToOrderActionGroup - so both product adding and assertion are performed. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, missed the "extend" part. Thanks.


</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@
<argument name="customer" value="$$createSimpleCustomer$$"/>
</actionGroup>

<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="$$createSimpleProduct.sku$$" stepKey="fillSkuFilterBundle"/>
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/>
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
<seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked"/>

<actionGroup ref="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts">
<argument name="product" value="$createSimpleProduct$"/>
</actionGroup>

<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSkuFilterBundle"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchBundle"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToCheckColumn"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyProductChecked"/>

<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createSimpleCustomer" stepKey="deleteSimpleCustomer"/>
</after>
</test>
</tests>
</tests>