Skip to content

Commit 67d33c1

Browse files
ENGCOM-6403: MFTF: Extract Action Groups to separate files - magento/module-cms #25836
2 parents a0d8040 + c245427 commit 67d33c1

File tree

45 files changed

+610
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+610
-398
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@
3131
<waitForElementVisible selector="{{CatalogWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4" />
3232
<click selector="{{CatalogWYSIWYGSection.InsertImageIcon}}" stepKey="clickInsertImageIcon" />
3333
<waitForPageLoad stepKey="waitForPageLoad" />
34-
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
35-
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
36-
<actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder">
34+
<actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/>
35+
<actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/>
36+
<actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder">
3737
<argument name="ImageFolder" value="ImageFolder"/>
3838
</actionGroup>
39-
<actionGroup ref="attachImage" stepKey="attachImage1">
39+
<actionGroup ref="AttachImageActionGroup" stepKey="attachImage1">
4040
<argument name="Image" value="ImageUpload3"/>
4141
</actionGroup>
42-
<actionGroup ref="deleteImage" stepKey="deleteImage"/>
43-
<actionGroup ref="attachImage" stepKey="attachImage2">
42+
<actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/>
43+
<actionGroup ref="AttachImageActionGroup" stepKey="attachImage2">
4444
<argument name="Image" value="ImageUpload3"/>
4545
</actionGroup>
46-
<actionGroup ref="saveImage" stepKey="insertImage"/>
47-
<actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" />
46+
<actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/>
47+
<actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" />
4848
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCatalog"/>
4949
<amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/>
5050
<waitForPageLoad stepKey="waitForPageLoad2"/>

app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</before>
4343

4444
<!--Open block with widget.-->
45-
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1">
45+
<actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1">
4646
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
4747
</actionGroup>
4848

@@ -85,7 +85,7 @@
8585
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100"/>
8686

8787
<!--Open block with widget.-->
88-
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage2">
88+
<actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage2">
8989
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
9090
</actionGroup>
9191

@@ -105,7 +105,7 @@
105105
<dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="dontSeeElementByPrice100"/>
106106

107107
<!--Open block with widget.-->
108-
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage3">
108+
<actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage3">
109109
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
110110
</actionGroup>
111111

@@ -125,7 +125,7 @@
125125
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100s"/>
126126

127127
<!--Open block with widget.-->
128-
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage4">
128+
<actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage4">
129129
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
130130
</actionGroup>
131131

app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</before>
4343
<!--Open created cms page-->
4444
<comment userInput="Open created cms page" stepKey="commentOpenCreatedCmsPage"/>
45-
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
45+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1">
4646
<argument name="CMSPage" value="$$createPreReqPage$$"/>
4747
</actionGroup>
4848
<!--Add widget to cms page-->
@@ -85,4 +85,4 @@
8585
<actionGroup ref="logout" stepKey="logout"/>
8686
</after>
8787
</test>
88-
</tests>
88+
</tests>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AddStoreViewToCmsPageActionGroup" extends="NavigateToCreatedCMSPageActionGroup">
12+
<annotations>
13+
<description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeViewName" type="string"/>
17+
</arguments>
18+
19+
<remove keyForRemoval="clickExpandContentTabForPage"/>
20+
<remove keyForRemoval="waitForLoadingMaskOfStagingSection"/>
21+
<click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/>
22+
<waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/>
23+
<clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/>
24+
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
25+
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
26+
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
27+
<waitForPageLoad stepKey="waitForPageLoad"/>
28+
<see userInput="You saved the page." stepKey="seeMessage"/>
29+
</actionGroup>
30+
</actionGroups>

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AssertCMSPageContent">
11+
<actionGroup name="AssertCMSPageContentActionGroup">
1212
<annotations>
1313
<description>Validates that the CMS Page details are present and correct. PLEASE NOTE: The CMS Page data is Hardcoded, using '_duplicatedCMSPage'.</description>
1414
</annotations>
15-
15+
1616
<grabValueFrom selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" stepKey="grabTextFromTitle"/>
1717
<assertEquals stepKey="assertTitle" message="pass">
1818
<expectedResult type="string">{{_duplicatedCMSPage.title}}</expectedResult>
@@ -28,19 +28,4 @@
2828
<executeJS function="(el = document.querySelector('[name=\'identifier\']')) &amp;&amp; el['se' + 'tAt' + 'tribute']('data-value', el.value.split('-')[0]);" stepKey="setAttribute"/>
2929
<seeElement selector="{{CmsNewPagePageBasicFieldsSection.duplicatedURLKey(_duplicatedCMSPage.title)}}" stepKey="see"/>
3030
</actionGroup>
31-
32-
<actionGroup name="AssertStoreFrontCMSPage">
33-
<annotations>
34-
<description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description>
35-
</annotations>
36-
<arguments>
37-
<argument name="cmsTitle" type="string"/>
38-
<argument name="cmsContent" type="string"/>
39-
<argument name="cmsContentHeading" type="string"/>
40-
</arguments>
41-
42-
<see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/>
43-
<see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/>
44-
<see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/>
45-
</actionGroup>
4631
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AssertStoreFrontCMSPageActionGroup">
12+
<annotations>
13+
<description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="cmsTitle" type="string"/>
17+
<argument name="cmsContent" type="string"/>
18+
<argument name="cmsContentHeading" type="string"/>
19+
</arguments>
20+
21+
<see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/>
22+
<see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/>
23+
<see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AttachImageActionGroup">
12+
<annotations>
13+
<description>Uploads the provided Image to Media Gallery.
14+
If you use this action group, you MUST add steps to delete the image in the "after" steps.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="Image"/>
18+
</arguments>
19+
20+
<attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/>
21+
<waitForPageLoad stepKey="waitForPageLoad"/>
22+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
23+
<waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/>
24+
</actionGroup>
25+
</actionGroups>

0 commit comments

Comments
 (0)