Skip to content

Commit

Permalink
Merge pull request #3779 from magento-pangolin/mtf-eol-pr
Browse files Browse the repository at this point in the history
[pangolins] Convert MTF tests to MFTF tests
  • Loading branch information
okolesnyk authored Feb 22, 2019
2 parents 94383aa + 51aa164 commit 0d0b300
Show file tree
Hide file tree
Showing 60 changed files with 3,103 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,66 @@
<waitForPageLoad stepKey="waitForAttributeToSave"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
</actionGroup>

<!--Clicks Add Attribute and adds the given attribute-->
<actionGroup name="addProductAttributeInProductModal">
<arguments>
<argument name="attributeCode" type="string"/>
</arguments>
<click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/>
<conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/>
<click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/>
<fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/>
<click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/>
<waitForPageLoad stepKey="waitForFilters"/>
<checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/>
<click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/>
</actionGroup>

<!--Clicks createNewAttribute and fills out form-->
<actionGroup name="createProductAttribute">
<arguments>
<argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/>
</arguments>
<click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/>
<fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/>
<selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/>
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/>
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
</actionGroup>

<!-- Inputs text default value and attribute code-->
<actionGroup name="createProductAttributeWithTextField" extends="createProductAttribute" insertAfter="checkRequired">
<click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/>
<fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/>
<fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/>
</actionGroup>

<!-- Inputs date default value and attribute code-->
<actionGroup name="createProductAttributeWithDateField" extends="createProductAttribute" insertAfter="checkRequired">
<arguments>
<argument name="date" type="string"/>
</arguments>
<click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/>
<fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/>
<fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/>
</actionGroup>

<!-- Creates dropdown option at row without saving-->
<actionGroup name="createAttributeDropdownNthOption">
<arguments>
<argument name="row" type="string"/>
<argument name="adminName" type="string"/>
<argument name="frontName" type="string"/>
</arguments>
<click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/>
<waitForPageLoad stepKey="waitForNewOption"/>
<fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/>
<fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/>
</actionGroup>

