Skip to content

Commit 6e76b38

Browse files
authored
Merge pull request #4301 from magento-tsg/2.2-develop-mftf-pr16
[TSG] MFTF for 2.2 (pr16) (2.2-develop)
2 parents f6ef0c7 + 9bf47a5 commit 6e76b38

File tree

54 files changed

+1303
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1303
-56
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminConfirmationModalSection.xml

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

99
<sections 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/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminConfirmationModalSection">
1212
<element name="title" type="text" selector="aside.confirm .modal-title"/>
1313
<element name="message" type="text" selector="aside.confirm .modal-content"/>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
12+
<fillField selector="{{AdminCatalogProductWidgetSection.productsToDisplay}}" userInput="{{widget.products_to_display}}" stepKey="fillNumberOfProductsToDisplay"/>
13+
<selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/>
14+
<selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/>
15+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
16+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessageAppears"/>
17+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
18+
</actionGroup>
19+
</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>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Add Product to Compare from the category page and check message -->
1212
<actionGroup name="StorefrontAddCategoryProductToCompareActionGroup">
1313
<arguments>
@@ -59,12 +59,12 @@
5959

6060
<!-- Clear the compare list -->
6161
<actionGroup name="StorefrontClearCompareActionGroup">
62-
<waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/>
63-
<click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
64-
<waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/>
65-
<scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/>
66-
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/>
67-
<waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/>
68-
<waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/>
62+
<waitForElementVisible selector="{{StorefrontComparisonSidebarSection.clearAll}}" time="30" stepKey="waitForClearAll"/>
63+
<click selector="{{StorefrontComparisonSidebarSection.clearAll}}" stepKey="clickClearAll"/>
64+
<waitForElementVisible selector="{{StorefrontModalConfirmationSection.okButton}}" stepKey="waitForClearOk"/>
65+
<click selector="{{StorefrontModalConfirmationSection.okButton}}" stepKey="clickClearOk"/>
66+
<waitForElementVisible selector="{{StorefrontMessagesSection.successMessage}}" stepKey="waitAssertMessageCleared"/>
67+
<see selector="{{StorefrontMessagesSection.successMessage}}" userInput="You cleared the comparison list." stepKey="assertMessageCleared"/>
68+
<waitForElementVisible selector="{{StorefrontComparisonSidebarSection.noItemsMessage}}" stepKey="assertNoItems"/>
6969
</actionGroup>
7070
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Check the simple product on the product page -->
1212
<actionGroup name="StorefrontCheckSimpleProduct">
1313
<arguments>
@@ -22,4 +22,16 @@
2222
<see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/>
2323
<see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/>
2424
</actionGroup>
25-
</actionGroups>
25+
26+
<!-- Assert option image and price in storefront product page -->
27+
<actionGroup name="AssertOptionImageAndPriceInStorefrontProductActionGroup">
28+
<arguments>
29+
<argument name="label" type="string"/>
30+
<argument name="image" type="string"/>
31+
<argument name="price" type="string"/>
32+
</arguments>
33+
<selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption"/>
34+
<seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/>
35+
<see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/>
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,26 @@
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+
<data key="products_to_display">5</data>
25+
</entity>
26+
<entity name="RecentlyViewedProductsWidget" type="widget">
27+
<data key="type">Recently Viewed Products</data>
28+
<data key="design_theme">Magento Luma</data>
29+
<data key="name" unique="suffix">Recently Viewed Products</data>
30+
<array key="store_ids">
31+
<item>All Store Views</item>
32+
</array>
33+
<data key="display_on">All Pages</data>
34+
<data key="container">Sidebar Additional</data>
35+
<data key="products_to_display">5</data>
36+
</entity>
1537
</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: 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="AdminCatalogProductWidgetSection">
12+
<element name="productsToDisplay" type="input" selector="input[name='parameters[page_size]']"/>
13+
<element name="productAttributesToShow" type="multiselect" selector="select[name='parameters[show_attributes][]']"/>
14+
<element name="productButtonsToShow" type="multiselect" selector="select[name='parameters[show_buttons][]']"/>
15+
</section>
16+
</sections>

0 commit comments

Comments
 (0)