Skip to content

[MFTF] Refactoring MoveLastOrderedSimpleProductOnOrderPageTest #33688

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,20 @@
<?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="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup">
<annotations>
<description>Checks the last ordered product on the Customer Edit page</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
</arguments>

<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder(productName)}}" stepKey="addLastOrderedProductToOrder"/>
</actionGroup>
</actionGroups>
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="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup">
<annotations>
<description>Clicks Create Order Button on the Edit Customer Page</description>
</annotations>

<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
<waitForPageLoad stepKey="waitForPageLoaded"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup">
<annotations>
<description>Sees Product in the "Items Ordered" Grid on th Create Order page</description>
</annotations>
<arguments>
<argument name="rowIndex" type="string" defaultValue="1"/>
<argument name="columnName" type="string" defaultValue="Product"/>
<argument name="expectedValue" type="string"/>
</arguments>

<see selector="{{AdminCustomerCreateNewOrderSection.gridCell(rowIndex, columnName)}}" userInput="{{expectedValue}}" stepKey="seeProductAttribute"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,54 @@
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Login as admin -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!-- Create customer -->
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>

<!-- Create product -->
<createData entity="SimpleProduct2" stepKey="createProduct"/>

<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="CustomerOrderPaymentMethod" stepKey="submitOrder">
<requiredEntity createDataKey="createCustomerCart"/>
</updateData>
</before>
<after>
<!-- Delete created data -->
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/>
</after>

<!-- Create order -->
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
<argument name="product" value="$$createProduct$$"/>
<argument name="customer" value="$$createCustomer$$"/>
</actionGroup>

<!-- Search and open customer -->
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/>

<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
<argument name="customerId" value="$createCustomer.id$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/>

<!-- Click create order -->
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>

<!-- Select product in Last Ordered Items section -->
<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder($$createProduct.name$$)}}" stepKey="addProductToOrder"/>

<!-- Click Update Changes -->
<actionGroup ref="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/>

<actionGroup ref="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup" stepKey="addProductToOrder">
<argument name="productName" value="$$createProduct.name$$"/>
</actionGroup>

<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert product in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createProduct.price$$" stepKey="seeProductPrice"/>
<actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
<argument name="expectedValue" value="$$createProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
<argument name="columnName" value="Price"/>
<argument name="expectedValue" value="$$createProduct.price$$"/>
</actionGroup>

</test>
</tests>