Skip to content

Commit fed3784

Browse files
committed
MC-3328: Add Missing P0-P1 MFTF Tests For PageBuilder On CMS Block
- Adding save cms block action group - updating tests to use createData
1 parent e9a086d commit fed3784

File tree

3 files changed

+66
-52
lines changed

3 files changed

+66
-52
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/AdminActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
<waitForElementNotVisible selector="{{PageBuilderStage.stageLoading}}" stepKey="waitForStageLoadingGraphicNotVisible"/>
3333
<waitForElementVisible time="30" selector="{{RowOnStage.base(rowIndex)}}" stepKey="waitForPageBuilderRow"/>
3434
</actionGroup>
35+
<actionGroup name="saveCMSBlock">
36+
<!-- This goes in CE repo -->
37+
<waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/>
38+
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/>
39+
<waitForPageLoad stepKey="waitForPageLoad"/>
40+
<see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/>
41+
</actionGroup>
3542
<actionGroup name="saveAndContinueEditCmsPage">
3643
<!-- This goes in CE repo -->
3744
<waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/>

app/code/Magento/PageBuilder/Test/Mftf/Data/CmsPageData.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
</entity>
2020
<entity name="_emptyCmsPage" type="cms_page">
2121
<!-- This goes in CE repo -->
22-
<data key="title">Test CMS Page</data>
22+
<data key="title" unique="suffix">Test CMS Page</data>
2323
<data key="identifier" unique="suffix">test-page-</data>
2424
</entity>
25+
<entity name="_emptyCmsBlock" type="block">
26+
<!-- This goes in CE repo -->
27+
<data key="title" unique="suffix">Test CMS Block</data>
28+
<data key="identifier" unique="suffix" >block</data>
29+
<data key="active">true</data>
30+
</entity>
2531
</entities>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBlockTest.xml

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,8 @@
18661866
<before>
18671867
<comment userInput="---merging to remove step---" stepKey="createPreReqCategory"/>
18681868
<comment userInput="---merging to remove step---" stepKey="createProduct"/>
1869-
<createData entity="_defaultBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
1869+
<createData entity="_emptyCmsBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
1870+
<createData entity="_emptyCmsPage" stepKey="createCMSPage" after="createPreReqBlock"/>
18701871
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedProductEditPage">
18711872
<argument name="CMSBlockPage" value="$$createPreReqBlock$$" />
18721873
</actionGroup>
@@ -1875,21 +1876,20 @@
18751876
</before>
18761877
<after>
18771878
<deleteData createDataKey="createPreReqBlock" stepKey="deleteCreatedProduct"/>
1878-
<comment userInput="---merging to remove step---" stepKey="deleteCreatedCategory"/>
1879+
<deleteData createDataKey="createCMSPage" stepKey="deleteCreatedCategory"/>
18791880
<comment userInput="---merging to remove step---" stepKey="NavigateToAndResetProductGridToDefaultView"/>
18801881
</after>
18811882
<comment userInput="---merging to remove step---" stepKey="exitPageBuilderFullScreen"/>
1882-
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="saveProduct"/>
1883+
<actionGroup ref="saveCMSBlock" stepKey="saveProduct"/>
18831884
<comment userInput="---merging to remove step---" stepKey="expandAdminProductSection"/>
18841885
<comment userInput="---merging to remove step---" stepKey="openPageBuilderForDescription"/>
18851886
<!-- Go to CMS Page and choose Block -->
18861887
<comment userInput="Go to CMS Page and choose Block" stepKey="commentGoToCMSPage" after="seeBackgroundColorSlide2StageAfterSave"/>
1887-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder" after="commentGoToCMSPage"/>
1888-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToAPageWithPageBuilder"/>
1889-
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle" after="switchToPageBuilderStage">
1890-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1888+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage" after="commentGoToCMSPage">
1889+
<argument name="CMSPage" value="$$createCMSPage$$"/>
18911890
</actionGroup>
1892-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="enterPageTitle">
1891+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToCreatedCMSPage"/>
1892+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="switchToPageBuilderStage">
18931893
<argument name="group" value="PageBuilderBlockContentType"/>
18941894
</actionGroup>
18951895
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockIntoStage" after="expandGroupAddContent">
@@ -1902,10 +1902,17 @@
19021902
<argument name="block" value="$$createPreReqBlock$$"/>
19031903
</actionGroup>
19041904
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings" after="searchBlockInGrid"/>
1905-
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage" after="saveEditPanelSettings"/>
1906-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStageAfterSave" after="saveAndContinueEditCmsPage"/>
1907-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToProductStorefront">
1908-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1905+
<!-- Validate CMS Page Stage -->
1906+
<comment userInput="Validate CMS Page Stage" stepKey="commentValidateCMSPageStage" after="saveEditPanelSettings"/>
1907+
<seeNumberOfElements selector="{{RowOnStorefront.allRows}}" userInput="3" stepKey="see3RowsCMSPageStage" after="commentValidateCMSPageStage"/>
1908+
<seeElement selector="{{RowOnStorefront.backgroundColor('3', PageBuilderBackgroundColor_Hex_Grey.rgb)}}" stepKey="seeBackgroundColorRowCMSPageStage" after="see3RowsCMSPageStage"/>
1909+
<seeNumberOfElements selector="{{ColumnOnFrontend.allColumns}}" userInput="2" stepKey="see2ColumnsCMSPageStage" after="seeBackgroundColorRowCMSPageStage"/>
1910+
<seeElement selector="{{ColumnOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Hex_White.rgb)}}" stepKey="seeBackgroundColorColumnCMSPageStage" after="see2ColumnsCMSPageStage"/>
1911+
<seeElement selector="{{SlideOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Plaintext_Green.rgb)}}" stepKey="seeBackgroundColorSlide1CMSPageStage" after="seeBackgroundColorColumnCMSPageStage"/>
1912+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage" after="seeBackgroundColorSlide1CMSPageStage"/>
1913+
<!-- Validate CMS Page Storefront -->
1914+
<actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToProductStorefront">
1915+
<argument name="page" value="$$createCMSPage.identifier$$"/>
19091916
</actionGroup>
19101917
<comment userInput="---merging to remove step---" stepKey="scrollToProductDescription"/>
19111918
<seeNumberOfElements selector="{{RowOnStorefront.allRows}}" userInput="3" stepKey="see2RowsStorefront"/>
@@ -1931,7 +1938,8 @@
19311938
<before>
19321939
<comment userInput="---merging to remove step---" stepKey="createPreReqCategory"/>
19331940
<comment userInput="---merging to remove step---" stepKey="createProduct"/>
1934-
<createData entity="_defaultBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
1941+
<createData entity="_emptyCmsBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
1942+
<createData entity="_emptyCmsPage" stepKey="createCMSPage" after="createPreReqBlock"/>
19351943
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedProductEditPage">
19361944
<argument name="CMSBlockPage" value="$$createPreReqBlock$$" />
19371945
</actionGroup>
@@ -1940,21 +1948,20 @@
19401948
</before>
19411949
<after>
19421950
<deleteData createDataKey="createPreReqBlock" stepKey="deleteCreatedProduct"/>
1943-
<comment userInput="---merging to remove step---" stepKey="deleteCreatedCategory"/>
1951+
<deleteData createDataKey="createCMSPage" stepKey="deleteCreatedCategory"/>
19441952
<comment userInput="---merging to remove step---" stepKey="NavigateToAndResetProductGridToDefaultView"/>
19451953
</after>
19461954
<comment userInput="---merging to remove step---" stepKey="exitPageBuilderFullScreen"/>
1947-
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="saveProduct"/>
1955+
<actionGroup ref="saveCMSBlock" stepKey="saveProduct"/>
19481956
<comment userInput="---merging to remove step---" stepKey="expandAdminProductSection"/>
19491957
<comment userInput="---merging to remove step---" stepKey="openPageBuilderForDescription"/>
19501958
<!-- Go to CMS Page and choose Block -->
19511959
<comment userInput="Go to CMS Page and choose Block" stepKey="commentGoToCMSPage" after="validateDividerPositionAfterSave"/>
1952-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder" after="commentGoToCMSPage"/>
1953-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToAPageWithPageBuilder"/>
1954-
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle" after="switchToPageBuilderStage">
1955-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1960+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage" after="commentGoToCMSPage">
1961+
<argument name="CMSPage" value="$$createCMSPage$$"/>
19561962
</actionGroup>
1957-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="enterPageTitle">
1963+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToCreatedCMSPage"/>
1964+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="switchToPageBuilderStage">
19581965
<argument name="group" value="PageBuilderBlockContentType"/>
19591966
</actionGroup>
19601967
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockIntoStage" after="expandGroupAddContent">
@@ -1968,9 +1975,9 @@
19681975
</actionGroup>
19691976
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings" after="searchBlockInGrid"/>
19701977
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage" after="saveEditPanelSettings"/>
1971-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStageAfterSave" after="saveAndContinueEditCmsPage"/>
1972-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToProductStorefront">
1973-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1978+
<!-- Validate CMS Page Storefront -->
1979+
<actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToProductStorefront">
1980+
<argument name="page" value="$$createCMSPage.identifier$$"/>
19741981
</actionGroup>
19751982
<comment userInput="---merging to remove step---" stepKey="scrollToProductDescription"/>
19761983
</test>
@@ -1992,7 +1999,8 @@
19921999
<before>
19932000
<comment userInput="---merging to remove step---" stepKey="createPreReqCategory"/>
19942001
<comment userInput="---merging to remove step---" stepKey="createProduct"/>
1995-
<createData entity="_defaultBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
2002+
<createData entity="_emptyCmsBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
2003+
<createData entity="_emptyCmsPage" stepKey="createCMSPage" after="createPreReqBlock"/>
19962004
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedProductEditPage">
19972005
<argument name="CMSBlockPage" value="$$createPreReqBlock$$" />
19982006
</actionGroup>
@@ -2001,24 +2009,20 @@
20012009
</before>
20022010
<after>
20032011
<deleteData createDataKey="createPreReqBlock" stepKey="deleteCreatedProduct"/>
2004-
<comment userInput="---merging to remove step---" stepKey="deleteCreatedCategory"/>
2012+
<deleteData createDataKey="createCMSPage" stepKey="deleteCreatedCategory"/>
20052013
<comment userInput="---merging to remove step---" stepKey="NavigateToAndResetProductGridToDefaultView"/>
20062014
</after>
2007-
<actionGroup ref="removeContentTypeFromStage" stepKey="removeContentTypeFromStage" after="commentEditRow">
2008-
<argument name="contentType" value="PageBuilderHtmlContentType"/>
2009-
</actionGroup>
20102015
<comment userInput="---merging to remove step---" stepKey="exitPageBuilderFullScreen"/>
2011-
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="saveProduct"/>
2016+
<actionGroup ref="saveCMSBlock" stepKey="saveProduct"/>
20122017
<comment userInput="---merging to remove step---" stepKey="expandAdminProductSection"/>
20132018
<comment userInput="---merging to remove step---" stepKey="openPageBuilderForDescription"/>
20142019
<!-- Go to CMS Page and choose Block -->
20152020
<comment userInput="Go to CMS Page and choose Block" stepKey="commentGoToCMSPage" after="seeBackgroundColorOnEditPanel"/>
2016-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder" after="commentGoToCMSPage"/>
2017-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToAPageWithPageBuilder"/>
2018-
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle" after="switchToPageBuilderStage">
2019-
<argument name="contentType" value="PageBuilderBlockContentType"/>
2021+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage" after="commentGoToCMSPage">
2022+
<argument name="CMSPage" value="$$createCMSPage$$"/>
20202023
</actionGroup>
2021-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="enterPageTitle">
2024+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToCreatedCMSPage"/>
2025+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="switchToPageBuilderStage">
20222026
<argument name="group" value="PageBuilderBlockContentType"/>
20232027
</actionGroup>
20242028
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockIntoStage" after="expandGroupAddContent">
@@ -2032,9 +2036,9 @@
20322036
</actionGroup>
20332037
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings" after="searchBlockInGrid"/>
20342038
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage" after="saveEditPanelSettings"/>
2035-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStageAfterSave" after="saveAndContinueEditCmsPage"/>
2036-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToProductStorefront">
2037-
<argument name="contentType" value="PageBuilderBlockContentType"/>
2039+
<!-- Validate CMS Page Storefront -->
2040+
<actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToProductStorefront">
2041+
<argument name="page" value="$$createCMSPage.identifier$$"/>
20382042
</actionGroup>
20392043
<comment userInput="---merging to remove step---" stepKey="scrollToProductDescription"/>
20402044
<seeElement selector="{{RowOnStorefront.backgroundColor('2', PageBuilderBackgroundColor_Hex_Grey.rgb)}}" stepKey="seeBackgroundColorRowStorefront"/>
@@ -2056,7 +2060,8 @@
20562060
<before>
20572061
<comment userInput="---merging to remove step---" stepKey="createPreReqCategory"/>
20582062
<comment userInput="---merging to remove step---" stepKey="createProduct"/>
2059-
<createData entity="_defaultBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
2063+
<createData entity="_emptyCmsBlock" stepKey="createPreReqBlock" after="loginAsAdmin"/>
2064+
<createData entity="_emptyCmsPage" stepKey="createCMSPage" after="createPreReqBlock"/>
20602065
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedProductEditPage">
20612066
<argument name="CMSBlockPage" value="$$createPreReqBlock$$" />
20622067
</actionGroup>
@@ -2065,24 +2070,20 @@
20652070
</before>
20662071
<after>
20672072
<deleteData createDataKey="createPreReqBlock" stepKey="deleteCreatedProduct"/>
2068-
<comment userInput="---merging to remove step---" stepKey="deleteCreatedCategory"/>
2073+
<deleteData createDataKey="createCMSPage" stepKey="deleteCreatedCategory"/>
20692074
<comment userInput="---merging to remove step---" stepKey="NavigateToAndResetProductGridToDefaultView"/>
20702075
</after>
2071-
<actionGroup ref="removeContentTypeFromStage" stepKey="removeContentTypeFromStage" after="commentEditRow">
2072-
<argument name="contentType" value="PageBuilderHtmlContentType"/>
2073-
</actionGroup>
20742076
<comment userInput="---merging to remove step---" stepKey="exitPageBuilderFullScreen"/>
2075-
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="saveProduct"/>
2077+
<actionGroup ref="saveCMSBlock" stepKey="saveProduct"/>
20762078
<comment userInput="---merging to remove step---" stepKey="expandAdminProductSection"/>
20772079
<comment userInput="---merging to remove step---" stepKey="openPageBuilderForDescription"/>
20782080
<!-- Go to CMS Page and choose Block -->
20792081
<comment userInput="Go to CMS Page and choose Block" stepKey="commentGoToCMSPage" after="seeBackgroundColorRow2StageAfterSave"/>
2080-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder" after="commentGoToCMSPage"/>
2081-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToAPageWithPageBuilder"/>
2082-
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle" after="switchToPageBuilderStage">
2083-
<argument name="contentType" value="PageBuilderBlockContentType"/>
2082+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage" after="commentGoToCMSPage">
2083+
<argument name="CMSPage" value="$$createCMSPage$$"/>
20842084
</actionGroup>
2085-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="enterPageTitle">
2085+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" after="navigateToCreatedCMSPage"/>
2086+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupAddContent" after="switchToPageBuilderStage">
20862087
<argument name="group" value="PageBuilderBlockContentType"/>
20872088
</actionGroup>
20882089
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockIntoStage" after="expandGroupAddContent">
@@ -2096,9 +2097,9 @@
20962097
</actionGroup>
20972098
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings" after="searchBlockInGrid"/>
20982099
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage" after="saveEditPanelSettings"/>
2099-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStageAfterSave" after="saveAndContinueEditCmsPage"/>
2100-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToProductStorefront">
2101-
<argument name="contentType" value="PageBuilderBlockContentType"/>
2100+
<!-- Validate CMS Page Storefront -->
2101+
<actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToProductStorefront">
2102+
<argument name="page" value="$$createCMSPage.identifier$$"/>
21022103
</actionGroup>
21032104
<comment userInput="---merging to remove step---" stepKey="scrollToProductDescription"/>
21042105
<seeNumberOfElements selector="{{RowOnStorefront.allRows}}" userInput="3" stepKey="see2RowsStorefront"/>

0 commit comments

Comments
 (0)