Skip to content

Commit 645941c

Browse files
authored
Merge pull request #4106 from magento-tsg/2.3-develop-mftf-pr14
[TSG] MFTF for 2.3 (pr14) (2.3.2)
2 parents 932acf9 + d7898c6 commit 645941c

File tree

37 files changed

+814
-23
lines changed

37 files changed

+814
-23
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
11+
<selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/>
12+
<selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/>
13+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
14+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessageAppears"/>
15+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Check the product in recently viewed widget -->
12+
<actionGroup name="StorefrontAssertProductInRecentlyViewedWidgetActionGroup">
13+
<arguments>
14+
<argument name="product"/>
15+
</arguments>
16+
<waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" stepKey="waitWidgetRecentlyViewedProductsGrid"/>
17+
<see selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyViewedWidget"/>
18+
</actionGroup>
19+
20+
<!-- Check the product in recently compared widget -->
21+
<actionGroup name="StorefrontAssertProductInRecentlyComparedWidgetActionGroup">
22+
<arguments>
23+
<argument name="product"/>
24+
</arguments>
25+
<waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" stepKey="waitWidgetRecentlyComparedProductsGrid"/>
26+
<see selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyComparedWidget"/>
27+
</actionGroup>
28+
29+
<!-- Check the product in recently ordered widget -->
30+
<actionGroup name="StorefrontAssertProductInRecentlyOrderedWidgetActionGroup">
31+
<arguments>
32+
<argument name="product"/>
33+
</arguments>
34+
<waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" stepKey="waitWidgetRecentlyOrderedProductsGrid"/>
35+
<see selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyOrderedWidget"/>
36+
</actionGroup>
37+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="EnableSynchronizeWidgetProductsWithBackendStorage" type="catalog_recently_products">
11+
<requiredEntity type="synchronize_with_backend">EnableCatalogRecentlyProductsSynchronize</requiredEntity>
12+
</entity>
13+
14+
<entity name="EnableCatalogRecentlyProductsSynchronize" type="synchronize_with_backend">
15+
<data key="value">1</data>
16+
</entity>
17+
18+
<entity name="DisableSynchronizeWidgetProductsWithBackendStorage" type="catalog_recently_products">
19+
<requiredEntity type="synchronize_with_backend">DefaultCatalogRecentlyProductsSynchronize</requiredEntity>
20+
</entity>
21+
22+
<entity name="DefaultCatalogRecentlyProductsSynchronize" type="synchronize_with_backend">
23+
<data key="value">0</data>
24+
</entity>
25+
</entities>

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,24 @@
1212
<data key="type">Catalog Product Link</data>
1313
<data key="template">Product Link Block Template</data>
1414
</entity>
15+
<entity name="RecentlyComparedProductsWidget" type="widget">
16+
<data key="type">Recently Compared Products</data>
17+
<data key="design_theme">Magento Luma</data>
18+
<data key="name" unique="suffix">Recently Compared Products</data>
19+
<array key="store_ids">
20+
<item>All Store Views</item>
21+
</array>
22+
<data key="display_on">All Pages</data>
23+
<data key="container">Sidebar Additional</data>
24+
</entity>
25+
<entity name="RecentlyViewedProductsWidget" type="widget">
26+
<data key="type">Recently Viewed Products</data>
27+
<data key="design_theme">Magento Luma</data>
28+
<data key="name" unique="suffix">Recently Viewed Products</data>
29+
<array key="store_ids">
30+
<item>All Store Views</item>
31+
</array>
32+
<data key="display_on">All Pages</data>
33+
<data key="container">Sidebar Additional</data>
34+
</entity>
1535
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
9+
<operation name="CatalogRecentlyProductsConfiguration" dataType="catalog_recently_products" type="create"
10+
auth="adminFormKey" url="/admin/system_config/save/section/catalog/" method="POST" successRegex="/messages-message-success/">
11+
<object key="groups" dataType="catalog_recently_products">
12+
<object key="recently_products" dataType="catalog_recently_products">
13+
<object key="fields" dataType="catalog_recently_products">
14+
<object key="synchronize_with_backend" dataType="synchronize_with_backend">
15+
<field key="value">integer</field>
16+
</object>
17+
</object>
18+
</object>
19+
</object>
20+
</operation>
21+
</operations>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminNewWidgetPage" url="admin/widget_instance/new/" area="admin" module="Magento_Widget">
1212
<section name="AdminNewWidgetSelectProductPopupSection"/>
13+
<section name="AdminCatalogProductWidgetSection"/>
1314
</page>
1415
</pages>
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="AdminCatalogProductWidgetSection">
12+
<element name="productAttributesToShow" type="multiselect" selector="select[name='parameters[show_attributes][]']"/>
13+
<element name="productButtonsToShow" type="multiselect" selector="select[name='parameters[show_buttons][]']"/>
14+
</section>
15+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="StorefrontWidgetsSection">
12+
<element name="widgetRecentlyViewedProductsGrid" type="block" selector=".block.widget.block-viewed-products-grid"/>
13+
<element name="widgetRecentlyComparedProductsGrid" type="block" selector=".block.widget.block-compared-products-grid"/>
14+
<element name="widgetRecentlyOrderedProductsGrid" type="block" selector=".block.block-reorder"/>
15+
</section>
16+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Assert Estimate Shipping and Tax Data in Cart -->
12+
<actionGroup name="StorefrontAssertCartEstimateShippingAndTaxActionGroup">
13+
<arguments>
14+
<argument name="customerData" defaultValue="Simple_US_CA_Customer_For_Shipment"/>
15+
</arguments>
16+
<seeInField selector="{{CheckoutCartSummarySection.country}}" userInput="{{customerData.country}}" stepKey="assertCountryFieldInCartEstimateShippingAndTaxSection"/>
17+
<seeInField selector="{{CheckoutCartSummarySection.stateProvinceInput}}" userInput="{{customerData.region}}" stepKey="assertStateProvinceInCartEstimateShippingAndTaxSection"/>
18+
<seeInField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{customerData.postcode}}" stepKey="assertZipPostalCodeInCartEstimateShippingAndTaxSection"/>
19+
</actionGroup>
20+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Assert Shipping Method Is Checked on Cart -->
12+
<actionGroup name="StorefrontAssertCartShippingMethodSelectedActionGroup">
13+
<arguments>
14+
<argument name="carrierCode" type="string"/>
15+
<argument name="methodCode" type="string"/>
16+
</arguments>
17+
<seeCheckboxIsChecked selector="{{CheckoutCartSummarySection.shippingMethodElementId(carrierCode, methodCode)}}" stepKey="assertShippingMethodIsChecked"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)