Skip to content

Commit 48f416c

Browse files
committed
Refactoring, fixing code review notes
1 parent 2bab0b4 commit 48f416c

8 files changed

+52
-17
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AdminCMSPageMassActionDisable">
10+
<actionGroup name="AdminCMSPageMassActionDisableActionGroup">
1111
<click selector="{{CmsPagesPageActionsSection.massActionsButton}}" stepKey="clickMassActionDropdown"/>
1212
<click selector="{{CmsPagesPageActionsSection.massActionsOption('Disable')}}" stepKey="clickDisableAction"/>
1313
<waitForPageLoad stepKey="waitForPageToReload"/>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageNavigateToGridActionGroup.xml renamed to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSPagesGridActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AdminCMSPageNavigateToGrid">
10+
<actionGroup name="AdminOpenCMSPagesGridActionGroup">
1111
<amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/>
12+
<waitForPageLoad stepKey="waitForPageLoad"/>
1213
</actionGroup>
1314
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminSelectCMSPageFromGridActionGroup">
11+
<arguments>
12+
<argument name="identifier" defaultValue=""/>
13+
</arguments>
14+
<click selector="{{CmsPagesPageActionsSection.select(identifier)}}" stepKey="clickSelectCMSPage" />
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCMSPageSelectInGridActionGroup.xml renamed to app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSelectCMSPageInGridActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AdminCMSPageSelectInGrid">
10+
<actionGroup name="AdminSelectCMSPageInGridActionGroup">
1111
<arguments>
1212
<argument name="identifier" type="string"/>
1313
</arguments>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertCMSPageNotFoundOnStorefrontActionGroup">
11+
<see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/>
12+
</actionGroup>
13+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageNotFoundOnFrontActionGroup.xml renamed to app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontGoToCMSPageActionGroup.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AssertCMSPageNotFoundOnFront">
10+
<actionGroup name="StorefrontGoToCMSPageActionGroup">
1111
<arguments>
1212
<argument name="identifier" type="string"/>
1313
</arguments>
14-
<amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnPageOnStorefront"/>
14+
<amOnPage url="{{StorefrontHomePage.url}}/{{identifier}}" stepKey="amOnCmsPageOnStorefront"/>
1515
<waitForPageLoad stepKey="waitForPageLoadOnStorefront"/>
16-
<see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/>
1716
</actionGroup>
18-
</actionGroups>
17+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<element name="savePageSuccessMessage" type="text" selector=".message-success"/>
2828
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/>
2929
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
30-
<element name="pageRowCheckboxByIdentifier" type="block" selector="//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" />
30+
<element name="pageRowCheckboxByIdentifier" type="block" selector="//div[@data-bind=&quot;scope: 'cms_page_listing.cms_page_listing'&quot;]//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.admin__data-grid-header-row.row div.action-select-wrap button.action-select"/>
3232
<element name="massActionsOption" type="button" selector="//div[contains(@class,'admin__data-grid-header-row') and contains(@class, 'row')]//div[contains(@class, 'action-select-wrap')]//ul/li/span[text() = '{{label}}']" parameterized="true"/>
3333
</section>

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,35 @@
2727
<actionGroup ref="logout" stepKey="logout"/>
2828
</after>
2929
<!--Go to Grid page-->
30-
<actionGroup ref="AdminCMSPageNavigateToGrid" stepKey="navigateToCMSPageGrid"/>
30+
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCMSPageGrid"/>
3131
<!--Select pages in Grid-->
32-
<actionGroup ref="AdminCMSPageSelectInGrid" stepKey="selectFirstCMSPage">
32+
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectFirstCMSPage">
3333
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
3434
</actionGroup>
35-
<actionGroup ref="AdminCMSPageSelectInGrid" stepKey="selectSecondCMSPage">
35+
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectSecondCMSPage">
3636
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
3737
</actionGroup>
3838
<!-- Disable Pages-->
39-
<actionGroup ref="AdminCMSPageMassActionDisable" stepKey="disablePages"/>
39+
<actionGroup ref="AdminCMSPageMassActionDisableActionGroup" stepKey="disablePages"/>
4040
<!--Verify pages in Grid-->
41-
<actionGroup ref="AssertCMSPageInGrid" stepKey="verifyFirstPageInGrid">
41+
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="openCMSPagesGridActionGroup"/>
42+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilters"/>
43+
<actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortGridByIdDescending"/>
44+
<actionGroup ref="AdminSelectCMSPageFromGridActionGroup" stepKey="verifyFirstPageInGrid">
4245
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
4346
</actionGroup>
44-
<actionGroup ref="AssertCMSPageInGrid" stepKey="verifySecondPageInGrid">
47+
<actionGroup ref="AdminSelectCMSPageFromGridActionGroup" stepKey="verifySecondPageInGrid">
4548
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
4649
</actionGroup>
47-
<!--Verify Pages are disabled on Frontend-->
48-
<actionGroup ref="AssertCMSPageNotFoundOnFront" stepKey="checkFirstPageNotFoundOnFront">
50+
<!--Verify first page is disabled on Frontend-->
51+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToFirstCMSPageOnStorefront">
4952
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
5053
</actionGroup>
51-
<actionGroup ref="AssertCMSPageNotFoundOnFront" stepKey="checkSecondPageNotFoundOnFront">
54+
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForFirstPage"/>
55+
<!--Verify second page is disabled on Frontend-->
56+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToSecondCMSPageOnStorefront">
5257
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
5358
</actionGroup>
59+
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForSecondPage"/>
5460
</test>
5561
</tests>

0 commit comments

Comments
 (0)