<!-- Creates dropdown option at row as default-->
<actionGroup name="createAttributeDropdownNthOptionAsDefault" extends="createAttributeDropdownNthOption">
<checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@
<waitForPageLoad stepKey="waitForUserInput"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
</actionGroup>
<actionGroup name="FilterProductAttributeSetGridByAttributeSetName">
<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 time="30" stepKey="waitForPageLoad1"/>
</actionGroup>
</actionGroups>
6 changes: 6 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,10 @@
<data key="is_active">false</data>
<data key="include_in_menu">true</data>
</entity>
<entity name="CatInactiveNotInMenu" type="category">
<data key="name" unique="suffix">InactiveNotInMenu</data>
<data key="name_lwr" unique="suffix">inactivenotinmenu</data>
<data key="is_active">false</data>
<data key="include_in_menu">false</data>
</entity>
</entities>
86 changes: 85 additions & 1 deletion app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,27 @@
<data key="used_for_sort_by">true</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productDropDownAttributeNotSearchable" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">select</data>
<data key="scope">global</data>
<data key="is_required">false</data>
<data key="is_unique">false</data>
<data key="is_searchable">false</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="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
<data key="attribute_code">testattribute</data>
<data key="frontend_input">select</data>
Expand Down Expand Up @@ -115,6 +136,27 @@
<data key="used_for_sort_by">true</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productAttributeMultiselectTwoOptionsNotSearchable" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">multiselect</data>
<data key="scope">global</data>
<data key="is_required">false</data>
<data key="is_unique">false</data>
<data key="is_searchable">false</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="newsFromDate" type="ProductAttribute">
<data key="attribute_code">news_from_date</data>
<data key="default_frontend_label">Set Product as New from Date</data>
Expand All @@ -138,7 +180,7 @@
</entity>
<entity name="newProductAttribute" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">Text Field</data>
<data key="frontend_input">text</data>
<data key="scope">global</data>
<data key="is_required">false</data>
<data key="is_unique">false</data>
Expand Down Expand Up @@ -201,4 +243,46 @@
<data key="used_for_sort_by">false</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="textProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">text</data>
<data key="default_value" unique="suffix">defaultValue</data>
<data key="is_required_admin">No</data>
</entity>
<entity name="dateProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">date</data>
<data key="is_required_admin">No</data>
</entity>
<entity name="priceProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">date</data>
<data key="is_required_admin">No</data>
</entity>
<entity name="dropdownProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">select</data>
<data key="frontend_input_admin">Dropdown</data>
<data key="is_required_admin">No</data>
<data key="option1_admin" unique="suffix">opt1Admin</data>
<data key="option1_frontend" unique="suffix">opt1Front</data>
<data key="option2_admin" unique="suffix">opt2Admin</data>
<data key="option2_frontend" unique="suffix">opt2Front</data>
<data key="option3_admin" unique="suffix">opt3Admin</data>
<data key="option3_frontend" unique="suffix">opt3Front</data>
</entity>
<entity name="multiselectProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">multiselect</data>
<data key="frontend_input_admin">Multiple Select</data>
<data key="is_required_admin">No</data>
<data key="option1_admin" unique="suffix">opt1Admin</data>
<data key="option1_frontend" unique="suffix">opt1Front</data>
<data key="option2_admin" unique="suffix">opt2Admin</data>
<data key="option2_frontend" unique="suffix">opt2Front</data>
<data key="option3_admin" unique="suffix">opt3Admin</data>
<data key="option3_frontend" unique="suffix">opt3Front</data>
</entity>
<entity name="dropdownProductAttributeWithQuote" extends="productAttributeWysiwyg" type="ProductAttribute">
<data key="frontend_input">select</data>
<data key="frontend_input_admin">Dropdown</data>
<data key="is_required_admin">No</data>
<data key="option1_admin" unique="suffix">opt1'Admin</data>
<data key="option1_frontend" unique="suffix">opt1'Front</data>
</entity>
</entities>
123 changes: 123 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,129 @@
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
<entity name="simpleProductRegularPrice325InStock" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">325.02</data>
<data key="quantity">89</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">89.0000</data>
<data key="visibility">Search</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductRegularPrice32503OutOfStock" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">325.03</data>
<data key="quantity">25</data>
<data key="status">Out of Stock</data>
<data key="storefrontStatus">OUT OF STOCK</data>
<data key="weight">125.0000</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductRegularPrice245InStock" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">245.00</data>
<data key="quantity">200</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">120.0000</data>
<data key="visibility">Catalog, Search</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductRegularPrice32501InStock" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">325.01</data>
<data key="quantity">125</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">25.0000</data>
<data key="visibility">Catalog</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductTierPrice300InStock" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">300.00</data>
<data key="quantity">34</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">1</data>
<data key="weightSelect">This item has weight</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductEnabledFlat" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">1.99</data>
<data key="productTaxClass">Taxable Goods</data>
<data key="quantity">1000</data>
<data key="status">1</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">1</data>
<data key="weightSelect">This item has weight</data>
<data key="visibility">Catalog, Search</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductRegularPriceCustomOptions" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">245.00</data>
<data key="storefront_new_cartprice">343.00</data>
<data key="quantity">200</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="weight">120.0000</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductDisabled" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">74.00</data>
<data key="quantity">87</data>
<data key="status">In Stock</data>
<data key="weight">333.0000</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductNotVisibleIndividually" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">325.00</data>
<data key="quantity">123</data>
<data key="status">In Stock</data>
<data key="weight">129.0000</data>
<data key="visibility">Not Visible Individually</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="simpleProductDataOverriding" type="product">
<data key="urlKey" unique="suffix">test-simple-product</data>
<data key="name" unique="suffix">TestSimpleProduct</data>
<data key="sku" unique="suffix">test_simple_product_sku</data>
<data key="price">9.99</data>
<data key="type_id">simple</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="nameAndAttributeSkuMaskSimpleProduct" type="product">
<data key="urlKey" unique="suffix">simple-product</data>
<data key="name" unique="suffix">SimpleProduct</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="simpleProductCustomizableOption">
<data key="title" unique="suffix">Test3 option</data>
<data key="type">Drop-down</data>
<data key="is_required">1</data>
<data key="option_0_title" unique="suffix">40 Percent</data>
<data key="option_0_price">40.00</data>
<data key="option_0_price_type">Percent</data>
<data key="option_0_sku" unique="suffix">sku_drop_down_row_1</data>
</entity>
</entities>
Loading

0 comments on commit 0d0b300

Please sign in to comment.