Skip to content

Commit 658eaa2

Browse files
committed
MC-3091: Improve MFTF tests for Block Configuration
1 parent 2fc60cc commit 658eaa2

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@
2323
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
2424
<waitForElementVisible selector="{{BlockOnGrid.addSelectedBtn}}" stepKey="waitForAddSelected"/>
2525
<click selector="{{BlockOnGrid.addSelectedBtn}}" stepKey="clickAddSelected"/>
26-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear4"/>
2726
</actionGroup>
2827
<actionGroup name="verifyBlockOnStage">
2928
<arguments>
29+
<argument name="contentType"/>
3030
<argument name="block"/>
31+
<argument name="index"/>
3132
</arguments>
32-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderBlockContentType.role)}}" stepKey="onMouseOverContentTypeStage"/>
33-
<waitForElementVisible selector="{{BlockOnStage.title(block.title)}}" stepKey="wait"/>
33+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="10" y="0" stepKey="onMouseOverContentTypeStage"/>
34+
<waitForElementVisible selector="{{BlockOnStage.title('1', block.title)}}" stepKey="wait"/>
35+
<seeElement selector="{{BlockOnStage.title('1',block.title)}}" stepKey="seeOptionMenuTitle"/>
3436
<see userInput="{{block.content}}" stepKey="seeBlockContentOnStage"/>
3537
</actionGroup>
3638
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderBlockSection.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="BlockOnStage">
12-
<element name="html" type="text" selector="(//div[contains(@class,'pagebuilder-block')]//div[contains(@data-bind,'html: data.main.html')])[{{arg1}}]//a[contains(@class,'pagebuilder-button-primary')]" parameterized="true"/>
13-
<element name="status" type="text" selector="(//div[contains(@class,'pagebuilder-block')]//span[contains(@class,'placeholder') and text()='{{arg}}'])" parameterized="true"/>
14-
<element name="deleted" type="text" selector="(//div[contains(@class,'pagebuilder-block')]//span[contains(@class,'placeholder') and contains(text(),'Block with ID: {{arg}} doesn')])" parameterized="true"/>
15-
<element name="title" type="text" selector="(//div[contains(@class,'pagebuilder-block')])[1]//div[contains(@class,'pagebuilder-options-wrapper')]//div[contains(@class,'option-title') and text()='{{arg}}']" parameterized="true"/>
12+
<element name="html" type="text" selector="((//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//div[contains(@data-bind,'html: data.main.html')])[{{arg2}}]//a[contains(@class,'pagebuilder-button-primary')]" parameterized="true"/>
13+
<element name="status" type="text" selector="((//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//span[contains(@class,'placeholder') and text()='{{arg}}'])" parameterized="true"/>
14+
<element name="deleted" type="text" selector="((//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//span[contains(@class,'placeholder') and contains(text(),'Block with ID: {{arg}} doesn')])" parameterized="true"/>
15+
<element name="title" type="text" selector="(//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//div[contains(@class,'pagebuilder-options-wrapper')]//div[contains(@class,'option-title') and text()='{{arg}}']" parameterized="true"/>
1616
<element name="base" type="text" selector="(//div[contains(@class,'pagebuilder-block')])[{{arg1}}]" parameterized="true"/>
17-
<element name="hr" type="button" selector="(//div[contains(@class,'pagebuilder-block')]//div[@data-identifier])[{{arg1}}]//hr" parameterized="true"/>
17+
<element name="hr" type="button" selector="((//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//div[@data-identifier])[{{arg2}}]//hr" parameterized="true"/>
1818
<!-- Advanced Configuration -->
1919
<element name="alignment" type="text" selector="(//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//div[contains(@style,'text-align: {{arg2}};')]" parameterized="true"/>
2020
<element name="noAlignment" type="text" selector="(//div[contains(@class,'pagebuilder-block')])[{{arg1}}]//div[not(contains(@style,'text-align:'))]" parameterized="true"/>
@@ -42,7 +42,7 @@
4242
<element name="html" type="text" selector="(//div[@data-role='html'])[{{arg1}}]//a[contains(@class,'pagebuilder-button-primary')]" parameterized="true"/>
4343
<element name="base" type="text" selector="(//div[@data-role='row']/div)[{{arg1}}]" parameterized="true"/>
4444
<element name="hr" type="button" selector="(//div[@data-role='row']/div)[{{arg1}}]/hr" parameterized="true"/>
45-
<element name="blockContent" type="text" selector="//div[@data-role='block']//div[contains(@class,'block-static-block')]"/>
45+
<element name="empty" type="text" selector="//div[@data-role='block'][not(*)]"/>
4646
<!-- Advanced Configuration -->
4747
<element name="alignment" type="text" selector="(//div[@data-role='row']/div)[{{arg1}}][contains(@style,'text-align: {{arg2}};')]" parameterized="true"/>
4848
<element name="noAlignment" type="text" selector="(//div[@data-role='row']/div)[{{arg1}}][not(contains(@style,'text-align:'))]" parameterized="true"/>

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
<argument name="contentType" value="PageBuilderBlockContentType"/>
4242
</actionGroup>
4343
<actionGroup ref="closeEditPanelSettings" stepKey="closeSlideEditPanel"/>
44-
<waitForElementVisible selector="{{BlockOnStage.status('Empty Block')}}" stepKey="seeEmptyBlockPlaceHolder"/>
44+
<waitForElementVisible selector="{{BlockOnStage.status('1', 'Empty Block')}}" stepKey="seeEmptyBlockPlaceHolder"/>
4545
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
4646
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
4747
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
4848
<waitForPageLoad stepKey="waitForPageLoad"/>
49-
<dontSeeElement selector="{{BlockOnStorefront.blockContent}}" stepKey="seeBlockContentOnCmsStage"/>
49+
<seeElement selector="{{BlockOnStorefront.empty}}" stepKey="seeBlockContentOnCmsStage"/>
5050
</test>
5151
<test name="AddBlockToCmsPage">
5252
<annotations>
@@ -86,12 +86,16 @@
8686
<seeElement selector="{{BlockOnForm.title('$$createPreReqBlock.title$$')}}" stepKey="seeBlockTitleOnForm"/>
8787
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
8888
<actionGroup ref="verifyBlockOnStage" stepKey="verifyBlockOnStage">
89+
<argument name="contentType" value="PageBuilderBlockContentType"/>
8990
<argument name="block" value="$$createPreReqBlock$$"/>
91+
<argument name="index" value="1"/>
9092
</actionGroup>
9193
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
9294
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
9395
<actionGroup ref="verifyBlockOnStage" stepKey="verifyBlockOnStageAfterSave">
96+
<argument name="contentType" value="PageBuilderBlockContentType"/>
9497
<argument name="block" value="$$createPreReqBlock$$"/>
98+
<argument name="index" value="1"/>
9599
</actionGroup>
96100
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
97101
<waitForPageLoad stepKey="waitForPageLoad"/>
@@ -139,7 +143,9 @@
139143
<!-- Validate Stage -->
140144
<comment userInput="Validate stage" stepKey="validateStage1" />
141145
<actionGroup ref="verifyBlockOnStage" stepKey="verifyBlockOnStage">
146+
<argument name="contentType" value="PageBuilderBlockContentType"/>
142147
<argument name="block" value="$$createPreReqBlock$$"/>
148+
<argument name="index" value="1"/>
143149
</actionGroup>
144150
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
145151
<!-- Validate Storefront -->
@@ -165,7 +171,7 @@
165171
<comment userInput="Validate stage after updating block" stepKey="validateStage2" />
166172
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
167173
<waitForElementVisible selector="{{HtmlOnStage.base('1')}}" stepKey="waitForHtmlBaseStage1"/>
168-
<waitForElementVisible selector="{{BlockOnStage.html('1')}}" stepKey="waitForHtmlStage1"/>
174+
<waitForElementVisible selector="{{BlockOnStage.html('1', '1')}}" stepKey="waitForHtmlStage1"/>
169175
<actionGroup ref="ClearCacheActionGroup" stepKey="clearMagentoCache"/>
170176
<!-- Validate Storefront -->
171177
<comment userInput="Validate storefront after updating block" stepKey="validateStorefront2" />
@@ -227,7 +233,7 @@
227233
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPageAfterDisablingBlock">
228234
<argument name="CMSPage" value="$$createCMSPage$$" />
229235
</actionGroup>
230-
<waitForElementVisible selector="{{BlockOnStage.status('Block disabled')}}" stepKey="seeDisabledBlockPlaceholder" />
236+
<waitForElementVisible selector="{{BlockOnStage.status('1', 'Block disabled')}}" stepKey="seeDisabledBlockPlaceholder" />
231237

232238
<!-- Go to CMS page on storefront and assert disabled block does not exist on page -->
233239
<comment userInput="Go to CMS page on storefront and assert disabled block does not exist on page" stepKey="commentAssertDisabledBlockMissingOnStorefront" />
@@ -316,7 +322,7 @@
316322
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandGroupInteractive2">
317323
<argument name="group" value="PageBuilderBlockContentType"/>
318324
</actionGroup>
319-
<waitForElementVisible selector="{{BlockOnStage.deleted('$createPreReqBlock.id$')}}" stepKey="seeDeletedBlockPlaceHolder"/>
325+
<waitForElementVisible selector="{{BlockOnStage.deleted('1','$createPreReqBlock.id$')}}" stepKey="seeDeletedBlockPlaceHolder"/>
320326
</test>
321327
<test name="BlockValidateAdvancedConfigurationDefaultValues">
322328
<annotations>

0 commit comments

Comments
 (0)