Skip to content

Commit 0c152e3

Browse files
authored
ENGCOM-7256: MFTF: Fix failing CMS tests due to PageBuilder conflict #27325
2 parents 1427495 + 153c06f commit 0c152e3

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="StoreFrontRecentlyViewedAtStoreViewLevelTest">
1111
<annotations>
1212
<stories value="Recently Viewed Product"/>
@@ -19,7 +19,7 @@
1919
</annotations>
2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22-
<!--Create Simple Product and Category -->
22+
<!--Create Simple Product and Category -->
2323
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
2424
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
2525
<requiredEntity createDataKey="createCategory"/>
@@ -37,6 +37,8 @@
3737
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewOne">
3838
<argument name="customStore" value="customStoreEN"/>
3939
</actionGroup>
40+
<magentoCron stepKey="runCronIndex" groups="index"/>
41+
4042
<!-- Set Stores > Configurations > Catalog > Recently Viewed/Compared Products > Show for Current = store view-->
4143
<magentoCLI command="config:set {{RecentlyViewedProductScopeStore.path}} {{RecentlyViewedProductScopeStore.value}}" stepKey="RecentlyViewedProductScopeStore"/>
4244
</before>
@@ -66,36 +68,34 @@
6668
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
6769
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
6870
<magentoCLI command="cache:flush" stepKey="flushCacheAfterDeletion"/>
69-
7071
</after>
7172

72-
<!--Create widget for recently viewed products-->
73+
<!--Create widget for recently viewed products-->
7374
<actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContentBefore">
74-
<argument name="content" value="{{CmsHomePageContent.content}}"/>
75-
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
75+
<argument name="content" value="{{CmsHomePageContent.content}}"/>
76+
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
7677
</actionGroup>
7778

7879
<amOnPage url="{{AdminCmsPageEditPage.url(CmsHomePageContent.page_id)}}" stepKey="navigateToEditHomePagePage"/>
7980
<waitForPageLoad time="50" stepKey="waitForContentPageToLoad"/>
8081

8182
<actionGroup ref="AdminInsertRecentlyViewedWidgetActionGroup" stepKey="insertRecentlyViewedWidget">
82-
<argument name="attributeSelector1" value="show_attributes"/>
83-
<argument name="attributeSelector2" value="show_buttons"/>
84-
<argument name="productAttributeSection1" value="1"/>
85-
<argument name="productAttributeSection2" value="4"/>
86-
<argument name="buttonToShowSection1" value="1"/>
87-
<argument name="buttonToShowSection2" value="3"/>
83+
<argument name="attributeSelector1" value="show_attributes"/>
84+
<argument name="attributeSelector2" value="show_buttons"/>
85+
<argument name="productAttributeSection1" value="1"/>
86+
<argument name="productAttributeSection2" value="4"/>
87+
<argument name="buttonToShowSection1" value="1"/>
88+
<argument name="buttonToShowSection2" value="3"/>
8889
</actionGroup>
8990

90-
<!-- Warm up cache -->
9191
<magentoCLI command="cache:flush" stepKey="flushCacheAfterWidgetCreated"/>
9292

9393
<!-- Navigate to product 3 on store front -->
9494
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore1ProductPage2"/>
9595
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStore1ProductPage3"/>
9696
<!-- Go to Home Page -->
9797
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage"/>
98-
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
98+
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
9999
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
100100
<argument name="productPosition" value="2"/>
101101
</actionGroup>
@@ -104,7 +104,7 @@
104104
<argument name="productPosition" value="1"/>
105105
</actionGroup>
106106

107-
<!-- Switch store view -->
107+
<!-- Switch store view -->
108108
<waitForPageLoad time="40" stepKey="waitForStorefrontPageLoad"/>
109109
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewActionGroup">
110110
<argument name="storeView" value="customStoreEN"/>
@@ -126,9 +126,9 @@
126126
</actionGroup>
127127

128128
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct3"/>
129-
<assertNotContains stepKey="assertNotSeeProduct3">
130-
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
131-
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
129+
<assertNotContains stepKey="assertNotSeeProduct3">
130+
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
131+
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
132132
</assertNotContains>
133133

134134
<actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/>
@@ -145,8 +145,8 @@
145145

146146
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct1"/>
147147
<assertNotContains stepKey="assertNotSeeProduct1">
148-
<actualResult type="const">$grabDontSeeHomeProduct1</actualResult>
149-
<expectedResult type="const">$$createSimpleProduct1.name$$</expectedResult>
148+
<actualResult type="const">$grabDontSeeHomeProduct1</actualResult>
149+
<expectedResult type="const">$$createSimpleProduct1.name$$</expectedResult>
150150
</assertNotContains>
151151
</test>
152152
</tests>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminEditCMSPageContentActionGroup.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminEditCMSPageContentActionGroup">
1212
<arguments>
13-
<argument name="content" type="string" />
14-
<argument name="pageId" type="string" />
13+
<argument name="content" type="string"/>
14+
<argument name="pageId" type="string"/>
1515
</arguments>
16-
<amOnPage url="{{AdminCmsPageEditPage.url(pageId)}}" stepKey="navigateToEditCMSPage"/>
16+
17+
<amOnPage url="{{AdminCmsPageEditPage.url(pageId)}}" stepKey="navigateToEditCMSPage"/>
1718
<waitForPageLoad stepKey="waitForCmsPageEditPage"/>
18-
<conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/>
19+
<conditionalClick selector="{{CmsNewPagePageContentSection.header}}" dependentSelector="{{CmsNewPagePageContentSection.contentHeading}}" visible="false" stepKey="expandContentTab"/>
20+
<waitForPageLoad time="30" stepKey="waitForPageLoadContentSection"/>
21+
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/>
1922
<waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/>
2023
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{content}}" stepKey="resetCMSPageToDefaultContent"/>
2124
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminInsertRecentlyViewedWidgetActionGroup.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
<argument name="buttonToShowSection1" type="string" defaultValue="1"/>
1717
<argument name="buttonToShowSection2" type="string" defaultValue="3" />
1818
</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"/>
19+
20+
<conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisible"/>
21+
<waitForPageLoad time="30" stepKey="waitForPageLoadContentSection"/>
22+
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/>
2223
<waitForElementVisible selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="waitForInsertWidgetElement"/>
2324
<click selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="clickInsertWidget"/>
2425
<waitForElementVisible selector="{{InsertWidgetSection.widgetTypeDropDown}}" time="30" stepKey="waitForWidgetTypeDropDownVisible"/>
@@ -32,9 +33,9 @@
3233
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetToSave"/>
3334
<waitForPageLoad time="30" stepKey="waitForWidgetInsertPageLoad"/>
3435
<!-- Check that widget is inserted -->
35-
<waitForElementVisible selector="#cms_page_form_content" stepKey="checkCMSContent" time="30"/>
36+
<waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="checkCMSContent" time="30"/>
3637
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickNextSave"/>
3738
<waitForPageLoad stepKey="waitForPageActionSave" time="30"/>
3839
<waitForElementVisible selector="*[data-ui-id='messages-message-success']" time="60" stepKey="waitForSaveSuccess"/>
3940
</actionGroup>
40-
</actionGroups>
41+
</actionGroups>

0 commit comments

Comments
 (0)