Skip to content

Commit 6f4bd94

Browse files
committed
Merge remote-tracking branch 'origin/MC-24243' into 2.4-develop-pr11
2 parents 8a2288e + 7a0c9cd commit 6f4bd94

10 files changed

+236
-0
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductControlsAreNotVisibleWithoutHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Not Visible On Category Page Without Hover on Product</description>
13+
</annotations>
14+
15+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsNotVisible"/>
16+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsNotVisible"/>
17+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsNotVisible"/>
18+
</actionGroup>
19+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductControlsAreVisibleOnHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Visible on Category Page on Hover on Product</description>
13+
</annotations>
14+
15+
<seeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsVisible"/>
16+
<seeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsVisible"/>
17+
<seeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsVisible"/>
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
</arguments>
1414
<!-- Open category page on storefront -->
1515
<amOnPage url="{{StorefrontCategoryPage.url(category.custom_attributes[url_key])}}" stepKey="navigateStorefrontCategoryPage"/>
16+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
1617
</actionGroup>
1718
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<element name="ProductItemInfo" type="button" selector=".product-item-info"/>
1818
<element name="specifiedProductItemInfo" type="button" selector="//a[@class='product-item-link'][contains(text(), '{{var1}}')]" parameterized="true"/>
1919
<element name="AddToCartBtn" type="button" selector="button.action.tocart.primary"/>
20+
<element name="addToCartButtonProductInfoHover" type="button" selector=".product-item-info:hover button.action.tocart.primary" timeout="30"/>
21+
<element name="addToWishListIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.towishlist" timeout="30"/>
22+
<element name="addToCompareIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.tocompare" timeout="30"/>
2023
<element name="addToCartProductBySku" type="button" selector="//form[@data-product-sku='{{productSku}}']//button[contains(@class, 'tocart')]" parameterized="true" />
2124
<element name="SuccessMsg" type="button" selector="div.message-success"/>
2225
<element name="productCount" type="text" selector="#toolbar-amount"/>
@@ -27,6 +30,7 @@
2730
<element name="productLink" type="text" selector="a.product-item-link" timeout="30"/>
2831
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
2932
<element name="productPrice" type="text" selector=".price-final_price"/>
33+
<element name="productPriceByName" type="text" selector="//a[contains(text(), '{{productName}}')]//ancestor::div[contains(@class, 'product-item-info')]//span[contains(@class, 'price')]" parameterized="true"/>
3034
<element name="categoryImage" type="text" selector=".category-image"/>
3135
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
3236
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminFillCatalogProductsListWidgetCategoryActionGroup">
12+
<annotations>
13+
<description>Fill catalog products list widget category.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/>
18+
</arguments>
19+
20+
<waitForElementVisible selector="{{WidgetSection.AddParam}}" stepKey="waitForAddParamElement"/>
21+
<click selector="{{WidgetSection.AddParam}}" stepKey="clickOnAddParamElement"/>
22+
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}" stepKey="waitForConditionsDropdownVisible"/>
23+
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="Category" stepKey="selectCategoryAsCondition"/>
24+
<waitForElementVisible selector="{{WidgetSection.RuleParam}}" stepKey="waitForRuleParamElementVisible"/>
25+
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickToAddRuleParam"/>
26+
<click selector="{{WidgetSection.Chooser}}" stepKey="clickToSelectFromList"/>
27+
<waitForPageLoad stepKey="waitForPageLoadAfterSelectingRuleParam"/>
28+
<waitForElementVisible selector="{{WidgetSection.PreCreateCategory(categoryName)}}" stepKey="waitForCategoryElementVisible"/>
29+
<click selector="{{WidgetSection.PreCreateCategory(categoryName)}}" stepKey="selectCategoryFromArguments"/>
30+
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyButton"/>
31+
<waitForElementNotVisible selector="{{InsertWidgetSection.categoryTreeWrapper}}" stepKey="waitForCategoryTreeIsNotVisible"/>
32+
</actionGroup>
33+
</actionGroups>

