Skip to content

Commit 68416cb

Browse files
committed
Merge branch 'ACQE-7180' into ACQE-7152-mainline-functional-tests-deployment
2 parents ea4e601 + a067e2b commit 68416cb

6 files changed

+185
-6
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -50,5 +50,6 @@
5050
<element name="productNameWithPriceOrLabel" type="text" selector="//div[@class='product details product-item-details']//a[contains(text(),'{{ProductName}}')]//parent::strong/following-sibling::div//span[contains(text(),'{{PriceLabelOrPrice}}')]" parameterized="true"/>
5151
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
5252
<element name="productInOrderDisplay" type="text" selector="//li[@class='item product product-item'][{{index}}]//a[@class='product-item-link' and contains(text(),'{{product_name}}')]" parameterized="true"/>
53+
<element name="enableCookies" type="text" selector="//a//span[contains(text(),'Enable Cookies')]"/>
5354
</section>
5455
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminCreateCMSPageLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AdminCreateWidgetActionGroup. Creates a CMS Page link widget.</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{AdminNewWidgetSection.selectPage}}" stepKey="waitForSelectPageButtonToBeClickable"/>
16+
<click selector="{{AdminNewWidgetSection.selectPage}}" stepKey="clickSelectPage"/>
17+
<waitForPageLoad stepKey="WaitForPageLoad"/>
18+
<waitForElementClickable selector="{{AdminNewWidgetSection.enableCookies}}" stepKey="waitForEnableCookiesToBeClickable"/>
19+
<click selector="{{AdminNewWidgetSection.enableCookies}}" stepKey="clickenableCookies"/>
20+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" extends="AdminCreateWidgetActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget with two conditions.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="title" defaultValue="" type="string"/>
17+
<argument name="displayPageControl" defaultValue="0" type="string"/>
18+
<argument name="numberOfProductsToDisplay" defaultValue="10" type="string"/>
19+
<argument name="cacheLifetime" defaultValue="" type="string"/>
20+
<argument name="condition" defaultValue="SKU" type="string"/>
21+
<argument name="conditionsOperator" defaultValue="is one of" type="string"/>
22+
<argument name="conditionParameter" defaultValue="" type="string"/>
23+
<argument name="secondCondition" defaultValue="Price" type="string"/>
24+
<argument name="secondConditionOperator" defaultValue="equals or less than" type="string"/>
25+
<argument name="secondConditionParameter" defaultValue="10" type="string"/>
26+
</arguments>
27+
<waitForElementVisible selector="{{AdminNewWidgetSection.title}}" stepKey="waitForTitleFieldToBeVisible"/>
28+
<fillField selector="{{AdminNewWidgetSection.title}}" userInput="{{title}}" stepKey="fillTitleWidgetOption"/>
29+
<selectOption selector="{{AdminNewWidgetSection.displayPageControl}}" userInput="{{displayPageControl}}" stepKey="selectDisplayPageControl"/>
30+
<waitForElementVisible selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" stepKey="waitForNumberOfProductsToDisplayFieldToBeVisible"/>
31+
<fillField selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" userInput="{{numberOfProductsToDisplay}}" stepKey="fillNumberOfProductsToDisplay"/>
32+
<waitForElementVisible selector="{{AdminNewWidgetSection.cacheLifetime}}" stepKey="waitForCacheLifeTimeFieldToBeVisible"/>
33+
<fillField selector="{{AdminNewWidgetSection.cacheLifetime}}" userInput="{{cacheLifetime}}" stepKey="fillCacheLifetime"/>
34+
<waitForElementClickable selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="waitForAddNewConiditionToBeClickable"/>
35+
<click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewCondition"/>
36+
<selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{condition}}" stepKey="selectCondition"/>
37+
<waitForElementClickable selector="{{AdminNewWidgetSection.conditionOperator}}" stepKey="clickConditionsOperator234"/>
38+
<click selector="{{AdminNewWidgetSection.conditionOperator}}" stepKey="clickConditionsOperator"/>
39+
<selectOption selector="{{AdminNewWidgetSection.selectOperator}}" userInput="{{conditionsOperator}}" stepKey="selectConditionsOperator"/>
40+
<waitForElementClickable selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="waitForConiditionParameterToBeClickable"/>
41+
<click selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="clickConditionParameter"/>
42+
<waitForElementVisible selector="{{AdminNewWidgetSection.setRuleParameter}}" stepKey="waitForConditionParameterFieldToBeVisible"/>
43+
<fillField selector="{{AdminNewWidgetSection.setRuleParameter}}" userInput="{{conditionParameter}}" stepKey="fillConditionParameter"/>
44+
<waitForElementClickable selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="waitForApplyConditionToBeClickable"/>
45+
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyCondition"/>
46+
<waitForElementClickable selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="waitForAddNewButtonToBeClickableForSecondCondition"/>
47+
<click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewForSecondCondition"/>
48+
<selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{secondCondition}}" stepKey="selectSecondCondition"/>
49+
<waitForPageLoad stepKey="waitForConditionsOperator"/>
50+
<waitForElementClickable selector="{{AdminNewWidgetSection.secondConditionOperator}}" stepKey="waitForSecondConditionsOperatorToBeClickable"/>
51+
<click selector="{{AdminNewWidgetSection.secondConditionOperator}}" stepKey="clickSecondConditionsOperator"/>
52+
<selectOption selector="{{AdminNewWidgetSection.secondSelectOperator}}" userInput="{{secondConditionOperator}}" stepKey="selectSecondConditionsOperator"/>
53+
<waitForElementClickable selector="{{AdminNewWidgetSection.secondRuleParameter}}" stepKey="waitForSecondRuleParameterToBeClickable"/>
54+
<click selector="{{AdminNewWidgetSection.secondRuleParameter}}" stepKey="clickSecondRuleParameter"/>
55+
<waitForElementVisible selector="{{AdminNewWidgetSection.setSecondRuleParameter}}" stepKey="waitForSecondConditionParameterToBeVisible"/>
56+
<fillField selector="{{AdminNewWidgetSection.setSecondRuleParameter}}" userInput="{{secondConditionParameter}}" stepKey="fillSecondConditionParameter"/>
57+
</actionGroup>
58+
</actionGroups>

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -69,4 +69,16 @@
6969
<data key="display_on">All Pages</data>
7070
<data key="container">Main Content Area</data>
7171
</entity>
72+
<entity name="CmsPageLinkWidget" type="widget">
73+
<data key="type">CMS Page Link</data>
74+
<data key="design_theme">Magento Luma</data>
75+
<data key="name" unique="suffix">TestWidget</data>
76+
<data key="sort_order">0</data>
77+
<array key="store_ids">
78+
<item>All Store Views</item>
79+
</array>
80+
<data key="display_on">All Pages</data>
81+
<data key="container">Main Content Area</data>
82+
<data key="template">CMS Page Link Block template</data>
83+
</entity>
7284
</entities>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -60,6 +60,12 @@
6060
<element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/>
6161
<element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
6262
<element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
63+
<element name="secondConditionOperator" type="button" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][1]"/>
64+
<element name="secondSelectOperator" type="button" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][1]/..//span//select"/>
65+
<element name="secondRuleParameter" type="select" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][2]"/>
66+
<element name="setSecondRuleParameter" type="input" selector="#conditions__1--2__value"/>
67+
<element name="selectPage" type="button" selector="//span[contains(text(),'Select Page')]"/>
68+
<element name="enableCookies" type="button" selector="//tbody//tr//td[contains(text(),'Enable Cookies')]"/>
6369
</section>
6470
</sections>
6571

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!--
2+
/**
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
5+
*/
6+
-->
7+
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminAddTwoPlusWidgetsInOneContainerTest">
11+
<annotations>
12+
<features value="Widget"/>
13+
<stories value="content widgets"/>
14+
<title value="Add multiple widgets in one container"/>
15+
<description value="Test for adding multiple widgets in a single container and verifying the functionality on the storefront"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4400"/>
18+
</annotations>
19+
<before>
20+
<!-- 1. Create multiple products and assign to a category. -->
21+
<createData entity="ApiCategory" stepKey="createCategory"/>
22+
<createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
<field key="price">9</field>
25+
</createData>
26+
<createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
<field key="price">1</field>
29+
</createData>
30+
<createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
<field key="price">10</field>
33+
</createData>
34+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
35+
<actionGroup ref="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" stepKey="createProductListWidget">
36+
<argument name="widget" value="CatalogProductsListWidget"/>
37+
<argument name="title" value="Some Title"/>
38+
<argument name="displayPageControl" value="1"/>
39+
<argument name="numberOfProductsToDisplay" value="10"/>
40+
<argument name="condition" value="SKU"/>
41+
<argument name="conditionsOperator" value="is one of"/>
42+
<argument name="conditionParameter" value="$createFirstSimpleProduct.sku$,$createSecondSimpleProduct.sku$"/>
43+
</actionGroup>
44+
<actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveWidgetAndContinue"/>
45+
<actionGroup ref="AdminCreateCMSPageLinkWidgetActionGroup" stepKey="createCMSPageWidget">
46+
<argument name="widget" value="CmsPageLinkWidget"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveCMSWidget"/>
49+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
50+
<argument name="indices" value=""/>
51+
</actionGroup>
52+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
53+
<argument name="tags" value=""/>
54+
</actionGroup>
55+
</before>
56+
<after>
57+
<!--Delete widget catalog product list-->
58+
<actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCatalogProductList">
59+
<argument name="widget" value="CatalogProductsListWidget"/>
60+
</actionGroup>
61+
<actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCMSPageLink">
62+
<argument name="widget" value="CmsPageLinkWidget"/>
63+
</actionGroup>
64+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
65+
<!--Delete first simple product-->
66+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
67+
<!--Delete second simple product-->
68+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
69+
<!--Delete third simple product-->
70+
<deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/>
71+
<!--Logout from Admin-->
72+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
73+
</after>
74+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
75+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createFirstSimpleProduct.name$$)}}" stepKey="assertFirstSimpleProduct"/>
76+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSecondSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProduct"/>
77+
<waitForElementNotVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createThirdSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProductIsNotAvaiable"/>
78+
<waitForElement selector="{{StorefrontCategoryMainSection.enableCookies}}" stepKey="assertCookiesLinkIsAvailable"/>
79+
</test>
80+
</tests>

0 commit comments

Comments
 (0)