Skip to content

Commit 15507d5

Browse files
authored
ENGCOM-7525: MFTF: Admin Deletes CMS Page #28112
2 parents 24e6cde + 443f53e commit 15507d5

File tree

6 files changed

+109
-0
lines changed

6 files changed

+109
-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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridSearchFilters"/>
25+
<actionGroup ref="CreateNewPageWithBasicValues" stepKey="createNewPageWithBasicValues"/>
26+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPageButton"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilters"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
31+
</after>
32+
33+
<actionGroup ref="AdminSearchCmsPageInGridByUrlKeyActionGroup" stepKey="findCreatedCmsPage">
34+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminDeleteCmsPageFromGridActionGroup" stepKey="deleteCmsPage">
37+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
38+
</actionGroup>
39+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
40+
<argument name="message" value="The page has been deleted."/>
41+
</actionGroup>
42+
<actionGroup ref="AdminSearchCmsPageInGridByUrlKeyActionGroup" stepKey="searchDeletedPage">
43+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
44+
</actionGroup>
45+
<actionGroup ref="AssertAdminCmsPageIsNotInGridActionGroup" stepKey="assertCmsPageIsNotInGrid">
46+
<argument name="urlKey" value="{{_defaultCmsPage.identifier}}"/>
47+
</actionGroup>
48+
</test>
49+
</tests>

app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<!-- Create a CMS page containing the Products List widget -->
3535
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnCmsList"/>
3636
<waitForPageLoad stepKey="waitForCmsList"/>
37+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
3738
<click selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="clickAddNewPageButton"/>
3839
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_newDefaultCmsPage.title}}" stepKey="fillPageTitle"/>
3940
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/>

0 commit comments

Comments
 (0)