Skip to content

Commit 4e57571

Browse files
Added action group for cms block duplication test
1 parent 06a0dd0 commit 4e57571

File tree

3 files changed

+53
-14
lines changed

3 files changed

+53
-14
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="SaveAndDuplicateCMSBlockWithSplitButtonActionGroup">
12+
<annotations>
13+
<description>Clicks on the Save and Duplicate button.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/>
17+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
18+
<click selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
19+
<waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/>
20+
<see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/>
21+
<see userInput="You duplicated the block." stepKey="seeDuplicatedBlockMsg"/>
22+
</actionGroup>
23+
</actionGroups>
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="VerifyCmsBlockSaveSplitButtonActionGroup">
12+
<annotations>
13+
<description>verify Save and Close and Save and Duplicate button.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
<!--Verify Save&Duplicate button and Save&Close button-->
19+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
20+
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
21+
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
22+
</actionGroup>
23+
</actionGroups>

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,18 @@
2828
</actionGroup>
2929
<actionGroup ref="logout" stepKey="logout"/>
3030
</after>
31-
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
32-
<waitForPageLoad stepKey="waitForPageLoad1"/>
33-
<!--Verify Save&Duplicate button and Save&Close button-->
34-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
35-
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
36-
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
31+
<!-- Navigate to create cms block page and verify save split button -->
32+
<actionGroup ref="VerifyCmsBlockSaveSplitButtonActionGroup" stepKey="verifyCmsBlockSaveButton" />
3733
<!--Create new CMS Block page-->
3834
<actionGroup ref="FillOutBlockContent" stepKey="FillOutBlockContent"/>
39-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
40-
<click selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
41-
<waitForPageLoad stepKey="waitForPageLoad3"/>
42-
<see userInput="You saved the block." stepKey="seeSavedBlockMsgOnForm"/>
43-
<see userInput="You duplicated the block." stepKey="seeDuplicatedBlockMsg"/>
35+
<!-- Click save and duplicate action -->
36+
<actionGroup ref="SaveAndDuplicateCMSBlockWithSplitButtonActionGroup" stepKey="clickSaveAndDuplicateButton" />
37+
4438
<!--Verify duplicated CMS Block Page-->
4539
<seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockNotEnable" />
4640
<actionGroup ref="AssertBlockContent" stepKey="assertContent"/>
47-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn3" />
48-
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/>
49-
<see userInput="You saved the block." stepKey="seeSavedBlockMsgOnGrid"/>
41+
<!-- Click save and close button -->
42+
<actionGroup ref="SaveAndCloseCMSBlockWithSplitButtonActionGroup" stepKey="saveAndCloseAction" />
5043
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
5144
</test>
5245
</tests>

0 commit comments

Comments
 (0)