Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFTF: Fix failing CMS tests due to PageBuilder conflict #27325

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
<group value="WYSIWYGDisabled"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!--Create Simple Product and Category -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!--Create Simple Product and Category -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
<requiredEntity createDataKey="createCategory"/>
Expand All @@ -37,6 +38,9 @@
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewOne">
<argument name="customStore" value="customStoreEN"/>
</actionGroup>

<magentoCron stepKey="runCronIndex" groups="index"/>

<!-- Set Stores > Configurations > Catalog > Recently Viewed/Compared Products > Show for Current = store view-->
<magentoCLI command="config:set {{RecentlyViewedProductScopeStore.path}} {{RecentlyViewedProductScopeStore.value}}" stepKey="RecentlyViewedProductScopeStore"/>
</before>
Expand All @@ -63,31 +67,29 @@
</actionGroup>

<!-- Logout Admin -->
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCacheAfterDeletion"/>

</after>

<!--Create widget for recently viewed products-->
<!--Create widget for recently viewed products-->
<actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContentBefore">
<argument name="content" value="{{CmsHomePageContent.content}}"/>
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
<argument name="content" value="{{CmsHomePageContent.content}}"/>
<argument name="pageId" value="{{CmsHomePageContent.page_id}}"/>
</actionGroup>

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

<actionGroup ref="AdminInsertRecentlyViewedWidgetActionGroup" stepKey="insertRecentlyViewedWidget">
<argument name="attributeSelector1" value="show_attributes"/>
<argument name="attributeSelector2" value="show_buttons"/>
<argument name="productAttributeSection1" value="1"/>
<argument name="productAttributeSection2" value="4"/>
<argument name="buttonToShowSection1" value="1"/>
<argument name="buttonToShowSection2" value="3"/>
<argument name="attributeSelector1" value="show_attributes"/>
<argument name="attributeSelector2" value="show_buttons"/>
<argument name="productAttributeSection1" value="1"/>
<argument name="productAttributeSection2" value="4"/>
<argument name="buttonToShowSection1" value="1"/>
<argument name="buttonToShowSection2" value="3"/>
</actionGroup>

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

<!-- Navigate to product 3 on store front -->
Expand All @@ -97,7 +99,7 @@
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/>
<waitForPageLoad time="30" stepKey="homeWaitForPageLoad"/>

<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
<argument name="productPosition" value="2"/>
</actionGroup>
Expand All @@ -106,7 +108,7 @@
<argument name="productPosition" value="1"/>
</actionGroup>

<!-- Switch store view -->
<!-- Switch store view -->
<waitForPageLoad time="40" stepKey="waitForStorefrontPageLoad"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewActionGroup">
<argument name="storeView" value="customStoreEN"/>
Expand All @@ -130,9 +132,9 @@
</actionGroup>

<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct3"/>
<assertNotContains stepKey="assertNotSeeProduct3">
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
<assertNotContains stepKey="assertNotSeeProduct3">
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
ihor-sviziev marked this conversation as resolved.
Show resolved Hide resolved
</assertNotContains>

<actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminEditCMSPageContentActionGroup">
<arguments>
<argument name="content" type="string" />
<argument name="pageId" type="string" />
<argument name="content" type="string"/>
<argument name="pageId" type="string"/>
</arguments>
<amOnPage url="{{AdminCmsPageEditPage.url(pageId)}}" stepKey="navigateToEditCMSPage"/>

<amOnPage url="{{AdminCmsPageEditPage.url(pageId)}}" stepKey="navigateToEditCMSPage"/>
<waitForPageLoad stepKey="waitForCmsPageEditPage"/>
<conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/>
<conditionalClick selector="{{CmsNewPagePageContentSection.header}}" dependentSelector="{{CmsNewPagePageContentSection.contentHeading}}" visible="false" stepKey="expandContentTab"/>
<waitForPageLoad time="30" stepKey="waitForPageLoadContentSection"/>
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/>
<waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/>
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{content}}" stepKey="resetCMSPageToDefaultContent"/>
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
<argument name="buttonToShowSection1" type="string" defaultValue="1"/>
<argument name="buttonToShowSection2" type="string" defaultValue="3" />
</arguments>
<click selector="{{CmsNewPagePageActionsSection.contentSectionName}}" stepKey="expandContent"/>
<waitForPageLoad time="50" stepKey="waitForPageLoadContentSection"/>
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="true" stepKey="clickNextShowHideEditorIfVisible"/>

<conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisible"/>
<waitForPageLoad time="30" stepKey="waitForPageLoadContentSection"/>
<conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/>
<waitForElementVisible selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="waitForInsertWidgetElement"/>
<click selector="{{CatalogWidgetSection.insertWidgetButton}}" stepKey="clickInsertWidget"/>
<waitForElementVisible selector="{{InsertWidgetSection.widgetTypeDropDown}}" time="30" stepKey="waitForWidgetTypeDropDownVisible"/>
Expand All @@ -32,9 +33,9 @@
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetToSave"/>
<waitForPageLoad time="30" stepKey="waitForWidgetInsertPageLoad"/>
<!-- Check that widget is inserted -->
<waitForElementVisible selector="#cms_page_form_content" stepKey="checkCMSContent" time="30"/>
<waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="checkCMSContent" time="30"/>
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickNextSave"/>
<waitForPageLoad stepKey="waitForPageActionSave" time="30"/>
<waitForElementVisible selector="*[data-ui-id='messages-message-success']" time="60" stepKey="waitForSaveSuccess"/>
</actionGroup>
</actionGroups>
</actionGroups>