app/code/Magento/CatalogWidget/Test/Mftf/Section/CatalogWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="conditionOperator" type="button" selector="#conditions__1--{{arg3}}__operator" parameterized="true"/>
2323
<element name="checkElementStorefrontByPrice" type="button" selector="//*[@class='product-items widget-product-grid']//*[contains(text(),'${{arg4}}.00')]" parameterized="true"/>
2424
<element name="checkElementStorefrontByName" type="button" selector="//*[@class='product-items widget-product-grid']//*[@class='product-item'][{{productPosition}}]//a[contains(text(), '{{productName}}')]" parameterized="true"/>
25+
<element name="categoryTreeWrapper" type="text" selector=".rule-chooser .tree.x-tree"/>
2526
</section>
2627
</sections>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontProductGridUIUpdatesOnDesktopTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="New products list widget"/>
15+
<title value="Storefront product grid UI updates on Desktop"/>
16+
<description value="Storefront product grid UI updates on Desktop"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-27569"/>
19+
<group value="catalog"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!-- 1. Create multiple products and assign to a category. -->
24+
<createData entity="ApiCategory" stepKey="createCategory"/>
25+
<createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
<createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct">
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
<createData entity="ApiSimpleProduct" stepKey="createFourthSimpleProduct">
35+
<requiredEntity createDataKey="createCategory"/>
36+
</createData>
37+
<!-- 2. Create new CMS page and add "Catalog Product List" widget type via content >insert widget option -->
38+
<createData entity="_emptyCmsPage" stepKey="createCmsPage"/>
39+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
40+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCmsPage">
41+
<argument name="CMSPage" value="$createCmsPage$"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContentActionGroup">
44+
<argument name="widgetType" value="Catalog Products List"/>
45+
</actionGroup>
46+
<actionGroup ref="AdminFillCatalogProductsListWidgetCategoryActionGroup" stepKey="fillCatalogProductsListWidgetOptions">
47+
<argument name="categoryName" value="$createCategory.name$"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetButton"/>
50+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveButton"/>
51+
</before>
52+
<after>
53+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
54+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
55+
<deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/>
56+
<deleteData createDataKey="createFourthSimpleProduct" stepKey="deleteFourthSimpleProduct"/>
57+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
58+
<deleteData createDataKey="createCmsPage" stepKey="deleteCmsPage"/>
59+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
60+
</after>
61+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateAndOpenCreatedCmsPage">
62+
<argument name="identifier" value="$createCmsPage.identifier$"/>
63+
</actionGroup>
64+
<actionGroup ref="AssertStorefrontProductControlsAreNotVisibleWithoutHoverActionGroup" stepKey="assertProductControlsAreNotVisibleWithoutHoverOnCmsPage"/>
65+
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($createFirstSimpleProduct.custom_attributes[url_key]$)}}" stepKey="assertProductName"/>
66+
<seeElement selector="{{StorefrontCategoryMainSection.productPriceByName($createFirstSimpleProduct.name$)}}" stepKey="assertProductPrice"/>
67+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName($createFirstSimpleProduct.name$)}}" stepKey="hoverProduct"/>
68+
<actionGroup ref="AssertStorefrontProductControlsAreVisibleOnHoverActionGroup" stepKey="assertProductControlsAreVisibleOnHoverOnCmsPage"/>
69+
<actionGroup ref="AssertStorefrontAddToWishListIconIsClickableForGuestUserActionGroup" stepKey="assertAddToWishListIconIsClickable"/>
70+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateAndOpenCreatedCmsPageToVerifyAddToCompareIconIsClickable">
71+
<argument name="identifier" value="$createCmsPage.identifier$"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontAddCategoryProductToCompareActionGroup" stepKey="assertAddToCompareIconIsClickable">
74+
<argument name="productVar" value="$createFirstSimpleProduct$"/>
75+
</actionGroup>
76+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateCategoryCreatedInPreconditions">
77+
<argument name="category" value="$createCategory$"/>
78+
</actionGroup>
79+
<actionGroup ref="AssertStorefrontProductControlsAreNotVisibleWithoutHoverActionGroup" stepKey="assertProductControlsAreNotVisibleWithoutHoverOnCategoryPage"/>
80+
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($createFirstSimpleProduct.custom_attributes[url_key]$)}}" stepKey="assertProductNameOnCategoryPage"/>
81+
<seeElement selector="{{StorefrontCategoryMainSection.productPriceByName($createFirstSimpleProduct.name$)}}" stepKey="assertProductPriceOnCategoryPage"/>
82+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName($createFirstSimpleProduct.name$)}}" stepKey="hoverProductOnCategoryPage"/>
83+
<actionGroup ref="AssertStorefrontProductControlsAreVisibleOnHoverActionGroup" stepKey="assertProductControlsAreVisibleOnHoverOnCategoryPage"/>
84+
<actionGroup ref="AssertStorefrontAddToWishListIconIsClickableForGuestUserActionGroup" stepKey="assertAddToWishListIconIsClickableOnCategoryPage"/>
85+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateCategoryCreatedInPreconditionsToVerifyAddToCompareIconIsClickable">
86+
<argument name="category" value="$createCategory$"/>
87+
</actionGroup>
88+
<actionGroup ref="StorefrontAddCategoryProductToCompareActionGroup" stepKey="assertAddToCompareIconIsClickableOnCategoryPage">
89+
<argument name="productVar" value="$createFirstSimpleProduct$"/>
90+
</actionGroup>
91+
<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clearAllCompareProducts"/>
92+
</test>
93+
</tests>
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="AdminClickInsertWidgetActionGroup">
12+
<annotations>
13+
<description>Click "Insert Widget" button in the opened widget popup</description>
14+
</annotations>
15+
16+
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetButton"/>
17+
<waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForWidgetPopupDisappear"/>
18+
</actionGroup>
19+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminInsertWidgetToCmsPageContentActionGroup">
12+
<annotations>
13+
<description>Insert widget to CMS Page content field. You are on CMS edit page, content tab is expanded.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="widgetType" type="string" defaultValue="CMS Page Link"/>
18+
</arguments>
19+
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.insertWidget}}" stepKey="waitForInsertWidgetElementVisible"/>
20+
<click selector="{{CmsNewPagePageActionsSection.insertWidget}}" stepKey="clickOnInsertWidgetButton"/>
21+
<waitForPageLoad stepKey="waitForPageLoadAfterClickOnInsertWidgetButton"/>
22+
<waitForElementVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForInsertWidgetTitle"/>
23+
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="{{widgetType}}" stepKey="selectWidgetType"/>
24+
</actionGroup>
25+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertStorefrontAddToWishListIconIsClickableForGuestUserActionGroup">
12+
<annotations>
13+
<description>Assert "Add to Wish List" icon is clickable in category product listing</description>
14+
</annotations>
15+
16+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
17+
<click selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="clickOnAddToWishListIcon"/>
18+
<waitForElementVisible selector="{{StorefrontCustomerLoginMessagesSection.errorMessage}}" stepKey="waitForErrorMessageIsVisible"/>
19+
<see selector="{{StorefrontCustomerLoginMessagesSection.errorMessage}}" userInput="You must login or register to add items to your wishlist." stepKey="assertErrorMessage"/>
20+
<seeInCurrentUrl url="{{StorefrontCustomerSignInPage.url}}" stepKey="assertCustomerLoginPageUrl"/>
21+
</actionGroup>
22+
</actionGroups>

0 commit comments

Comments
 (0)