Skip to content

Commit f944a97

Browse files
authored
ENGCOM-8316: MFTF: Admin Delete CMS Block Test #30359
2 parents 884cbac + ceaa9d4 commit f944a97

7 files changed

+127
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminDeleteCMSBlockFromGridActionGroup">
12+
<arguments>
13+
<argument name="identifier" type="entity"/>
14+
</arguments>
15+
<click selector="{{BlockPageActionsSection.select(identifier)}}" stepKey="clickSelect"/>
16+
<click selector="{{BlockPageActionsSection.delete(identifier)}}" stepKey="clickDelete"/>
17+
<waitForElementVisible selector="{{BlockPageActionsSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
18+
<click selector="{{BlockPageActionsSection.deleteConfirm}}" stepKey="clickOkButton"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenCMSBlocksGridActionGroup">
12+
<annotations>
13+
<description>Navigate to the Admin Blocks Grid page.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/>
17+
<waitForPageLoad stepKey="waitForPageLoad"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSearchCMSBlockInGridByIdentifierActionGroup">
12+
<arguments>
13+
<argument name="identifier" type="string"/>
14+
</arguments>
15+
<click selector="{{BlockPageActionsSection.FilterBtn}}" stepKey="clickFilterButton"/>
16+
<fillField selector="{{BlockPageActionsSection.URLKey}}" userInput="{{identifier}}" stepKey="fillIdentifierField"/>
17+
<click selector="{{BlockPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyFiltersButton"/>
18+
<waitForPageLoad stepKey="waitForPageLoading"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminCMSBlockIsNotInGridActionGroup">
12+
<arguments>
13+
<argument name="identifier" type="entity"/>
14+
</arguments>
15+
<dontSee userInput="{{identifier}}" selector="{{AdminBlockGridSection.gridDataRow}}" stepKey="dontSeeCmsBlockInGrid"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="checkbox" type="checkbox" selector="//label[@class='data-grid-checkbox-cell-inner']//input[@class='admin__control-checkbox']"/>
1515
<element name="select" type="select" selector="//tr[@class='data-row']//button[@class='action-select']"/>
1616
<element name="editInSelect" type="text" selector="//a[contains(text(), 'Edit')]"/>
17+
<element name="gridDataRow" type="input" selector="//table[@data-role='grid']//tr/td"/>
1718
</section>
1819
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
<element name="URLKey" type="input" selector="//div[@class='admin__form-field-control']/input[@name='identifier']"/>
2121
<element name="ApplyFiltersBtn" type="button" selector="//span[text()='Apply Filters']"/>
2222
<element name="blockGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
23+
<element name="delete" type="button" selector="//a[@data-action='item-delete']"/>
24+
<element name="deleteConfirm" type="button" selector="//button[@data-role='action']//span[text()='OK']" timeout="60"/>
2325
</section>
2426
</sections>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminDeleteCmsBlockTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="CMS Blocks Deleting"/>
15+
<title value="Admin should be able to delete CMS block from grid"/>
16+
<description value="Admin should be able to delete CMS block from grid"/>
17+
<group value="Cms"/>
18+
<severity value="MINOR"/>
19+
</annotations>
20+
<before>
21+
<createData entity="_defaultBlock" stepKey="createCMSBlock"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
28+
<actionGroup ref="AdminOpenCMSBlocksGridActionGroup" stepKey="navigateToCmsBlocksGrid"/>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridSearchFilters"/>
30+
<actionGroup ref="AdminSearchCMSBlockInGridByIdentifierActionGroup" stepKey="findCreatedCmsBlock">
31+
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminDeleteCMSBlockFromGridActionGroup" stepKey="deleteCmsBlockFromGrid">
34+
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
35+
</actionGroup>
36+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
37+
<argument name="message" value="You deleted the block."/>
38+
</actionGroup>
39+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridSearchFiltersAfterBlockDeleting"/>
40+
<actionGroup ref="AdminSearchCMSBlockInGridByIdentifierActionGroup" stepKey="searchDeletedCmsBlock">
41+
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
42+
</actionGroup>
43+
<actionGroup ref="AssertAdminCMSBlockIsNotInGridActionGroup" stepKey="assertDeletedCMSBlockIsNotInGrid">
44+
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
45+
</actionGroup>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)