Skip to content

Commit 87bb433

Browse files
committed
MAGETWO-95130: CMS block cannot be deleted
- added functional test to cover the bug fix
1 parent f351aeb commit 87bb433

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

app/code/Magento/Cms/Test/Mftf/ActionGroup/SearchBlockOnGridPageActionGroup.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,27 @@
1616
<waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish2" />
1717
<waitForElementVisible selector="{{WidgetSection.BlockPage(Block.identifier)}}" stepKey="waitForBlockTitle" />
1818
</actionGroup>
19+
<actionGroup name ="deleteBlock">
20+
<arguments>
21+
<argument name="Block" defaultValue=""/>
22+
</arguments>
23+
<amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/>
24+
<waitForPageLoad stepKey="waitForPageLoad1"/>
25+
<conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
26+
<waitForPageLoad stepKey="waitForPageLoad2"/>
27+
<click selector="{{BlockPageActionsSection.FilterBtn}}" stepKey="clickFilterBtn"/>
28+
<fillField selector="{{BlockPageActionsSection.URLKey}}" userInput="{{Block.identifier}}" stepKey="fillBlockIdentifierInput"/>
29+
<click selector="{{BlockPageActionsSection.ApplyFiltersBtn}}" stepKey="applyFilter"/>
30+
<waitForLoadingMaskToDisappear stepKey="waitForGridToLoadResults" />
31+
<waitForElementVisible selector="{{BlockPageActionsSection.select(Block.identifier)}}" stepKey="waitForCMSPageGrid" />
32+
<click selector="{{BlockPageActionsSection.select(Block.identifier)}}" stepKey="clickSelect" />
33+
<waitForElementVisible selector="{{BlockPageActionsSection.edit(Block.identifier)}}" stepKey="waitForEditLink" />
34+
<click selector="{{BlockPageActionsSection.edit(Block.identifier)}}" stepKey="clickEdit" />
35+
<waitForLoadingMaskToDisappear stepKey="waitForPageToLoad" />
36+
<click selector="{{CmsBlockBlockActionSection.deleteBlock}}" stepKey="deleteBlock"/>
37+
<waitForElementVisible selector="{{CmsBlockBlockActionSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
38+
<click selector="{{CmsBlockBlockActionSection.deleteConfirm}}" stepKey="clickOkButton"/>
39+
<waitForPageLoad stepKey="waitForPageLoad3"/>
40+
<see userInput="You deleted the block." stepKey="seeSuccessMessage"/>
41+
</actionGroup>
1942
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@
2424
<section name="BlockContentSection">
2525
<element name="TextArea" type="input" selector="#cms_block_form_content"/>
2626
</section>
27+
<section name="CmsBlockBlockActionSection">
28+
<element name="deleteBlock" type="button" selector="#delete" timeout="30"/>
29+
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
30+
</section>
2731
</sections>

app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/>
2424
</before>
2525
<after>
26+
<actionGroup ref="deleteBlock" stepKey="deleteCreatedBlock">
27+
<argument name="Block" value="_defaultBlock"/>
28+
</actionGroup>
2629
<actionGroup ref="logout" stepKey="logout"/>
2730
</after>
2831
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>

0 commit comments

Comments
 (0)