Skip to content

Commit 4a25fff

Browse files
committed
MC-2258: Automate MFTF
Add verification for block disabling
1 parent 8a78e0f commit 4a25fff

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,66 @@
9393
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
9494
<see userInput="$$createPreReqBlock.content$$" stepKey="seeBlockContentOnCmsStage"/>
9595
</test>
96+
<test name="VerifyBlockDisabled">
97+
<annotations>
98+
<features value="Pagebuilder: Block"/>
99+
<stories value="MC-1420: Static Block"/>
100+
<title value="Block - Verify disabled block does not show on the stage or on storefront" />
101+
<description value="Verify that disabled block instance is not rendered on the stage or on the storefront" />
102+
<severity value="CRITICAL" />
103+
<testCaseId value="MC-2288" />
104+
<group value="pagebuilder" />
105+
<group value="pagebuilder-block" />
106+
<group value="VerifyBlockDisabled" />
107+
</annotations>
108+
<before>
109+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin" />
110+
<actionGroup ref="enablePageBuilderSetting" stepKey="enablePageBuilderSetting" />
111+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
112+
<createData entity="_defaultBlock" stepKey="createPreReqBlock" />
113+
</before>
114+
<after>
115+
<deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" />
116+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
117+
<actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/>
118+
<actionGroup ref="logout" stepKey="logout"/>
119+
</after>
120+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage">
121+
<argument name="CMSPage" value="$$createCMSPage$$"/>
122+
</actionGroup>
123+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupInteractive">
124+
<argument name="group" value="PageBuilderBlockContentType"/>
125+
</actionGroup>
126+
<actionGroup ref="dragContentTypeToStageAndExpectEditPanel" stepKey="dragBlockIntoStage">
127+
<argument name="contentType" value="PageBuilderBlockContentType"/>
128+
</actionGroup>
129+
<seeElement selector="{{BlockOnStage.title('Not Selected')}}" stepKey="seeNotSelectedBlock"/>
130+
<actionGroup ref="searchBlockInGrid" stepKey="searchBlockInGrid">
131+
<argument name="block" value="$$createPreReqBlock$$"/>
132+
</actionGroup>
133+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
134+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
135+
136+
<!-- Disable block -->
137+
<comment userInput="Disable block" stepKey="commentDisableBlock" />
138+
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage">
139+
<argument name="CMSBlockPage" value="$$createPreReqBlock$$" />
140+
</actionGroup>
141+
<executeJS function="jQuery(document.evaluate(`{{BlockNewPageBasicFieldsSection.isActive('1')}}`, document.body).iterateNext()).click()" stepKey="disableBlock" />
142+
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="saveBlock" />
143+
144+
<!-- Go back to CMS page and assert it shows as disabled on stage -->
145+
<comment userInput="Go back to CMS page and assert it shows as disabled on stage" stepKey="commentAssertBlockDisabledOnStage" />
146+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPageAfterDisablingBlock">
147+
<argument name="CMSPage" value="$$createCMSPage$$" />
148+
</actionGroup>
149+
<seeElement selector="{{BlockOnStage.status('Block disabled')}}" stepKey="seeDisabledBlockPlaceholder" />
150+
151+
<!-- Go to CMS page on storefront and assert disabled block does not exist on page -->
152+
<comment userInput="Go to CMS page on storefront and assert disabled block does not exist on page" stepKey="commentAssertDisabledBlockMissingOnStorefront" />
153+
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnStorefrontCMSPage" />
154+
<dontSeeElement selector="{{BlockOnStorefront.base('1')}}" stepKey="doNotSeeBlockElementOnStorefront" />
155+
</test>
96156
<test name="BlockDelete">
97157
<annotations>
98158
<features value="Pagebuilder"/>

0 commit comments

Comments
 (0)