Skip to content

Commit b91e1e4

Browse files
committed
MC-3065: Automate MFTF for MC-1364
1 parent 4877c82 commit b91e1e4

File tree

3 files changed

+53
-36
lines changed

3 files changed

+53
-36
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
@@ -71,4 +71,11 @@
7171
<dontSee userInput="Enable Advanced CMS" stepKey="dontSeeEnableAdvancedCMSBtn"/>
7272
<dontSee selector="{{PageBuilderPanel.generalGroup}}" stepKey="seePageBuilderVisible"/>
7373
</actionGroup>
74+
<actionGroup name="enablePageBuilderOnCatalog">
75+
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
76+
<!--See PageBuilder fullsize-->
77+
<comment userInput="See PageBuilder fullsize" stepKey="commentSeePageBuilderFullsize"/>
78+
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
79+
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
80+
</actionGroup>
7481
</actionGroups>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="fillOutUrlInput">
1212
<arguments>
13-
<argument name="fieldName" defaultValue="button_link"/>
14-
<argument name="linkName" defaultValue="ExternalLink.page"/>
15-
<argument name="searchString" defaultValue="ExternalLinkSearch.page"/>
13+
<argument name="fieldName" defaultValue=""/>
14+
<argument name="linkName" defaultValue=""/>
15+
<argument name="searchString" defaultValue=""/>
1616
<argument name="searchResult"/>
1717
</arguments>
1818
<waitForElementVisible selector="{{PageBuilderSection.LinkSelect('fieldName')}}" stepKey="waitForButtonLinkSelect"/>
@@ -22,13 +22,12 @@
2222
<waitForElementVisible selector="{{PageBuilderSection.LinkDropdown}}" stepKey="waitButtonLinkDropdownInput" />
2323
<seeElement selector="{{PageBuilderSection.LinkDropdown}}" stepKey="seeButtonLinkDropdownInput" />
2424
<click selector="{{PageBuilderSection.LinkDropdown}}" stepKey="expandButtonLinkDropdownInput1" />
25-
<see userInput="$$createCMSPageA.title$$" stepKey="seeCMSPageA"/>
2625
<!--Type 2 first letters into Search box-->
2726
<click selector="{{PageBuilderSection.LinkSearch}}" stepKey="focusOnField"/>
2827
<fillField selector="{{PageBuilderSection.LinkSearch}}" userInput="{{searchString}}" stepKey="fill2FirstLetters"/>
2928
<waitForElementVisible selector="{{PageBuilderSection.SearchResult(searchResult)}}" stepKey="waitForSearchResult" />
3029
<seeElement selector="{{PageBuilderSection.SearchResult(searchResult)}}" stepKey="seeCMSPageAOnSearchResult"/>
31-
<click selector="{{PageBuilderSection.SearchResult(searchResult)}}" stepKey="clickCMSPageAXOnSearchResult"/>
30+
<click selector="{{PageBuilderSection.SearchResult(searchResult)}}" stepKey="selectResult"/>
3231
<dontSee selector="{{PageBuilderSection.SearchResultBox}}" stepKey="dropdownCollapses" />
3332
<grabTextFrom selector="{{PageBuilderSection.DropdownInput}}" stepKey="textFromDropDown1"/>
3433
<assertEquals stepKey="assertEquals1" message="pass">
@@ -39,8 +38,9 @@
3938
<actionGroup name="verifyCmsPageLinkOnFrontend">
4039
<arguments>
4140
<argument name="identifier"/>
41+
<argument name="index"/>
4242
</arguments>
43-
<scrollTo selector="{{ButtonItemOnStorefront.base('1')}}" stepKey="waitForButtonElementStorefront"/>
43+
<scrollTo selector="{{ButtonItemOnStorefront.base('index')}}" stepKey="waitForButtonElementStorefront"/>
4444
<seeElement selector="{{PageBuilderPageOnStoreFrontSection.CMSPageLink(identifier)}}" stepKey="seePageLinkOnStoreFront" />
4545
<click selector="{{PageBuilderPageOnStoreFrontSection.CMSPageLink(identifier)}}" stepKey="clickButton"/>
4646
<waitForPageLoad stepKey="waitForPageLoad"/>

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

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,8 @@
12781278
<test name="AdminPageBuilderProductDirectivesTest">
12791279
<annotations>
12801280
<features value="PageBuilder"/>
1281-
<stories value="Always Render Magento directives on Magento Storefront for Product"/>
1282-
<title value="Always Render Magento directives on Magento Storefront for Product"/>
1281+
<stories value="Common Tests"/>
1282+
<title value="Magento Directives - Always render Magento Directives on Magento Storefront for Product"/>
12831283
<description value="Admin are able to add CMS Page link, image, variable, widget into PageBuilder content and see it Product Page"/>
12841284
<severity value="CRITICAL"/>
12851285
<useCaseId value="MC-1364"/>
@@ -1289,21 +1289,21 @@
12891289
<group value="pagebuilder-urlInput"/>
12901290
</annotations>
12911291
<before>
1292-
<magentoCLI command="config:set general/store_information/country_id US" stepKey="setDefaultGridSize"/>
1292+
<magentoCLI command="config:set general/store_information/country_id US" stepKey="setValueForCountryVariable"/>
12931293
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
12941294
<createData entity="_newDefaultProduct" stepKey="createPreReqProduct">
12951295
<requiredEntity createDataKey="createPreReqCategory"/>
12961296
</createData>
12971297
<createData entity="simpleCmsPage" stepKey="createCMSPageA" />
1298+
<createData entity="simpleCmsPage" stepKey="createCMSPageB" />
12981299
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1299-
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
13001300
</before>
13011301
<after>
13021302
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory" />
13031303
<deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" />
1304-
<deleteData createDataKey="createCMSPageA" stepKey="deletePreReqCmsPage" />
1304+
<deleteData createDataKey="createCMSPageA" stepKey="deletePreReqCmsPageA" />
1305+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCmsPageB" />
13051306
<actionGroup ref="logout" stepKey="logout"/>
1306-
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
13071307
</after>
13081308
<!--Go to Product Page-->
13091309
<comment userInput="Go to Product Page" stepKey="goToProductPage"/>
@@ -1312,25 +1312,29 @@
13121312
<click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab"/>
13131313
<waitForElementVisible selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="waitForPageBuilderBtn" />
13141314
<see userInput="Edit with Page Builder" stepKey="seePageBuilderBtn"/>
1315-
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
1316-
<!--See PageBuilder fullsize-->
1317-
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
1318-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
1315+
<actionGroup ref="enablePageBuilderOnCatalog" stepKey="enablePageBuilderOnCatalog"/>
13191316
<!--Add button into PageBuilder-->
13201317
<comment userInput="Add button into PageBuilder" stepKey="addButtonIntoPageBuilder"/>
1321-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderButtonsContentType.name)}}" selector2="{{PageBuilderStage.dropAreaInStage}}" stepKey="dropContentTypeIntoStage"/>
1318+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonIntoStage">
1319+
<argument name="contentType" value="PageBuilderButtonsContentType"/>
1320+
</actionGroup>
13221321
<actionGroup ref="openPageBuilderEditPanelSmallByIndex" stepKey="openEditMenuOnStage1">
13231322
<argument name="section" value="ButtonItemOnStage"/>
13241323
<argument name="targetIndex" value="1"/>
13251324
</actionGroup>
13261325
<!--Choose cms page link type-->
13271326
<actionGroup ref="fillOutUrlInput" stepKey="choosePageLink">
1327+
<argument name="fieldName" value="button_link"/>
1328+
<argument name="linkName" value="ExternalLink.page"/>
1329+
<argument name="searchString" value="ExternalLinkSearch.page"/>
13281330
<argument name="searchResult" value="$$createCMSPageA.title$$"/>
13291331
</actionGroup>
13301332
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
13311333
<!--Add image into PageBuilder-->
13321334
<comment userInput="Add image into PageBuilder" stepKey="addImageIntoPageBuilder"/>
1333-
<click selector="{{PageBuilderPanel.mediaGroup}}" stepKey="clickMediaGroup"/>
1335+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1336+
<argument name="group" value="PageBuilderImageContentType"/>
1337+
</actionGroup>
13341338
<actionGroup ref="dragContentTypeToStage" stepKey="dragImageIntoStage">
13351339
<argument name="contentType" value="PageBuilderImageContentType"/>
13361340
</actionGroup>
@@ -1353,7 +1357,7 @@
13531357
<comment userInput="Add widget into Text content" stepKey="addWidgetIntoTextContent"/>
13541358
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
13551359
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
1356-
<argument name="page" value="$$createCMSPageA.identifier$$"/>
1360+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
13571361
</actionGroup>
13581362
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
13591363
<waitForElementVisible time="5" selector="{{PageBuilderStage.exitFullScreen}}" stepKey="waitForExitFullScreen" />
@@ -1366,18 +1370,19 @@
13661370
<waitForPageLoad stepKey="waitForPageLoad5"/>
13671371
<scrollTo selector="{{StorefrontProductInfoDetailsSection.detailsTab}}" stepKey="scrollToDetailsTab"/>
13681372
<see userInput="US" stepKey="verifyCountryVariableName" />
1369-
<see userInput="$$createCMSPageA.title$$" stepKey="verifyWidget" />
1373+
<see userInput="$$createCMSPageB.title$$" stepKey="verifyWidget" />
13701374
<waitForElementVisible selector="{{ImageOnStorefront.imageSourceByIndex('1', PageBuilderImageProperty_StageJPG.fileName)}}" stepKey="seeImage2SourceOnStorefront"/>
13711375
<actionGroup ref="verifyCmsPageLinkOnFrontend" stepKey="checkButtonOnStoreFront">
13721376
<argument name="identifier" value="$$createCMSPageA.identifier$$"/>
1377+
<argument name="index" value="1"/>
13731378
</actionGroup>
13741379
<see userInput="$$createCMSPageA.title$$" stepKey="seePageName" />
13751380
</test>
13761381
<test name="AdminPageBuilderCategoryDirectivesTest">
13771382
<annotations>
13781383
<features value="PageBuilder"/>
1379-
<stories value="Always Render Magento directives on Magento Storefront for Category"/>
1380-
<title value="Always Render Magento directives on Magento Storefront for Category"/>
1384+
<stories value="Common Tests"/>
1385+
<title value="Magento Directives - Always render Magento Directives on Magento Storefront for Category"/>
13811386
<description value="Admin are able to add CMS Page link, image, variable, widget into PageBuilder content and see it Category Page"/>
13821387
<severity value="CRITICAL"/>
13831388
<testCaseId value="MMC-3173"/>
@@ -1387,17 +1392,17 @@
13871392
<group value="pagebuilder-urlInput"/>
13881393
</annotations>
13891394
<before>
1390-
<magentoCLI command="config:set general/store_information/country_id US" stepKey="setDefaultGridSize"/>
1395+
<magentoCLI command="config:set general/store_information/country_id US" stepKey="setValueForCountryVariable"/>
13911396
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
13921397
<createData entity="simpleCmsPage" stepKey="createCMSPageA" />
1398+
<createData entity="simpleCmsPage" stepKey="createCMSPageB" />
13931399
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1394-
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
13951400
</before>
13961401
<after>
13971402
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory" />
1398-
<deleteData createDataKey="createCMSPageA" stepKey="deletePreReqCmsPage" />
1403+
<deleteData createDataKey="createCMSPageA" stepKey="deletePreReqCmsPageA" />
1404+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCmsPageB" />
13991405
<actionGroup ref="logout" stepKey="logout"/>
1400-
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
14011406
</after>
14021407
<!--Go to Category Page-->
14031408
<comment userInput="Go to Category Page" stepKey="goToCategoryPage"/>
@@ -1406,25 +1411,30 @@
14061411
<click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="clickContentTab"/>
14071412
<waitForElementVisible selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="waitForPageBuilderBtn" />
14081413
<see userInput="Edit with Page Builder" stepKey="seePageBuilderBtn"/>
1409-
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
1410-
<!--See PageBuilder fullsize-->
1411-
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
1412-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
1414+
<actionGroup ref="enablePageBuilderOnCatalog" stepKey="enablePageBuilderOnCatalog"/>
14131415
<!--Add button to PageBuilder-->
14141416
<comment userInput="Add button to PageBuilder" stepKey="addButtonToPageBuilder"/>
1415-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderButtonsContentType.name)}}" selector2="{{PageBuilderStage.dropAreaInStage}}" stepKey="dropContentTypeIntoStage"/>
1417+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonIntoStage">
1418+
<argument name="contentType" value="PageBuilderButtonsContentType"/>
1419+
</actionGroup>
14161420
<actionGroup ref="openPageBuilderEditPanelSmallByIndex" stepKey="openEditMenuOnStage1">
14171421
<argument name="section" value="ButtonItemOnStage"/>
14181422
<argument name="targetIndex" value="1"/>
14191423
</actionGroup>
14201424
<!--Choose cms page link type-->
1425+
<comment stepKey="commentChooseCmsPageLinkType" userInput="Choose cms page link type"/>
14211426
<actionGroup ref="fillOutUrlInput" stepKey="choosePageLink">
1427+
<argument name="fieldName" value="button_link"/>
1428+
<argument name="linkName" value="ExternalLink.page"/>
1429+
<argument name="searchString" value="ExternalLinkSearch.page"/>
14221430
<argument name="searchResult" value="$$createCMSPageA.title$$"/>
14231431
</actionGroup>
14241432
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings1"/>
14251433
<!--Add image to PageBuilder-->
14261434
<comment userInput="Add image to PageBuilder" stepKey="addImageToPageBuilder"/>
1427-
<click selector="{{PageBuilderPanel.mediaGroup}}" stepKey="clickMediaGroup"/>
1435+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1436+
<argument name="group" value="PageBuilderImageContentType"/>
1437+
</actionGroup>
14281438
<actionGroup ref="dragContentTypeToStage" stepKey="dragImageIntoStage">
14291439
<argument name="contentType" value="PageBuilderImageContentType"/>
14301440
</actionGroup>
@@ -1447,24 +1457,24 @@
14471457
<comment userInput="Add widget to PageBuilder" stepKey="addWidgetToPageBuilder"/>
14481458
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
14491459
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
1450-
<argument name="page" value="$$createCMSPageA.identifier$$"/>
1460+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
14511461
</actionGroup>
14521462
<click selector="{{EditPanelForm.editFormSave}}" stepKey="clickSaveColumn"/>
14531463
<waitForElementNotVisible time="5" selector="{{EditPanelForm.editForm}}" stepKey="waitForEditFormNotVisible" />
14541464
<waitForElementVisible time="5" selector="{{PageBuilderStage.exitFullScreen}}" stepKey="waitForExitFullScreen" />
14551465
<click selector="{{PageBuilderStage.exitFullScreen}}" stepKey="exitPageBuilderFullScreen" />
14561466
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
14571467
<waitForPageLoad stepKey="waitForPageLoad2" />
1458-
<comment userInput="Verify directives on category store front" stepKey="commentVerifyDirectivesOnStorefront"/>
14591468
<!--Go to storefront to verify Category Link-->
1460-
<comment userInput="Verify directive link on Storefront" stepKey="verifyDirectiveLinkOnStorefront"/>
1469+
<comment userInput="Verify directives on category store front" stepKey="commentVerifyDirectivesOnStorefront"/>
14611470
<amOnPage url="$$createPreReqCategory.name$$.html" stepKey="navigateToProductPage"/>
14621471
<waitForPageLoad stepKey="waitForPageLoad3" />
14631472
<see userInput="US" stepKey="verifyCountryVariableName" />
1464-
<see userInput="$$createCMSPageA.title$$" stepKey="verifyWidget" />
1473+
<see userInput="$$createCMSPageB.title$$" stepKey="verifyWidget" />
14651474
<waitForElementVisible selector="{{ImageOnStorefront.imageSourceByIndex('1', PageBuilderImageProperty_StageJPG.fileName)}}" stepKey="seeImage2SourceOnStorefront"/>
14661475
<actionGroup ref="verifyCmsPageLinkOnFrontend" stepKey="checkButtonOnStoreFront">
14671476
<argument name="identifier" value="$$createCMSPageA.identifier$$"/>
1477+
<argument name="index" value="1"/>
14681478
</actionGroup>
14691479
<see userInput="$$createCMSPageA.title$$" stepKey="seePageName" />
14701480
</test>

0 commit comments

Comments
 (0)