Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3740 from magento-pangolin/mtf-eol-pr
Browse files Browse the repository at this point in the history
[pangolins] Convert MTF tests to MFTF tests

- closes magento-commerce/magento-functional-tests-migration#670
  • Loading branch information
okolesnyk authored Feb 14, 2019
2 parents b92e6d3 + d068360 commit 7afe974
Show file tree
Hide file tree
Showing 49 changed files with 1,457 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,25 @@
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
</actionGroup>

<!--Click AddCrossSellProducts and adds product by SKU-->
<actionGroup name="addCrossSellProductBySku">
<arguments>
<argument name="sku"/>
</arguments>
<!--Scroll up to avoid error-->
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/>
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/>
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
<click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/>
<waitForPageLoad stepKey="waitForModalDisappear"/>
</actionGroup>

<!--Add special price to product in Admin product page-->
<actionGroup name="AddSpecialPriceToProductActionGroup">
<arguments>
Expand Down Expand Up @@ -342,6 +361,32 @@
</assertEquals>
</actionGroup>

<!-- This action group goes to the product index page, opens the drop down and clicks the specified product type for adding a product -->
<actionGroup name="GoToSpecifiedCreateProductPage">
<arguments>
<argument type="string" name="productType" defaultValue="simple"/>
</arguments>
<comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/>
<waitForPageLoad stepKey="waitForFormToLoad"/>
</actionGroup>

<!-- This action group simply navigates to the product catalog page -->
<actionGroup name="GoToProductCatalogPage">
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
</actionGroup>

