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

Commit 7afe974

Browse files
authored
Merge pull request #3740 from magento-pangolin/mtf-eol-pr
[pangolins] Convert MTF tests to MFTF tests - closes magento-commerce/magento-functional-tests-migration#670
2 parents b92e6d3 + d068360 commit 7afe974

File tree

49 files changed

+1457
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1457
-9
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,25 @@
241241
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
242242
</actionGroup>
243243

244+
<!--Click AddCrossSellProducts and adds product by SKU-->
245+
<actionGroup name="addCrossSellProductBySku">
246+
<arguments>
247+
<argument name="sku"/>
248+
</arguments>
249+
<!--Scroll up to avoid error-->
250+
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/>
251+
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/>
252+
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/>
253+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
254+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
255+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
256+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
257+
<waitForPageLoad stepKey="waitForPageToLoad"/>
258+
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
259+
<click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/>
260+
<waitForPageLoad stepKey="waitForModalDisappear"/>
261+
</actionGroup>
262+
244263
<!--Add special price to product in Admin product page-->
245264
<actionGroup name="AddSpecialPriceToProductActionGroup">
246265
<arguments>
@@ -342,6 +361,32 @@
342361
</assertEquals>
343362
</actionGroup>
344363

364+
<!-- This action group goes to the product index page, opens the drop down and clicks the specified product type for adding a product -->
365+
<actionGroup name="GoToSpecifiedCreateProductPage">
366+
<arguments>
367+
<argument type="string" name="productType" defaultValue="simple"/>
368+
</arguments>
369+
<comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/>
370+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
371+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
372+
<click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/>
373+
<waitForPageLoad stepKey="waitForFormToLoad"/>
374+
</actionGroup>
375+
376+
<!-- This action group simply navigates to the product catalog page -->
377+
<actionGroup name="GoToProductCatalogPage">
378+
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
379+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
380+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
381+
</actionGroup>
382+
383+
<actionGroup name="SetProductUrlKey">
384+
<arguments>
385+
<argument name="product" defaultValue="_defaultProduct"/>
386+
</arguments>
387+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
388+
<fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
389+
</actionGroup>
345390
<actionGroup name="expandAdminProductSection">
346391
<arguments>
347392
<argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@
4545
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/>
4646
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/>
4747
</actionGroup>
48+
<actionGroup name="goToAttributeSetByName">
49+
<arguments>
50+
<argument name="name" type="string"/>
51+
</arguments>
52+
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
53+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
54+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
55+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
56+
<waitForPageLoad stepKey="waitForPageLoad"/>
57+
</actionGroup>
4858
<!-- Filter By Attribute Label -->
4959
<actionGroup name="filterProductAttributeByAttributeLabel">
5060
<arguments>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,48 @@
115115
<data key="used_for_sort_by">true</data>
116116
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
117117
</entity>
118+
<entity name="newsFromDate" type="ProductAttribute">
119+
<data key="attribute_code">news_from_date</data>
120+
<data key="default_frontend_label">Set Product as New from Date</data>
121+
<data key="frontend_input">date</data>
122+
<data key="is_required">false</data>
123+
<data key="is_user_defined">true</data>
124+
<data key="scope">website</data>
125+
<data key="is_unique">false</data>
126+
<data key="is_searchable">false</data>
127+
<data key="is_visible">false</data>
128+
<data key="is_visible_on_front">false</data>
129+
<data key="is_filterable">false</data>
130+
<data key="is_filterable_in_search">false</data>
131+
<data key="used_in_product_listing">true</data>
132+
<data key="is_used_for_promo_rules">false</data>
133+
<data key="is_comparable">false</data>
134+
<data key="is_used_in_grid">true</data>
135+
<data key="is_filterable_in_grid">true</data>
136+
<data key="used_for_sort_by">false</data>
137+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
138+
</entity>
139+
<entity name="newProductAttribute" type="ProductAttribute">
140+
<data key="attribute_code" unique="suffix">attribute</data>
141+
<data key="frontend_input">Text Field</data>
142+
<data key="scope">global</data>
143+
<data key="is_required">false</data>
144+
<data key="is_unique">false</data>
145+
<data key="is_searchable">true</data>
146+
<data key="is_visible">true</data>
147+
<data key="is_visible_in_advanced_search">true</data>
148+
<data key="is_visible_on_front">true</data>
149+
<data key="is_filterable">true</data>
150+
<data key="is_filterable_in_search">true</data>
151+
<data key="used_in_product_listing">true</data>
152+
<data key="is_used_for_promo_rules">true</data>
153+
<data key="is_comparable">true</data>
154+
<data key="is_used_in_grid">true</data>
155+
<data key="is_visible_in_grid">true</data>
156+
<data key="is_filterable_in_grid">true</data>
157+
<data key="used_for_sort_by">true</data>
158+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
159+
</entity>
118160
<entity name="productYesNoAttribute" type="ProductAttribute">
119161
<data key="attribute_code" unique="suffix">attribute</data>
120162
<data key="frontend_input">boolean</data>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeOptionData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,9 @@
8181
<requiredEntity type="StoreLabel">Option9Store0</requiredEntity>
8282
<requiredEntity type="StoreLabel">Option10Store1</requiredEntity>
8383
</entity>
84+
<entity name="ProductAttributeOption8" type="ProductAttributeOption">
85+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
86+
<data key="label" unique="suffix">White</data>
87+
<data key="value" unique="suffix">white</data>
88+
</entity>
8489
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminProductDeletePage" url="catalog/product/delete/id/{{productId}}/" area="admin" module="Magento_Catalog" parameterized="true">
12+
<!-- This page object only exists for the url. Use the AdminProductCreatePage for selectors. -->
13+
</page>
14+
</pages>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCreateNewProductAttributeSection">
12+
<element name="saveAttribute" type="button" selector="#save"/>
13+
<element name="defaultLabel" type="input" selector="input[name='frontend_label[0]']"/>
14+
<element name="inputType" type="select" selector="select[name='frontend_input']" timeout="30"/>
15+
<element name="addValue" type="button" selector="//button[contains(@data-action,'add_new_row')]" timeout="30"/>
16+
<element name="defaultStoreView" type="input" selector="//input[contains(@name,'option[value][option_{{row}}][1]')]" parameterized="true"/>
17+
<element name="adminOption" type="input" selector="//input[contains(@name,'option[value][option_{{row}}][0]')]" parameterized="true"/>
18+
<element name="defaultRadioButton" type="radio" selector="//tr[{{row}}]//input[contains(@name,'default[]')]/..//label" parameterized="true"/>
19+
<element name="isRequired" type="checkbox" selector="//input[contains(@name,'is_required')]/..//label"/>
20+
<element name="advancedAttributeProperties" type="text" selector="//div[contains(@data-index,'advanced_fieldset')]"/>
21+
<element name="attributeCode" type="input" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//input[@name='attribute_code']"/>
22+
<element name="scope" type="select" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//select[@name='is_global']" timeout="30"/>
23+
<element name="defaultValue" type="input" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//input[@name='default_value_text']"/>
24+
<element name="isUnique" type="checkbox" selector="//input[contains(@name, 'is_unique')]/..//label"/>
25+
<element name="storefrontProperties" type="text" selector="//div[contains(@data-index,'front_fieldset')]"/>
26+
<element name="inSearch" type="checkbox" selector="//input[contains(@name, 'is_searchable')]/..//label"/>
27+
<element name="advancedSearch" type="checkbox" selector="//input[contains(@name, 'is_visible_in_advanced_search')]/..//label"/>
28+
<element name="isComparable" type="checkbox" selector="//input[contains(@name, 'is_comparable')]/..//label"/>
29+
<element name="allowHtmlTags" type="checkbox" selector="//input[contains(@name, 'is_html_allowed_on_front')]/..//label"/>
30+
<element name="visibleOnStorefront" type="checkbox" selector="//input[contains(@name, 'is_visible_on_front')]/..//label"/>
31+
<element name="sortProductListing" type="checkbox" selector="//input[contains(@name, 'is_visible_on_front')]/..//label"/>
32+
</section>
33+
</sections>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@
1717
<element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/>
1818
<element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/>
1919
<element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/>
20+
<element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/>
21+
<element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-label col-frontend_label')]"/>
22+
<element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/>
23+
<element name="scopeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_global')]"/>
24+
<element name="isSearchableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_searchable')]"/>
25+
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
2026
</section>
2127
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="nthRow" type="block" selector="#setGrid_table tbody tr:nth-of-type({{var1}})" parameterized="true"/>
1515
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
1616
<element name="addAttributeSetBtn" type="button" selector="button.add-set" timeout="30"/>
17+
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
1718
</section>
1819
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductCrossSellModalSection">
12+
<element name="addSelectedProducts" type="button" selector=".product_form_product_form_related_crosssell_modal .action-primary"/>
13+
</section>
14+
</sections>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<element name="doneButton" type="button" selector="//aside[contains(@class,'product_form_product_form_advanced_inventory_modal')]//button[contains(@data-role,'action')]" timeout="5"/>
2020
<element name="useConfigSettings" type="checkbox" selector="//input[@name='product[stock_data][use_config_manage_stock]']"/>
2121
<element name="manageStock" type="select" selector="//*[@name='product[stock_data][manage_stock]']"/>
22+
<element name="miniQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_min_sale_qty]']"/>
23+
<element name="miniQtyAllowedInCart" type="input" selector="//*[@name='product[stock_data][min_sale_qty]']"/>
24+
<element name="maxiQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_max_sale_qty]']"/>
25+
<element name="maxiQtyAllowedInCart" type="input" selector="//*[@name='product[stock_data][max_sale_qty]']"/>
26+
<element name="notifyBelowQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_notify_stock_qty]']"/>
27+
<element name="notifyBelowQty" type="input" selector="//*[@name='product[stock_data][notify_stock_qty]']"/>
28+
<element name="advancedInventoryQty" type="input" selector="//div[@class='modal-inner-wrap']//input[@name='product[quantity_and_stock_status][qty]']"/>
29+
<element name="advancedInventoryStockStatus" type="select" selector="//div[@class='modal-inner-wrap']//select[@name='product[quantity_and_stock_status][is_in_stock]']"/>
2230
</section>
2331
</sections>
2432

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
<element name="setProductAsNewFrom" type="input" selector="input[name='product[news_from_date]']"/>
5353
<element name="setProductAsNewTo" type="input" selector="input[name='product[news_to_date]']"/>
5454
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
55+
<element name="attributeRequiredInput" type="input" selector="//input[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
56+
<element name="attributeFieldError" type="text" selector="//*[@class='admin__field _required _error']/..//label[contains(.,'This is a required field.')]"/>
5557
<element name="customSelectField" type="select" selector="//select[@name='product[{{var}}]']" parameterized="true"/>
5658
<element name="searchCategory" type="input" selector="//*[@data-index='category_ids']//input[contains(@class, 'multiselect-search')]"/>
5759
<element name="selectCategory" type="input" selector="//*[@data-index='category_ids']//label[contains(., '{{categoryName}}')]" parameterized="true"/>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormRelatedUpSellCrossSellSection">
12+
<element name="sectionHeader" type="block" selector=".fieldset-wrapper.admin__collapsible-block-wrapper[data-index='related']"/>
1213
<element name="AddRelatedProductsButton" type="button" selector="button[data-index='button_related']" timeout="30"/>
1314
<element name="AddUpSellProductsButton" type="button" selector="button[data-index='button_upsell']" timeout="30"/>
15+
<element name="AddCrossSellProductsButton" type="button" selector="button[data-index='button_crosssell']" timeout="30"/>
1416
<element name="relatedProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='related']"/>
1517
<element name="upSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='upsell']"/>
1618
<element name="crossSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='crosssell']"/>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
<element name="productImage" type="text" selector="img.product-image-photo"/>
2727
<element name="productLink" type="text" selector="a.product-item-link"/>
2828
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
29-
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
29+
<element name="productPrice" type="text" selector=".price-final_price"/>
3030
<element name="categoryImage" type="text" selector=".category-image"/>
3131
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
3232
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
3333
<element name="asLowAs" type="input" selector="//*[@class='price-box price-final_price']/a/span[@class='price-container price-final_price tax weee']"/>
3434
<element name="productsList" type="block" selector="#maincontent .column.main"/>
35+
<element name="productName" type="text" selector=".product-item-name"/>
36+
<element name="productOptionList" type="text" selector="#narrow-by-list"/>
3537
</section>
3638
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontHeaderSection">
12-
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true"/>
12+
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true" timeout="30"/>
1313
</section>
1414
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<element name="productName" type="text" selector=".base"/>
1414
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
1515
<element name="productPriceLabel" type="text" selector=".price-label"/>
16-
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
16+
<element name="productPrice" type="text" selector=".price-final_price"/>
1717
<element name="qty" type="input" selector="#qty"/>
1818
<element name="specialPrice" type="text" selector=".special-price"/>
1919
<element name="specialPriceAmount" type="text" selector=".special-price span.price"/>

0 commit comments

Comments
 (0)