Skip to content

Commit 8bf4ffa

Browse files
committed
refactored CreateOrderFromEditCustomerPageTest
1 parent 2378ab2 commit 8bf4ffa

14 files changed

+379
-84
lines changed

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerCreateNewOrderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="productPrice" type="text" selector=".even td[class=col-price] span[class=price]"/>
1515
<element name="productQty" type="input" selector="td[class=col-qty] .input-text.item-qty.admin__control-text"/>
1616
<element name="gridCell" type="text" selector="//div[contains(@id, 'order-items_grid')]//tbody[{{row}}]//td[count(//table[contains(@class, 'order-tables')]//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true" timeout="30"/>
17+
<element name="itemsOrderedGridProductColumn" type="text" selector="//div[contains(@id, 'order-items_grid')]//span[contains(@id, 'title')]"/>
1718
</section>
1819
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductByNameInItemsOrderedGridOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Asserts a Product is present in the Items Ordered Grid on the Create Order page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<see selector="{{AdminCustomerCreateNewOrderSection.itemsOrderedGridProductColumn}}" userInput="{{product.name}}" stepKey="seeProductName"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductOnTheOrderViewPageActionGroup">
12+
<annotations>
13+
<description>Asserts Product Name and subtotal on the Order View Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="{{product.name}}" stepKey="seeProductInGrid"/>
20+
<see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="{{product.price}}" stepKey="seeProductSubtotal"/>
21+
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertTotalsOnOrderViewPageActionGroup">
12+
<annotations>
13+
<description>Asserts Totals on the Order View page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="subtotal" type="string"/>
17+
<argument name="shippingAndHandling" type="string"/>
18+
<argument name="grandTotal" type="string"/>
19+
</arguments>
20+
21+
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="{{subtotal}}" stepKey="checkSubtotal"/>
22+
<see selector="{{AdminOrderTotalSection.shippingAndHandling}}" userInput="{{shippingAndHandling}}" stepKey="checkShippingAndHandling"/>
23+
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="{{grandTotal}}" stepKey="checkGrandTotal"/>
24+
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickConfigureAndAddToOrderForConfigurableProductInWishListSectionOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Configure And Add To Order" button for a Configurable Product in the WishList Section on the Create Order Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
<argument name="productAttribute" type="entity"/>
18+
<argument name="option" type="entity"/>
19+
</arguments>
20+
21+
<waitForElementVisible selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder(product.name)}}" stepKey="seeConfigurableProductInWishList"/>
22+
<click selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder(product.name)}}" stepKey="addConfigurableProductToOrder"/>
23+
<waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(productAttribute.default_frontend_label)}}" stepKey="waitForConfigureProductPopup"/>
24+
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(productAttribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectConfigurableOption"/>
25+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/>
26+
<waitForLoadingMaskToDisappear stepKey="waitForPageIsUpdated"/>
27+
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickOrdersItemOnCustomerEditPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Orders" item on the Customer Edit page</description>
14+
</annotations>
15+
16+
<click selector="{{AdminEditCustomerInformationSection.orders}}" stepKey="clickOnOrdersButton"/>
17+
<waitForPageLoad stepKey="waitForOrderPageToOpen"/>
18+
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickUpdateItemsAndQuantitesOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Update Items and Quantites" button on Create Order page</description>
14+
</annotations>
15+
16+
<click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantites"/>
17+
<waitForPageLoad stepKey="waitForItemsAndQuantitesUpdating"/>
18+
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenOrderByIdFromOrdersGridOnCustomerEditPageActionGroup">
12+
<annotations>
13+
<description>Opens the Order View page from the Order Grid on the Customer Edit page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="orderId" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminEditCustomerOrdersSection.orderIdInGrid('$orderId')}}" stepKey="selectOrderById"/>
20+
<waitForPageLoad stepKey="waitForOrderPageToOpen"/>
21+
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSeeProductInWishlistOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Checks if a Product is in the WishList section on the Create Order Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="{{product.name}}" stepKey="seeProductInWishList"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSelectAddToOrderCheckboxForSimpleProductInWishListSectionOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Selects the "Add To Order" checkbox for a Simple Product in the WishList Section on the Create Order Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox(product.name)}}" stepKey="selectSimpleProductToAddToOrder"/>
20+
<waitForLoadingMaskToDisappear stepKey="waitForPageIsUpdated"/>
21+
22+
</actionGroup>
23+
</actionGroups>

0 commit comments

Comments
 (0)