Skip to content

Commit

Permalink
ENGCOM-7256: MFTF: Fix failing CMS tests due to PageBuilder conflict #…
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka committed Apr 15, 2020
2 parents 1427495 + 153c06f commit 0c152e3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StoreFrontRecentlyViewedAtStoreViewLevelTest">
<annotations>
<stories value="Recently Viewed Product"/>
Expand All @@ -19,7 +19,7 @@
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<!--Create Simple Product and Category -->
<!--Create Simple Product and Category -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
<requiredEntity createDataKey="createCategory"/>
Expand All @@ -37,6 +37,8 @@
<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 Down Expand Up @@ -66,36 +68,34 @@
<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 -->
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore1ProductPage2"/>
<amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStore1ProductPage3"/>
<!-- Go to Home Page -->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage"/>
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
<actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2">
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
<argument name="productPosition" value="2"/>
</actionGroup>
Expand All @@ -104,7 +104,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 @@ -126,9 +126,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>
</assertNotContains>

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

<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct1"/>
<assertNotContains stepKey="assertNotSeeProduct1">
<actualResult type="const">$grabDontSeeHomeProduct1</actualResult>
<expectedResult type="const">$$createSimpleProduct1.name$$</expectedResult>
<actualResult type="const">$grabDontSeeHomeProduct1</actualResult>
<expectedResult type="const">$$createSimpleProduct1.name$$</expectedResult>
</assertNotContains>
</test>
</tests>
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>

0 comments on commit 0c152e3

Please sign in to comment.