Skip to content

Commit be413cd

Browse files
committed
MQE-1267: MSI MFTF Test Cases 4
- Adding necessary Action Groups, Sections and Data to the Bundle, GroupedProduct, Sales and Store modules. (cherry picked from commit 9f1f998)
1 parent 72ea547 commit be413cd

15 files changed

+309
-10
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!-- Add Bundle Product to Cart from the category page with specified quantity to cart -->
12+
<actionGroup name="StorefrontAddCategoryBundleProductToCartActionGroup">
13+
<arguments>
14+
<argument name="product"/>
15+
<argument name="quantity" defaultValue="1" type="string"/>
16+
</arguments>
17+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
18+
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
19+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="waitForBundleProductPageLoad"/>
20+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
21+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.quantityField}}" stepKey="waitForQuantityVisible"/>
22+
<fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/>
23+
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/>
24+
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
25+
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
<section name="StorefrontBundleProductActionSection">
11+
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide"/>
12+
<element name="quantityField" type="input" selector="#qty"/>
13+
<element name="addToCartButton" type="button" selector="#product-addtocart-button"/>
14+
</section>
15+
</sections>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@
4343
<see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/>
4444
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
4545
</actionGroup>
46+
47+
<!--Fill product min quantity in group products grid-->
48+
<actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid">
49+
<arguments>
50+
<argument name="productName" type="string"/>
51+
<argument name="qty" type="string"/>
52+
</arguments>
53+
<fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/>
54+
</actionGroup>
4655
</actionGroups>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<element name="firstCheckbox" type="input" selector="tr[data-repeat-index='0'] .admin__control-checkbox"/>
1717
<element name="nThCheckbox" type="input" selector="tr[data-repeat-index='{{n}}'] .admin__control-checkbox" parameterized="true"/>
1818
</section>
19+
20+
<section name="AdminAddedProductsToGroupGrid">
21+
<element name="inputByProductName" type="input" selector="//div[@data-index='grouped']//table//tr[td[@data-index='name']//span[text()='{{productName}}']]//td[@data-index='qty']//input" parameterized="true"/>
22+
</section>
1923
</sections>
Lines changed: 78 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@
2222
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
2323
</actionGroup>
2424

25+
<!--Navigate to create order page (New Order -> Select Customer)-->
26+
<actionGroup name="navigateToNewOrderPageExistingCustomer">
27+
<arguments>
28+
<argument name="customer"/>
29+
</arguments>
30+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
31+
<waitForPageLoad stepKey="waitForIndexPageLoad"/>
32+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
33+
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
34+
<waitForPageLoad stepKey="waitForCustomerGridLoad"/>
35+
<fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/>
36+
<click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/>
37+
<waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/>
38+
<click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/>
39+
<waitForPageLoad stepKey="waitForCreateOrderPageLoad" />
40+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
41+
</actionGroup>
42+
2543
<!--Check the required fields are actually required-->
2644
<actionGroup name="checkRequiredFieldsNewOrderForm">
2745
<seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/>
@@ -84,6 +102,66 @@
84102
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
85103
</actionGroup>
86104

105+
<!--Add bundle product to order -->
106+
<actionGroup name="addBundleProductToOrder">
107+
<arguments>
108+
<argument name="product"/>
109+
<argument name="quantity" type="string" defaultValue="1"/>
110+
</arguments>
111+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
112+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/>
113+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/>
114+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
115+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/>
116+
<waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/>
117+
<wait time="2" stepKey="waitForOptionsToLoad"/>
118+
<fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
119+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
120+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
121+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
122+
</actionGroup>
123+
124+
<!--Add downloadable product to order -->
125+
<actionGroup name="addDownloadableProductToOrder">
126+
<arguments>
127+
<argument name="product"/>
128+
<argument name="link"/>
129+
<argument name="quantity" defaultValue="1" type="string"/>
130+
</arguments>
131+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
132+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/>
133+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/>
134+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
135+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/>
136+
<waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/>
137+
<click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/>
138+
<fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/>
139+
<click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/>
140+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
141+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
142+
</actionGroup>
143+
144+
<!--Add grouped product option to order -->
145+
<actionGroup name="addGroupedProductOptionToOrder">
146+
<arguments>
147+
<argument name="product"/>
148+
<argument name="option"/>
149+
<argument name="quantity" type="string" defaultValue="1"/>
150+
</arguments>
151+
152+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
153+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/>
154+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/>
155+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
156+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/>
157+
<waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/>
158+
<wait time="2" stepKey="waitForOptionsToLoad"/>
159+
<fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/>
160+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
161+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
162+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
163+
</actionGroup>
164+
87165
<!--Fill customer billing address-->
88166
<actionGroup name="fillOrderCustomerInformation">
89167
<arguments>
@@ -137,14 +215,4 @@
137215
</arguments>
138216
<see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/>
139217
</actionGroup>
140-
141-
<!--Cancel order that is in pending status-->
142-
<actionGroup name="cancelPendingOrder">
143-
<click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/>
144-
<waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/>
145-
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/>
146-
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/>
147-
<see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/>
148-
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Canceled" stepKey="seeOrderStatusCanceled"/>
149-
</actionGroup>
150218
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderCustomersGridSection">
12+
<element name="spinner" type="button" selector=".spinner"/>
13+
<element name="apply" type="button" selector=".action-secondary[title='Search']"/>
14+
<element name="resetFilter" type="button" selector=".action-tertiary[title='Reset Filter']"/>
15+
<element name="emailInput" type="input" selector="#sales_order_create_customer_grid_filter_email"/>
16+
<element name="firstRow" type="button" selector="tr:nth-of-type(1)[data-role='row']"/>
17+
</section>
18+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormBundleProductSection">
12+
<element name="quantity" type="input" selector="#product_composite_configure_input_qty"/>
13+
<element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/>
14+
</section>
15+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormDownloadableProductSection">
12+
<element name="optionSelect" type="select" selector="//div[contains(@class,'link')]/div/div/input[./../label[contains(text(),{{linkTitle}})]]" parameterized="true"/>
13+
<element name="quantity" type="input" selector="#product_composite_configure_input_qty"/>
14+
<element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/>
15+
</section>
16+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormGroupedProductSection">
12+
<element name="optionQty" type="input" selector="//td[@class='col-sku'][text()='{{productSku}}']/..//input[contains(@class, 'qty')]" parameterized="true"/>
13+
<element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/>
14+
</section>
15+
</sections>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCreateStoreGroupActionGroup">
11+
<arguments>
12+
<argument name="Website" defaultValue="_defaultWebsite"/>
13+
</arguments>
14+
<amOnPage url="{{AdminSystemStoreGroupPage.url}}" stepKey="navigateToNewStoreGroup"/>
15+
<waitForPageLoad stepKey="waitForStoreGroupPageLoad" />
16+
17+
<comment userInput="Creating Store Group" stepKey="storeGroupCreationComment" />
18+
<selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{Website.name}}" stepKey="selectWebsite" />
19+
<fillField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{CustomStoreGroupCustomWebsite.name}}" stepKey="enterStoreGroupName" />
20+
<fillField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{CustomStoreGroupCustomWebsite.code}}" stepKey="enterStoreGroupCode" />
21+
<selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="setRootCategory" />
22+
<click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup" />
23+
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/>
24+
<see userInput="You saved the store." stepKey="seeSavedMessage" />
25+
</actionGroup>
26+
</actionGroups>

0 commit comments

Comments
 (0)