Skip to content

Commit

Permalink
Merge pull request #3815 from magento-tsg/2.2-develop-mftf-pr15
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.2 (pr15) (2.2-develop)
  • Loading branch information
Alexander Akimov authored Feb 28, 2019
2 parents 84295f7 + 2aa3384 commit 13b0fe9
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="_defaultProduct" type="product">
<data key="sku" unique="suffix">testSku</data>
<data key="type_id">simple</data>
Expand Down Expand Up @@ -295,6 +295,9 @@
<data key="quantity">1</data>
<requiredEntity type="product_extension_attribute">EavStock1</requiredEntity>
</entity>
<entity name="GetProduct2" type="product2">
<var key="sku" entityKey="sku" entityType="product2"/>
</entity>
<entity name="ApiSimpleWithQty100" extends="ApiSimpleOne">
<data key="quantity">100</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductLinkData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="RelatedProductLink" type="product_link">
<var key="sku" entityKey="sku" entityType="product2"/>
<var key="linked_product_sku" entityKey="sku" entityType="product"/>
<data key="link_type">related</data>
<data key="linked_product_type">simple</data>
<data key="position">1</data>
<requiredEntity type="product_link_extension_attribute">Qty1000</requiredEntity>
</entity>
</entities>
14 changes: 14 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductLinksData.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.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="OneRelatedProductLink" type="product_links">
<requiredEntity type="product_link">RelatedProductLink</requiredEntity>
</entity>
</entities>
15 changes: 15 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="ProductLinkWidget" extends="ProductsListWidget">
<data key="type">Catalog Product Link</data>
<data key="template">Product Link Block Template</data>
</entity>
</entities>
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Metadata/product-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,7 @@
<operation name="deleteProduct2" dataType="product2" type="delete" auth="adminOauth" url="/V1/products/{sku}" method="DELETE">
<contentType>application/json</contentType>
</operation>
<operation name="GetProduct2" dataType="product2" type="get" auth="adminOauth" url="/V1/products/{sku}" method="GET">
<contentType>application/json</contentType>
</operation>
</operations>
14 changes: 14 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.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="AdminNewWidgetPage" url="admin/widget_instance/new/" area="admin" module="Magento_Widget">
<section name="AdminNewWidgetSelectProductPopupSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
<section name="StorefrontProductPageSection"/>
<section name="StorefrontProductAdditionalInformationSection"/>
<section name="StorefrontProductMediaSection"/>
<section name="StorefrontProductInfoMainSection"/>
<section name="StorefrontProductRelatedProductsSection"/>
</page>
</pages>
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="AdminNewWidgetSection">
<element name="selectProduct" type="button" selector=".btn-chooser" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="AdminNewWidgetSelectProductPopupSection">
<element name="filterBySku" type="input" selector=".data-grid-filters input[name='chooser_sku']"/>
<element name="firstRow" type="select" selector=".even>td" timeout="20"/>
</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="StorefrontProductRelatedProductsSection">
<element name="relatedProductName" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<element name="rowActionSelect" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap"/>
<element name="rowEditAction" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap._active [data-action='item-edit']" timeout="30"/>
<element name="dataGridEmpty" type="block" selector=".data-grid-tr-no-data td"/>
<element name="dataGridWrap" type="block" selector=".admin__data-grid-wrap"/>
</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.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminUrlRewriteEditPage" url="admin/url_rewrite/edit/id/{{url_rewrite_id}}/" area="admin" module="Magento_UrlRewrite" parameterized="true">
<section name="AdminUrlRewriteEditSection"/>
</page>
</pages>
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="AdminUrlRewriteEditSection">
<element name="requestPathField" type="input" selector="#request_path"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,17 @@
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been deleted" stepKey="seeSuccess"/>
</actionGroup>
<actionGroup name="AdminCreateProductLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
<arguments>
<argument name="product"/>
</arguments>
<selectOption selector="{{AdminNewWidgetSection.selectTemplate}}" userInput="{{widget.template}}" after="waitForPageLoad" stepKey="setTemplate"/>
<waitForAjaxLoad after="setTemplate" stepKey="waitForPageLoad2"/>
<click selector="{{AdminNewWidgetSection.selectProduct}}" after="clickWidgetOptions" stepKey="clickSelectProduct"/>
<fillField selector="{{AdminNewWidgetSelectProductPopupSection.filterBySku}}" userInput="{{product.sku}}" after="clickSelectProduct" stepKey="fillProductNameInFilter"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" after="fillProductNameInFilter" stepKey="applyFilter"/>
<click selector="{{AdminNewWidgetSelectProductPopupSection.firstRow}}" after="applyFilter" stepKey="selectProduct"/>
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<element name="addLayoutUpdate" type="button" selector=".action-default.scalable.action-add"/>
<element name="selectDisplayOn" type="select" selector="#widget_instance[0][page_group]"/>
<element name="selectContainer" type="select" selector="#all_pages_0>table>tbody>tr>td:nth-child(1)>div>div>select"/>
<element name="selectTemplate" type="select" selector=".widget-layout-updates .block_template_container .select"/>
<element name="widgetOptions" type="select" selector="#widget_instace_tabs_properties_section"/>
<element name="addNewCondition" type="select" selector=".rule-param.rule-param-new-child"/>
<element name="selectCondition" type="input" selector="#conditions__1__new_child"/>
Expand Down

0 comments on commit 13b0fe9

Please sign in to comment.