Skip to content

Commit 5b094e6

Browse files
committed
Admin-Delete-Cms-Page-Test
1 parent b1ef766 commit 5b094e6

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-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="AdminDeleteCmsPageFromGridActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<click selector="{{CmsPagesPageActionsSection.select(urlKey)}}" stepKey="clickSelect"/>
16+
<click selector="{{CmsPagesPageActionsSection.delete(urlKey)}}" stepKey="clickDelete"/>
17+
<waitForElementVisible selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
18+
<click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="clickOkButton"/>
19+
<waitForPageLoad stepKey="waitForPageLoad3"/>
20+
</actionGroup>
21+
</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="AdminSearchCmsPageInGridByUrlKeyActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFilterButton"/>
16+
<fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="{{urlKey}}" stepKey="fillUrlKeyField"/>
17+
<click selector="{{CmsPagesPageActionsSection.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="AssertAdminCmsPageIsNotInGridActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<dontSee userInput="{{urlKey}}" selector="{{CmsPagesPageActionsSection.gridDataRow}}" stepKey="dontSeeCmsPageInGrid"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" />
3131
<element name="massActionsButton" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[contains(@class, 'action-select')]" />
3232
<element name="massActionsOption" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//span[contains(@class, 'action-menu-item') and .= '{{action}}']" parameterized="true"/>
33+
<element name="gridDataRow" type="input" selector=".data-row .data-grid-cell-content"/>
3334
</section>
3435
</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="AdminDeleteCmsPageTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="Delete a CMS Page via the Admin"/>
15+
<title value="Admin should be able to delete CMS Pages"/>
16+
<description value="Admin should be able to delete CMS Pages"/>
17+
<group value="Cms"/>
18+
<group value="WYSIWYGDisabled"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<actionGroup ref="AdminNavigateToPageGridActionGroup" stepKey="navigateToCmsPageGrid"/>
24+
<actionGroup ref="CreateNewPageWithBasicValues" stepKey="createNewPageWithBasicValues"/>
25+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPageButton"/>
26+
</before>
27+
<after>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
29+
</after>
30+
31+
<actionGroup ref="AdminSearchCmsPageInGridByUrlKeyActionGroup" stepKey="findCreatedCmsPage">
32+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
33+
</actionGroup>
34+
<actionGroup ref="AdminDeleteCmsPageFromGridActionGroup" stepKey="deleteCmsPage">
35+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
36+
</actionGroup>
37+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
38+
<argument name="message" value="The page has been deleted."/>
39+
</actionGroup>
40+
<actionGroup ref="AdminSearchCmsPageInGridByUrlKeyActionGroup" stepKey="searchDeletedPage">
41+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
42+
</actionGroup>
43+
<actionGroup ref="AssertAdminCmsPageIsNotInGridActionGroup" stepKey="assertCmsPageIsNotInGrid">
44+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
45+
</actionGroup>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)