Skip to content

Commit e8e94c9

Browse files
committed
Merge remote-tracking branch 'origin/MC-30769' into 2.3-develop-com-pr17
2 parents c4e0620 + 17aad85 commit e8e94c9

36 files changed

+2092
-330
lines changed
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="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup">
12+
<annotations>
13+
<description>Goes to the home Page Recently VIewed Product and Grab the Prdouct name and Position from it.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
<argument name="productPosition" type="string"/>
18+
</arguments>
19+
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="grabRelatedProductPosition"/>
20+
<assertContains expected="{{productName}}" actual="$grabRelatedProductPosition" stepKey="assertRelatedProductName"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="RecentlyViewedProductScopeStore">
12+
<data key="path">catalog/recently_products/scope</data>
13+
<data key="value">store</data>
14+
</entity>
15+
<entity name="RecentlyViewedProductScopeWebsite">
16+
<data key="path">catalog/recently_products/scope</data>
17+
<data key="value">website</data>
18+
</entity>
19+
<entity name="RecentlyViewedProductScopeStoreGroup">
20+
<data key="path">catalog/recently_products/scope</data>
21+
<data key="value">group</data>
22+
</entity>
23+
</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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
12+
<section name="StoreFrontRecentlyViewedProductSection">
13+
<element name="ProductName" type="text" selector="//div[@class='products-grid']/ol/li[position()={{position}}]/div/div[@class='product-item-details']/strong/a" parameterized="true"/>
14+
</section>
15+
</sections>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StoreFrontRecentlyViewedAtStoreViewLevelTest">
11+
<annotations>
12+
<stories value="Recently Viewed Product"/>
13+
<title value="Recently Viewed Product at store view level"/>
14+
<description value="Recently Viewed Product should not be displayed on second store view, if configured as, Per Store View "/>
15+
<testCaseId value="MC-30453"/>
16+
<severity value="CRITICAL"/>
17+
<group value="catalog"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
21+
<!--Create Simple Product and Category -->
22+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<createData entity="SimpleProduct" stepKey="createSimpleProduct3">
30+
<requiredEntity createDataKey="createCategory"/>
31+
</createData>
32+
<createData entity="SimpleProduct" stepKey="createSimpleProduct4">
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
<!--Create storeView 1-->
36+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewOne">
37+
<argument name="customStore" value="customStoreEN"/>
38+
</actionGroup>
39+
<!-- Set Stores > Configurations > Catalog > Recently Viewed/Compared Products > Show for Current = store view-->
40+
<magentoCLI command="config:set {{RecentlyViewedProductScopeStore.path}} {{RecentlyViewedProductScopeStore.value}}" stepKey="RecentlyViewedProductScopeStore"/>
41+
</before>
42+
43+
<after>
44+
<!-- Delete Product and Category -->
45+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
46+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
47+
<deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/>
48+
<deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/>
49+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
50+
51+
<waitForPageLoad time="30" stepKey="waitForPageLoadWebSite"/>
52+
<magentoCLI command="config:set {{RecentlyViewedProductScopeWebsite.path}} {{RecentlyViewedProductScopeWebsite.value}}" stepKey="RecentlyViewedProductScopeWebsite"/>
53+
<!--Delete store views-->
54+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView">
55+
<argument name="customStore" value="customStoreEN"/>
56+
</actionGroup>
57+
58+
<!-- Clear Widget-->
59+
<actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContent">
60+
<argument name="content" value="{{CmsHomePageContent.content}}"/>
61+
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
62+
</actionGroup>
63+
64+
<!-- Logout Admin -->
65+
<actionGroup ref="logout" stepKey="logout"/>
66+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
67+
<magentoCLI command="cache:flush" stepKey="flushCacheAfterDeletion"/>
68+
69+
</after>
70+
71+
<!--Create widget for recently viewed products-->
72+
<actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContentBefore">
73+
<argument name="content" value="{{CmsHomePageContent.content}}"/>
74+
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
75+
</actionGroup>
76+
77+
<amOnPage url="{{AdminCmsPageEditPage.url(CmsHomePageContent.page_id)}}" stepKey="navigateToEditHomePagePage"/>
78+
<waitForPageLoad time="50" stepKey="waitForContentPageToLoad"/>
79+
80+
<actionGroup ref="AdminInsertRecentlyViewedWidgetActionGroup" stepKey="insertRecentlyViewedWidget">
81+
<argument name="attributeSelector1" value="show_attributes"/>
82+
<argument name="attributeSelector2" value="show_buttons"/>
83+
<argument name="productAttributeSection1" value="1"/>
84+
<argument name="productAttributeSection2" value="4"/>
85+
<argument name="buttonToShowSection1" value="1"/>
86+
<argument name="buttonToShowSection2" value="3"/>
87+
</actionGroup>
88+
89+
<!-- Warm up cache -->
90+
<magentoCLI command="cache:flush" stepKey="flushCacheAfterWidgetCreated"/>
91+
92+
<!-- Navigate to product 3 on store front -->
93+
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore1ProductPage2"/>
94+
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStore1ProductPage3"/>
95+
<!-- Go to Home Page -->
96+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/>
97+
<waitForPageLoad time="30" stepKey="homeWaitForPageLoad"/>
98+
99+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
100+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
101+
<argument name="productPosition" value="2"/>
102+
</actionGroup>
103+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct3">
104+
<argument name="productName" value="$$createSimpleProduct3.name$$"/>
105+
<argument name="productPosition" value="1"/>
106+
</actionGroup>
107+
108+
<!-- Switch store view -->
109+
<waitForPageLoad time="40" stepKey="waitForStorefrontPageLoad"/>
110+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewActionGroup">
111+
<argument name="storeView" value="customStoreEN"/>
112+
</actionGroup>
113+
114+
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.name$)}}" stepKey="goToStore2ProductPage1"/>
115+
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore2ProductPage2"/>
116+
117+
<!-- Go to Home Page -->
118+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStoreViewHomePage"/>
119+
<waitForPageLoad time="30" stepKey="homePageWaitForStoreView"/>
120+
121+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertNextStore1RecentlyViewedProduct1">
122+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
123+
<argument name="productPosition" value="2"/>
124+
</actionGroup>
125+
126+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertNextStore1RecentlyViewedProduct2">
127+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
128+
<argument name="productPosition" value="1"/>
129+
</actionGroup>
130+
131+
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct3"/>
132+
<assertNotContains expected="$$createSimpleProduct3.name$$" actual="$grabDontSeeHomeProduct3" stepKey="assertNotSeeProduct3"/>
133+
134+
<actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/>
135+
136+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertSwitchStore1RecentlyViewedProduct2">
137+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
138+
<argument name="productPosition" value="2"/>
139+
</actionGroup>
140+
141+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertSwitchStore1RecentlyViewedProduct3">
142+
<argument name="productName" value="$$createSimpleProduct3.name$$"/>
143+
<argument name="productPosition" value="1"/>
144+
</actionGroup>
145+
146+
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct1"/>
147+
<assertNotContains expected="$$createSimpleProduct1.name$$" actual="$grabDontSeeHomeProduct1" stepKey="assertNotSeeProduct1"/>
148+
</test>
149+
</tests>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminEditCMSPageContentActionGroup">
12+
<arguments>
13+
<argument name="content" type="string" />
14+
<argument name="pageId" type="string" />
15+
</arguments>
16+
<amOnPage url="{{AdminCmsPageEditPage.url(pageId)}}" stepKey="navigateToEditCMSPage"/>
17+
<waitForPageLoad stepKey="waitForCmsPageEditPage"/>
18+
<conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/>
19+
<waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/>
20+
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{content}}" stepKey="resetCMSPageToDefaultContent"/>
21+
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/>
22+
<waitForPageLoad stepKey="waitForSettingsApply"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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="AdminInsertRecentlyViewedWidgetActionGroup">
11+
<arguments>
12+
<argument name="attributeSelector1" type="string" defaultValue="show_attributes"/>
13+
<argument name="attributeSelector2" type="string" defaultValue="show_buttons"/>
14+
<argument name="productAttributeSection1" type="string" defaultValue="1"/>
15+
<argument name="productAttributeSection2" type="string" defaultValue="4" />
16+
<argument name="buttonToShowSection1" type="string" defaultValue="1"/>
17+
<argument name="buttonToShowSection2" type="string" defaultValue="3" />
18+
</arguments>
19+
<click selector="{{CmsNewPagePageActionsSection.contentSectionName}}" stepKey="expandContent"/>
20+
<waitForPageLoad time="50" stepKey="waitForPageLoadContentSection"/>
21+
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="true" stepKey="clickNextShowHideEditorIfVisible"/>
22+
<waitForElementVisible selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="waitForInsertWidgetElement"/>
23+
<click selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="clickInsertWidget"/>
24+
<waitForElementVisible selector="{{InsertWidgetSection.widgetTypeDropDown}}" time="30" stepKey="waitForWidgetTypeDropDownVisible"/>
25+
<!--Select "Widget Type"-->
26+
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Viewed Products" stepKey="selectRecentlyViewedProducts"/>
27+
<waitForPageLoad time="30" stepKey="waitForPageLoadWidgetType"/>
28+
<!--Select all product attributes-->
29+
<dragAndDrop selector1="{{AdminRecentlyViewedWidgetSection.attributeSelector(attributeSelector1,productAttributeSection1)}}" selector2="{{AdminRecentlyViewedWidgetSection.attributeSelector(attributeSelector1,productAttributeSection2)}}" stepKey="selectProductSpecifiedOptions"/>
30+
<!--Select all buttons to show-->
31+
<dragAndDrop selector1="{{AdminRecentlyViewedWidgetSection.attributeSelector(attributeSelector2,buttonToShowSection2)}}" selector2="{{AdminRecentlyViewedWidgetSection.attributeSelector(attributeSelector2,buttonToShowSection2)}}" stepKey="selectButtonSpecifiedOptions"/>
32+
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetToSave"/>
33+
<waitForPageLoad time="30" stepKey="waitForWidgetInsertPageLoad"/>
34+
<!-- Check that widget is inserted -->
35+
<waitForElementVisible selector="#cms_page_form_content" stepKey="checkCMSContent" time="30"/>
36+
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickNextSave"/>
37+
<waitForPageLoad stepKey="waitForPageActionSave" time="30"/>
38+
<waitForElementVisible selector="*[data-ui-id='messages-message-success']" time="60" stepKey="waitForSaveSuccess"/>
39+
</actionGroup>
40+
</actionGroups>
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CmsHomePageContent">
12+
<data key="content">CMS homepage content goes here</data>
13+
<data key="page_id">2</data>
14+
</entity>
15+
16+
</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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminRecentlyViewedWidgetSection">
12+
<element name="attributeSelector" type="multiselect" selector="select[name='parameters[{{attributeName}}][]'] option:nth-of-type({{attributePosition}})" parameterized="true"/>
13+
</section>
14+
</sections>

app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function convert($source)
4343
}
4444
}
4545
$policyConfig[$id]['hosts'] = array_unique($policyConfig[$id]['hosts']);
46-
$policyConfig[$id]['hashes'] = array_unique($policyConfig[$id]['hashes']);
4746
}
4847

4948
return $policyConfig;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"friendsofphp/php-cs-fixer": "~2.14.0",
9090
"lusitanian/oauth": "~0.8.10",
9191
"magento/magento-coding-standard": "*",
92-
"magento/magento2-functional-testing-framework": "2.6.2",
92+
"magento/magento2-functional-testing-framework": "~2.6.3",
9393
"pdepend/pdepend": "2.5.2",
9494
"phpcompatibility/php-compatibility": "^9.3",
9595
"phpmd/phpmd": "@stable",

0 commit comments

Comments
 (0)