Skip to content

Commit bc67be5

Browse files
committed
Issue 35284: add mftf
1 parent f3920a9 commit bc67be5

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AddConfigurableProductToOrderPressKeyEnterActionGroup">
12+
<annotations>
13+
<description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product"/>
17+
<argument name="attribute"/>
18+
<argument name="option"/>
19+
<argument name="quantity" type="string"/>
20+
</arguments>
21+
22+
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
23+
<waitForElementVisible selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="waitForAddProductsButton"/>
24+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
25+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/>
26+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/>
27+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
28+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/>
29+
<waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/>
30+
<wait time="2" stepKey="waitForOptionsToLoad"/>
31+
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/>
32+
<fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
33+
<wait time="2" stepKey="waitForValidateOptions"/>
34+
<!--Press Key ENTER-->
35+
<pressKey selector="{{AdminOrderFormConfigureProductSection.quantity}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressKeyEnter"/>
36+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
37+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
38+
</actionGroup>
39+
</actionGroups>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCreateOrderWithConfigurableProductPressKeyEnterTest">
12+
<annotations>
13+
<title value="Create Order in Admin with configurable product"/>
14+
<stories value="AC-2040"/>
15+
<description value="Create order with configurable product."/>
16+
<features value="Sales"/>
17+
<testCaseId value="AC-2040"/>
18+
<severity value="MAJOR"/>
19+
<group value="Sales"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct">
25+
<argument name="product" value="_defaultProduct"/>
26+
<argument name="category" value="$$createCategory$$"/>
27+
</actionGroup>
28+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
29+
</before>
30+
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
31+
<argument name="customer" value="$$createCustomer$$"/>
32+
</actionGroup>
33+
<actionGroup ref="AddConfigurableProductToOrderPressKeyEnterActionGroup" stepKey="addFirstConfigurableProductToOrder">
34+
<argument name="product" value="_defaultProduct"/>
35+
<argument name="attribute" value="colorProductAttribute"/>
36+
<argument name="option" value="colorProductAttribute1"/>
37+
<argument name="quantity" value="1"/>
38+
</actionGroup>
39+
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>
40+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
41+
<actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/>
42+
<after>
43+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
44+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
45+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
46+
<argument name="sku" value="{{_defaultProduct.sku}}"/>
47+
</actionGroup>
48+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
49+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
50+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
51+
</after>
52+
53+
</test>
54+
</tests>

0 commit comments

Comments
 (0)