Skip to content

Commit 13b0fe9

Browse files
author
Alexander Akimov
authored
Merge pull request #3815 from magento-tsg/2.2-develop-mftf-pr15
[TSG] MFTF for 2.2 (pr15) (2.2-develop)
2 parents 84295f7 + 2aa3384 commit 13b0fe9

15 files changed

+157
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="_defaultProduct" type="product">
1212
<data key="sku" unique="suffix">testSku</data>
1313
<data key="type_id">simple</data>
@@ -295,6 +295,9 @@
295295
<data key="quantity">1</data>
296296
<requiredEntity type="product_extension_attribute">EavStock1</requiredEntity>
297297
</entity>
298+
<entity name="GetProduct2" type="product2">
299+
<var key="sku" entityKey="sku" entityType="product2"/>
300+
</entity>
298301
<entity name="ApiSimpleWithQty100" extends="ApiSimpleOne">
299302
<data key="quantity">100</data>
300303
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="RelatedProductLink" type="product_link">
12+
<var key="sku" entityKey="sku" entityType="product2"/>
13+
<var key="linked_product_sku" entityKey="sku" entityType="product"/>
14+
<data key="link_type">related</data>
15+
<data key="linked_product_type">simple</data>
16+
<data key="position">1</data>
17+
<requiredEntity type="product_link_extension_attribute">Qty1000</requiredEntity>
18+
</entity>
19+
</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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="OneRelatedProductLink" type="product_links">
12+
<requiredEntity type="product_link">RelatedProductLink</requiredEntity>
13+
</entity>
14+
</entities>
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ProductLinkWidget" extends="ProductsListWidget">
12+
<data key="type">Catalog Product Link</data>
13+
<data key="template">Product Link Block Template</data>
14+
</entity>
15+
</entities>

app/code/Magento/Catalog/Test/Mftf/Metadata/product-meta.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,7 @@
121121
<operation name="deleteProduct2" dataType="product2" type="delete" auth="adminOauth" url="/V1/products/{sku}" method="DELETE">
122122
<contentType>application/json</contentType>
123123
</operation>
124+
<operation name="GetProduct2" dataType="product2" type="get" auth="adminOauth" url="/V1/products/{sku}" method="GET">
125+
<contentType>application/json</contentType>
126+
</operation>
124127
</operations>
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="AdminNewWidgetPage" url="admin/widget_instance/new/" area="admin" module="Magento_Widget">
12+
<section name="AdminNewWidgetSelectProductPopupSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontProductPage.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
-->
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
1212
<section name="StorefrontProductPageSection"/>
1313
<section name="StorefrontProductAdditionalInformationSection"/>
1414
<section name="StorefrontProductMediaSection"/>
1515
<section name="StorefrontProductInfoMainSection"/>
16+
<section name="StorefrontProductRelatedProductsSection"/>
1617
</page>
1718
</pages>
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="AdminNewWidgetSection">
12+
<element name="selectProduct" type="button" selector=".btn-chooser" timeout="30"/>
13+
</section>
14+
</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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminNewWidgetSelectProductPopupSection">
12+
<element name="filterBySku" type="input" selector=".data-grid-filters input[name='chooser_sku']"/>
13+
<element name="firstRow" type="select" selector=".even>td" timeout="20"/>
14+
</section>
15+
</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="StorefrontProductRelatedProductsSection">
12+
<element name="relatedProductName" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]" parameterized="true"/>
13+
</section>
14+
</sections>

app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<element name="rowActionSelect" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap"/>
2222
<element name="rowEditAction" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap._active [data-action='item-edit']" timeout="30"/>
2323
<element name="dataGridEmpty" type="block" selector=".data-grid-tr-no-data td"/>
24+
<element name="dataGridWrap" type="block" selector=".admin__data-grid-wrap"/>
2425
</section>
2526
</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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminUrlRewriteEditPage" url="admin/url_rewrite/edit/id/{{url_rewrite_id}}/" area="admin" module="Magento_UrlRewrite" parameterized="true">
12+
<section name="AdminUrlRewriteEditSection"/>
13+
</page>
14+
</pages>
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="AdminUrlRewriteEditSection">
12+
<element name="requestPathField" type="input" selector="#request_path"/>
13+
</section>
14+
</sections>

app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,17 @@
6363
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
6464
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been deleted" stepKey="seeSuccess"/>
6565
</actionGroup>
66+
<actionGroup name="AdminCreateProductLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
67+
<arguments>
68+
<argument name="product"/>
69+
</arguments>
70+
<selectOption selector="{{AdminNewWidgetSection.selectTemplate}}" userInput="{{widget.template}}" after="waitForPageLoad" stepKey="setTemplate"/>
71+
<waitForAjaxLoad after="setTemplate" stepKey="waitForPageLoad2"/>
72+
<click selector="{{AdminNewWidgetSection.selectProduct}}" after="clickWidgetOptions" stepKey="clickSelectProduct"/>
73+
<fillField selector="{{AdminNewWidgetSelectProductPopupSection.filterBySku}}" userInput="{{product.sku}}" after="clickSelectProduct" stepKey="fillProductNameInFilter"/>
74+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" after="fillProductNameInFilter" stepKey="applyFilter"/>
75+
<click selector="{{AdminNewWidgetSelectProductPopupSection.firstRow}}" after="applyFilter" stepKey="selectProduct"/>
76+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
77+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
78+
</actionGroup>
6679
</actionGroups>

app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<element name="addLayoutUpdate" type="button" selector=".action-default.scalable.action-add"/>
1818
<element name="selectDisplayOn" type="select" selector="#widget_instance[0][page_group]"/>
1919
<element name="selectContainer" type="select" selector="#all_pages_0>table>tbody>tr>td:nth-child(1)>div>div>select"/>
20+
<element name="selectTemplate" type="select" selector=".widget-layout-updates .block_template_container .select"/>
2021
<element name="widgetOptions" type="select" selector="#widget_instace_tabs_properties_section"/>
2122
<element name="addNewCondition" type="select" selector=".rule-param.rule-param-new-child"/>
2223
<element name="selectCondition" type="input" selector="#conditions__1__new_child"/>

0 commit comments

Comments
 (0)