Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3df1425

Browse files
authored
Merge pull request #2819 from magento-pangolin/MQE-1121-MSI-MFTF-Test-Case-4-Updates
[Pangolin] Extend MFTF tests to be able to run Inventory tests
2 parents ce5eacd + 8f440ff commit 3df1425

27 files changed

+393
-18
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+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
20+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
21+
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
22+
<fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/>
23+
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/>
24+
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
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>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<element name="backButton" type="button" selector="#back" timeout="30"/>
1313
<element name="saveButton" type="button" selector="#save-button" timeout="30"/>
1414
<element name="saveArrow" type="button" selector="button[data-ui-id='save-button-dropdown']" timeout="30"/>
15-
<!--<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>-->
16-
<element name="saveAndClose" type="button" selector="span[id='save_and_close']" timeout="30"/>
15+
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>
1716
<element name="changeStoreButton" type="button" selector="#store-change-button" timeout="10"/>
1817
<element name="selectStoreView" type="button" selector="//ul[@data-role='stores-list']/li/a[normalize-space(.)='{{var1}}']" timeout="10" parameterized="true"/>
1918
</section>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@
2121
<waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2222
</actionGroup>
2323

24+
<!-- Add Product to Cart from the category page with specified quantity and check message and product count in Minicart -->
25+
<actionGroup name="StorefrontAddCategoryProductToCartWithQuantityActionGroup">
26+
<arguments>
27+
<argument name="product"/>
28+
<argument name="quantity" defaultValue="1" type="string"/>
29+
<argument name="checkQuantity" defaultValue="1" type="string"/>
30+
</arguments>
31+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
32+
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
33+
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
34+
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
35+
<waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
36+
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
37+
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
38+
<fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/>
39+
<click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/>
40+
</actionGroup>
41+
2442
<!-- Add Product to Cart from the product page and check message and product count in Minicart -->
2543
<actionGroup name="StorefrontAddProductToCartActionGroup">
2644
<arguments>

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
<element name="viewAndEditCart" type="button" selector=".action.viewcart" timeout="30"/>
2424
<element name="miniCartItemsText" type="text" selector=".minicart-items"/>
2525
<element name="deleteMiniCartItem" type="button" selector=".action.delete" timeout="30"/>
26+
<element name="itemQuantity" type="input" selector="//a[text()='{{productName}}']/../..//input[contains(@class,'cart-item-qty')]" parameterized="true"/>
27+
<element name="itemQuantityUpdate" type="button" selector="//a[text()='{{productName}}']/../..//span[text()='Update']" parameterized="true"/>
2628
</section>
2729
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<section name="AdminConfigurableProductSelectAttributesSlideOut">
3232
<element name="grid" type="button" selector=".admin__data-grid-wrap tbody"/>
3333
</section>
34-
<section name="AdminConfigurableProductAssignSourcesSlideOut">
35-
<element name="done" type="button" selector=".product_form_product_form_assign_sources_configurable_modal .action-primary" timeout="5"/>
36-
<element name="assignSources" type="button" selector="(//button/span[contains(text(), 'Assign Sources')])[2]" timeout="5"/>
37-
<element name="quantityPerSource" type="input" selector="input[name='quantity_resolver[dynamicRows][dynamicRows][0][quantity_per_source]']"/>
38-
</section>
3934
<section name="StorefrontConfigurableProductPage">
4035
<element name="productAttributeDropDown" type="select" selector="select[id*='attribute']"/>
4136
</section>

app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml

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>

app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminAddProductsToGroupPanelSection.xml

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>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 79 additions & 0 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,67 @@
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+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
133+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/>
134+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/>
135+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
136+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/>
137+
<waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/>
138+
<click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/>
139+
<fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/>
140+
<click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/>
141+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
142+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
143+
</actionGroup>
144+
145+
<!--Add grouped product option to order -->
146+
<actionGroup name="addGroupedProductOptionToOrder">
147+
<arguments>
148+
<argument name="product"/>
149+
<argument name="option"/>
150+
<argument name="quantity" type="string" defaultValue="1"/>
151+
</arguments>
152+
153+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
154+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/>
155+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/>
156+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
157+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/>
158+
<waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/>
159+
<wait time="2" stepKey="waitForOptionsToLoad"/>
160+
<fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/>
161+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
162+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
163+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
164+
</actionGroup>
165+
87166
<!--Fill customer billing address-->
88167
<actionGroup name="fillOrderCustomerInformation">
89168
<arguments>
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>

app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191

9292
<!-- Search for Order in the order grid -->
9393
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
94-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
94+
<waitForPageLoad time="30" stepKey="waitForOrderListPageLoad"/>
95+
<conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilter"/>
9596
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/>
9697
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
9798
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>

0 commit comments

Comments
 (0)