Skip to content

Commit 9674607

Browse files
authored
ENGCOM-6965: Module_Cms MFTF test improvements #26928
2 parents c509eb9 + 3b49324 commit 9674607

File tree

3 files changed

+56
-17
lines changed

3 files changed

+56
-17
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSaveAndDuplicateCMSPageWithSplitButtonActionGroup">
12+
<annotations>
13+
<description>Clicks on the Save and Duplicate button.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/>
17+
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
18+
<click selector="{{CmsNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
19+
<waitForPageLoad stepKey="waitForPageLoadAfterClickingSaveAndDuplicate"/>
20+
<see userInput="You saved the page." stepKey="seeSavedPageMsgOnForm"/>
21+
<see userInput="You duplicated the page." stepKey="seeDuplicatedPageMsg"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertAdminCmsPageSaveSplitButtonActionGroup">
12+
<annotations>
13+
<description>Verify Save and Duplicate and Save and Close button.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsNewPagePage.url}}" stepKey="amOnPageCreationForm"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
19+
<see selector="{{CmsNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
20+
<see selector="{{CmsNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,19 @@
2525
<after>
2626
<actionGroup ref="logout" stepKey="logout"/>
2727
</after>
28-
<amOnPage url="{{CmsNewPagePage.url}}" stepKey="amOnPageCreationForm"/>
29-
<waitForPageLoad stepKey="waitForPageLoad1"/>
30-
<!--Verify Save&Duplicate button and Save&Close button-->
31-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
32-
<see selector="{{CmsNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
33-
<see selector="{{CmsNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
34-
<!--Create new CMS Page page-->
35-
<actionGroup ref="FillOutCMSPageContent" stepKey="FillOutBlockContent"/>
36-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
37-
<click selector="{{CmsNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
38-
<waitForPageLoad stepKey="waitForPageLoad3"/>
39-
<see userInput="You saved the page." stepKey="seeSavedPageMsgOnForm"/>
40-
<see userInput="You duplicated the page." stepKey="seeDuplicatedPageMsg"/>
28+
<!-- Navigate to create a CMS page and Verify Save&Duplicate - Save&Close button -->
29+
<actionGroup ref="AssertAdminCmsPageSaveSplitButtonActionGroup" stepKey="verifyCmsPageSaveButton" />
30+
<!-- Filled out Content -->
31+
<actionGroup ref="FillOutCMSPageContent" stepKey="FillOutPageContent"/>
32+
<!-- Click save and duplicate action -->
33+
<actionGroup ref="AdminSaveAndDuplicateCMSPageWithSplitButtonActionGroup" stepKey="clickSaveAndDuplicateButton"/>
4134
<!--Verify duplicated CMS Page-->
4235
<seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockNotEnable" />
4336
<actionGroup ref="AssertCMSPageContentActionGroup" stepKey="assertContent"/>
44-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn3" />
45-
<click selector="{{CmsNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/>
46-
<see userInput="You saved the page." stepKey="seeSavedCMSPageMsgOnGrid"/>
47-
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
37+
<!-- Click Save Button -->
38+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPageButton"/>
39+
<actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deleteCMSPage">
40+
<argument name="UrlKey" value="{{_duplicatedCMSPage.identifier}}"/>
41+
</actionGroup>
4842
</test>
4943
</tests>

0 commit comments

Comments
 (0)