<actionGroup name="SetProductUrlKey">
<arguments>
<argument name="product" defaultValue="_defaultProduct"/>
</arguments>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
<fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
</actionGroup>
<actionGroup name="expandAdminProductSection">
<arguments>
<argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/>
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/>
</actionGroup>
<actionGroup name="goToAttributeSetByName">
<arguments>
<argument name="name" type="string"/>
</arguments>
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
<!-- Filter By Attribute Label -->
<actionGroup name="filterProductAttributeByAttributeLabel">
<arguments>
Expand Down
42 changes: 42 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,48 @@
<data key="used_for_sort_by">true</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="newsFromDate" type="ProductAttribute">
<data key="attribute_code">news_from_date</data>
<data key="default_frontend_label">Set Product as New from Date</data>
<data key="frontend_input">date</data>
<data key="is_required">false</data>
<data key="is_user_defined">true</data>
<data key="scope">website</data>
<data key="is_unique">false</data>
<data key="is_searchable">false</data>
<data key="is_visible">false</data>
<data key="is_visible_on_front">false</data>
<data key="is_filterable">false</data>
<data key="is_filterable_in_search">false</data>
<data key="used_in_product_listing">true</data>
<data key="is_used_for_promo_rules">false</data>
<data key="is_comparable">false</data>
<data key="is_used_in_grid">true</data>
<data key="is_filterable_in_grid">true</data>
<data key="used_for_sort_by">false</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="newProductAttribute" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">Text Field</data>
<data key="scope">global</data>
<data key="is_required">false</data>
<data key="is_unique">false</data>
<data key="is_searchable">true</data>
<data key="is_visible">true</data>
<data key="is_visible_in_advanced_search">true</data>
<data key="is_visible_on_front">true</data>
<data key="is_filterable">true</data>
<data key="is_filterable_in_search">true</data>
<data key="used_in_product_listing">true</data>
<data key="is_used_for_promo_rules">true</data>
<data key="is_comparable">true</data>
<data key="is_used_in_grid">true</data>
<data key="is_visible_in_grid">true</data>
<data key="is_filterable_in_grid">true</data>
<data key="used_for_sort_by">true</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productYesNoAttribute" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">boolean</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,9 @@
<requiredEntity type="StoreLabel">Option9Store0</requiredEntity>
<requiredEntity type="StoreLabel">Option10Store1</requiredEntity>
</entity>
<entity name="ProductAttributeOption8" type="ProductAttributeOption">
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
<data key="label" unique="suffix">White</data>
<data key="value" unique="suffix">white</data>
</entity>
</entities>
14 changes: 14 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Page/AdminProductDeletePage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminProductDeletePage" url="catalog/product/delete/id/{{productId}}/" area="admin" module="Magento_Catalog" parameterized="true">
<!-- This page object only exists for the url. Use the AdminProductCreatePage for selectors. -->
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCreateNewProductAttributeSection">
<element name="saveAttribute" type="button" selector="#save"/>
<element name="defaultLabel" type="input" selector="input[name='frontend_label[0]']"/>
<element name="inputType" type="select" selector="select[name='frontend_input']" timeout="30"/>
<element name="addValue" type="button" selector="//button[contains(@data-action,'add_new_row')]" timeout="30"/>
<element name="defaultStoreView" type="input" selector="//input[contains(@name,'option[value][option_{{row}}][1]')]" parameterized="true"/>
<element name="adminOption" type="input" selector="//input[contains(@name,'option[value][option_{{row}}][0]')]" parameterized="true"/>
<element name="defaultRadioButton" type="radio" selector="//tr[{{row}}]//input[contains(@name,'default[]')]/..//label" parameterized="true"/>
<element name="isRequired" type="checkbox" selector="//input[contains(@name,'is_required')]/..//label"/>
<element name="advancedAttributeProperties" type="text" selector="//div[contains(@data-index,'advanced_fieldset')]"/>
<element name="attributeCode" type="input" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//input[@name='attribute_code']"/>
<element name="scope" type="select" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//select[@name='is_global']" timeout="30"/>
<element name="defaultValue" type="input" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//input[@name='default_value_text']"/>
<element name="isUnique" type="checkbox" selector="//input[contains(@name, 'is_unique')]/..//label"/>
<element name="storefrontProperties" type="text" selector="//div[contains(@data-index,'front_fieldset')]"/>
<element name="inSearch" type="checkbox" selector="//input[contains(@name, 'is_searchable')]/..//label"/>
<element name="advancedSearch" type="checkbox" selector="//input[contains(@name, 'is_visible_in_advanced_search')]/..//label"/>
<element name="isComparable" type="checkbox" selector="//input[contains(@name, 'is_comparable')]/..//label"/>
<element name="allowHtmlTags" type="checkbox" selector="//input[contains(@name, 'is_html_allowed_on_front')]/..//label"/>
<element name="visibleOnStorefront" type="checkbox" selector="//input[contains(@name, 'is_visible_on_front')]/..//label"/>
<element name="sortProductListing" type="checkbox" selector="//input[contains(@name, 'is_visible_on_front')]/..//label"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
<element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/>
<element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/>
<element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/>
<element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/>
<element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-label col-frontend_label')]"/>
<element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/>
<element name="scopeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_global')]"/>
<element name="isSearchableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_searchable')]"/>
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="nthRow" type="block" selector="#setGrid_table tbody tr:nth-of-type({{var1}})" parameterized="true"/>
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
<element name="addAttributeSetBtn" type="button" selector="button.add-set" timeout="30"/>
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductCrossSellModalSection">
<element name="addSelectedProducts" type="button" selector=".product_form_product_form_related_crosssell_modal .action-primary"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<element name="doneButton" type="button" selector="//aside[contains(@class,'product_form_product_form_advanced_inventory_modal')]//button[contains(@data-role,'action')]" timeout="5"/>
<element name="useConfigSettings" type="checkbox" selector="//input[@name='product[stock_data][use_config_manage_stock]']"/>
<element name="manageStock" type="select" selector="//*[@name='product[stock_data][manage_stock]']"/>
<element name="miniQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_min_sale_qty]']"/>
<element name="miniQtyAllowedInCart" type="input" selector="//*[@name='product[stock_data][min_sale_qty]']"/>
<element name="maxiQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_max_sale_qty]']"/>
<element name="maxiQtyAllowedInCart" type="input" selector="//*[@name='product[stock_data][max_sale_qty]']"/>
<element name="notifyBelowQtyConfigSetting" type="checkbox" selector="//*[@name='product[stock_data][use_config_notify_stock_qty]']"/>
<element name="notifyBelowQty" type="input" selector="//*[@name='product[stock_data][notify_stock_qty]']"/>
<element name="advancedInventoryQty" type="input" selector="//div[@class='modal-inner-wrap']//input[@name='product[quantity_and_stock_status][qty]']"/>
<element name="advancedInventoryStockStatus" type="select" selector="//div[@class='modal-inner-wrap']//select[@name='product[quantity_and_stock_status][is_in_stock]']"/>
</section>
</sections>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<element name="setProductAsNewFrom" type="input" selector="input[name='product[news_from_date]']"/>
<element name="setProductAsNewTo" type="input" selector="input[name='product[news_to_date]']"/>
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
<element name="attributeRequiredInput" type="input" selector="//input[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
<element name="attributeFieldError" type="text" selector="//*[@class='admin__field _required _error']/..//label[contains(.,'This is a required field.')]"/>
<element name="customSelectField" type="select" selector="//select[@name='product[{{var}}]']" parameterized="true"/>
<element name="searchCategory" type="input" selector="//*[@data-index='category_ids']//input[contains(@class, 'multiselect-search')]"/>
<element name="selectCategory" type="input" selector="//*[@data-index='category_ids']//label[contains(., '{{categoryName}}')]" parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductFormRelatedUpSellCrossSellSection">
<element name="sectionHeader" type="block" selector=".fieldset-wrapper.admin__collapsible-block-wrapper[data-index='related']"/>
<element name="AddRelatedProductsButton" type="button" selector="button[data-index='button_related']" timeout="30"/>
<element name="AddUpSellProductsButton" type="button" selector="button[data-index='button_upsell']" timeout="30"/>
<element name="AddCrossSellProductsButton" type="button" selector="button[data-index='button_crosssell']" timeout="30"/>
<element name="relatedProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='related']"/>
<element name="upSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='upsell']"/>
<element name="crossSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='crosssell']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
<element name="productImage" type="text" selector="img.product-image-photo"/>
<element name="productLink" type="text" selector="a.product-item-link"/>
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
<element name="productPrice" type="text" selector=".price-final_price"/>
<element name="categoryImage" type="text" selector=".category-image"/>
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
<element name="asLowAs" type="input" selector="//*[@class='price-box price-final_price']/a/span[@class='price-container price-final_price tax weee']"/>
<element name="productsList" type="block" selector="#maincontent .column.main"/>
<element name="productName" type="text" selector=".product-item-name"/>
<element name="productOptionList" type="text" selector="#narrow-by-list"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontHeaderSection">
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true"/>
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<element name="productName" type="text" selector=".base"/>
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
<element name="productPriceLabel" type="text" selector=".price-label"/>
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
<element name="productPrice" type="text" selector=".price-final_price"/>
<element name="qty" type="input" selector="#qty"/>
<element name="specialPrice" type="text" selector=".special-price"/>
<element name="specialPriceAmount" type="text" selector=".special-price span.price"/>
Expand Down
Loading

0 comments on commit 7afe974

Please sign in to comment.