Skip to content

Commit 52751a4

Browse files
author
Cari Spruiell
committed
MC-2374: Create MFTF Tests
- update MFTF tests with more action group usage
1 parent a7f8248 commit 52751a4

File tree

4 files changed

+97
-42
lines changed

4 files changed

+97
-42
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/AdminActionGroup.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,27 @@
7171
<dontSee userInput="Enable Advanced CMS" stepKey="dontSeeEnableAdvancedCMSBtn"/>
7272
<dontSee selector="{{PageBuilderPanel.generalGroup}}" stepKey="seePageBuilderVisible"/>
7373
</actionGroup>
74+
<actionGroup name="setLayout">
75+
<arguments>
76+
<argument name="designSection"/>
77+
<argument name="layoutOption"/>
78+
</arguments>
79+
<waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/>
80+
<conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.DesignTab}}/parent::strong/parent::*[@data-state-collapsible='closed']" visible="true" stepKey="clickOnDesignTab"/>
81+
<waitForPageLoad stepKey="waitForPageLoadDesignTab"/>
82+
<waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
83+
<selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/>
84+
</actionGroup>
85+
<actionGroup name="verifyFullWidthLayout">
86+
<executeJS function="return document.querySelector('[data-role=row]').clientWidth" stepKey="rowWidth"/>
87+
<executeJS function="return document.querySelector('[class=page-wrapper]').clientWidth" stepKey="pageWidth"/>
88+
<assertEquals stepKey="assertRowWidth100Percent">
89+
<expectedResult type="variable">pageWidth</expectedResult>
90+
<actualResult type="variable">rowWidth</actualResult>
91+
</assertEquals>
92+
<assertGreaterThan stepKey="assertRowWidthGreaterThanZero">
93+
<expectedResult type="int">0</expectedResult>
94+
<actualResult type="variable">rowWidth</actualResult>
95+
</assertGreaterThan>
96+
</actionGroup>
7497
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCreateCategoryTest.xml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,23 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1111
<test name="AdminConfigDefaultCategoryLayoutFromConfigurationSettingTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Default layout configuration MAGETWO-88793"/>
15+
<title value="Admin should be able to configure the default layout for Category Page from System Configuration"/>
16+
<description value="Admin should be able to configure the default layout for Category Page from System Configuration"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-89024"/>
19+
<group value="category"/>
20+
</annotations>
1221
<!-- PageBuilder is enabled so check default is full width -->
1322
<comment userInput="PageBuilder is enabled so check default is full width" stepKey="commentSeeCategoryFullWidth" before="seeNoLayoutUpdatesSelected" />
1423
<seeOptionIsSelected selector="{{DefaultLayoutsSection.categoryLayout}}" userInput="{{PageBuilderFullWidthLayout.category}}" stepKey="seeNoLayoutUpdatesSelected" />
1524
</test>
1625
<test name="AdminCreateCategoryWithPageBuilderDescriptionTest">
1726
<annotations>
1827
<features value="PageBuilder"/>
19-
<stories value="Full Width Page Layout"/>
28+
<stories value="Page Layout"/>
2029
<title value="Category description should display in full width"/>
2130
<description value="Category description should display in full width"/>
2231
<severity value="MAJOR"/>
@@ -27,24 +36,24 @@
2736
</annotations>
2837
<before>
2938
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
39+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/>
40+
<waitForPageLoad stepKey="waitForPageLoadCategoryPage"/>
41+
<actionGroup ref="CreateCategory" stepKey="createCategory"/>
3042
</before>
3143
<after>
3244
<actionGroup ref="logout" stepKey="logout"/>
3345
</after>
34-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/>
35-
<waitForElementVisible selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="waitForSubCategoryBtn"/>
36-
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
37-
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/>
38-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/>
39-
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{SimpleSubCategory.name_lwr}}" stepKey="enterURLKey"/>
4046
<!-- Add PageBuilder description -->
4147
<comment userInput="Add PageBuilder description" stepKey="commentAddDescription"/>
4248
<click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="openContentSection"/>
49+
<waitForPageLoad stepKey="waitForPageLoadContentSection"/>
4350
<waitForElementVisible selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="waitForPageBuilderBtn" />
4451
<see userInput="Edit with Page Builder" stepKey="seePageBuilderBtn"/>
4552
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
53+
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
4654
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
4755
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
56+
<!-- Set background color of row -->
4857
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
4958
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
5059
<argument name="contentType" value="PageBuilderRowContentType"/>
@@ -56,26 +65,25 @@
5665
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
5766
<argument name="contentType" value="PageBuilderHeadingContentType"/>
5867
</actionGroup>
68+
<!-- Add heading to stage -->
5969
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
6070
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
6171
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
6272
</actionGroup>
6373
<click selector="{{PageBuilderStage.exitFullScreen}}" stepKey="exitPageBuilderFullScreen" />
74+
<waitForPageLoad stepKey="waitForPageLoadExitFullScreen"/>
6475
<!-- Use Full Width layout -->
6576
<comment userInput="Set Layout to Category - Full Width" stepKey="commentSetLayout"/>
66-
<click selector="{{CategoryDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/>
67-
<waitForElementVisible selector="{{CategoryDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
68-
<selectOption selector="{{CategoryDesignSection.LayoutDropdown}}" userInput="{{PageBuilderFullWidthLayout.category}}" stepKey="selectCategoryFullWidthLayout"/>
77+
<actionGroup ref="setLayout" stepKey="setFullWidthLayout">
78+
<argument name="designSection" value="CategoryDesignSection"/>
79+
<argument name="layoutOption" value="PageBuilderFullWidthLayout.category"/>
80+
</actionGroup>
6981
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
70-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>
71-
<!-- Literal URL below, need to refactor line + StorefrontCategoryPage when support for variable URL is implemented-->
72-
<amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/>
73-
<seeInTitle userInput="{{SimpleSubCategory.name}}" stepKey="assertTitle"/>
74-
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{SimpleSubCategory.name_lwr}}" stepKey="assertInfo1"/>
75-
<!-- Check that description is full width -->
76-
<comment userInput="Check that description is full width" stepKey="commentSeeDescriptionFullWidth"/>
77-
<executeJS function="return document.querySelector('[data-role=row]').clientWidth" stepKey="rowWidth"/>
78-
<executeJS function="return document.querySelector('[class=page-wrapper]').clientWidth" stepKey="pageWidth"/>
79-
<assertEquals expected="pageWidth" expectedType="variable" actual="rowWidth" actualType="variable" stepKey="assertRowWidth100Percent" />
82+
<waitForPageLoad stepKey="waitForPageLoadSaveCategory"/>
83+
<waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>
84+
<!-- Check that description is full width on storefront-->
85+
<comment userInput="Check that description is full width on storefront" stepKey="commentSeeDescriptionFullWidth"/>
86+
<actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCategoryOnStorefront"/>
87+
<actionGroup ref="verifyFullWidthLayout" stepKey="verifyFullWidthLayout"/>
8088
</test>
8189
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCreateCmsPageTest.xml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1111
<test name="AdminCreateCmsPageTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="Create a CMS Page via the Admin"/>
15+
<title value="Admin should be able to create a CMS Page"/>
16+
<description value="Admin should be able to create a CMS Page"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-25580"/>
19+
<group value="Cms"/>
20+
</annotations>
1221
<before>
1322
<actionGroup ref="disablePageBuilderSetting" stepKey="turnOffPageBuilder" after="loginGetFromGeneralFile" />
1423
</before>
@@ -17,6 +26,15 @@
1726
</after>
1827
</test>
1928
<test name="AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest">
29+
<annotations>
30+
<features value="Cms"/>
31+
<stories value="Default layout configuration MAGETWO-88793"/>
32+
<title value="Admin should be able to configure the default layout for CMS Page from System Configuration"/>
33+
<description value="Admin should be able to configure the default layout for CMS Page from System Configuration"/>
34+
<severity value="CRITICAL"/>
35+
<testCaseId value="MAGETWO-89025"/>
36+
<group value="Cms"/>
37+
</annotations>
2038
<!-- PageBuilder is enabled so check default is full width -->
2139
<comment userInput="PageBuilder is enabled so check default is full width" stepKey="commentSeeFullWidth" />
2240
<seeOptionIsSelected selector="{{DefaultLayoutsSection.pageLayout}}" userInput="{{PageBuilderFullWidthLayout.cms}}" stepKey="seeOneColumnSelected" />
@@ -26,7 +44,7 @@
2644
<test name="AdminCreateCMSPageFullWidthLayout">
2745
<annotations>
2846
<features value="PageBuilder"/>
29-
<stories value="Full Width Page Layout"/>
47+
<stories value="Page Layout"/>
3048
<title value="Create CMS Page with full page layout"/>
3149
<description value="Create CMS Page with full page layout"/>
3250
<severity value="MAJOR"/>
@@ -46,6 +64,7 @@
4664
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
4765
<argument name="contentType" value="PageBuilderRowContentType"/>
4866
</actionGroup>
67+
<!-- Set background color of row -->
4968
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
5069
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
5170
<argument name="contentType" value="PageBuilderRowContentType"/>
@@ -57,23 +76,23 @@
5776
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
5877
<argument name="contentType" value="PageBuilderHeadingContentType"/>
5978
</actionGroup>
79+
<!-- Add heading to stage -->
6080
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
6181
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
6282
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
6383
</actionGroup>
6484
<!-- Use Full Width layout -->
6585
<comment userInput="Set Layout to Page - Full Width" stepKey="commentSetLayout"/>
66-
<click selector="{{CmsDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/>
67-
<waitForElementVisible selector="{{CmsDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
68-
<selectOption selector="{{CmsDesignSection.LayoutDropdown}}" userInput="{{PageBuilderFullWidthLayout.cms}}" stepKey="selectPageFullWidthLayout"/>
86+
<actionGroup ref="setLayout" stepKey="setFullWidthLayout">
87+
<argument name="designSection" value="CmsDesignSection"/>
88+
<argument name="layoutOption" value="PageBuilderFullWidthLayout.cms"/>
89+
</actionGroup>
6990
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
7091
<!-- Check that description is full width on storefront -->
7192
<comment userInput="Check that description is full width on storefront" stepKey="commentSeeDescriptionFullWidth"/>
7293
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
7394
<argument name="contentType" value="PageBuilderRowContentType"/>
7495
</actionGroup>
75-
<executeJS function="return document.querySelector('[data-role=row]').clientWidth" stepKey="rowWidth"/>
76-
<executeJS function="return document.querySelector('[class=page-wrapper]').clientWidth" stepKey="pageWidth"/>
77-
<assertEquals expected="pageWidth" expectedType="variable" actual="rowWidth" actualType="variable" stepKey="assertRowWidth100Percent" />
96+
<actionGroup ref="verifyFullWidthLayout" stepKey="verifyFullWidthLayout"/>
7897
</test>
7998
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCreateProductTest.xml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<test name="AdminCreateProductWithPageBuilderDescriptionTest">
1212
<annotations>
1313
<features value="PageBuilder"/>
14-
<stories value="Full Width Page Layout"/>
14+
<stories value="Page Layout"/>
1515
<title value="Product description should display in full width"/>
1616
<description value="Product description should display in full width"/>
1717
<severity value="MAJOR"/>
@@ -22,24 +22,27 @@
2222
</annotations>
2323
<before>
2424
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
25+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin">
27+
<argument name="category" value="$$createPreReqCategory$$"/>
28+
<argument name="simpleProduct" value="_defaultProduct"/>
29+
</actionGroup>
2530
</before>
2631
<after>
2732
<actionGroup ref="logout" stepKey="logout"/>
2833
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
2934
</after>
30-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
31-
<actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin">
32-
<argument name="category" value="$$createPreReqCategory$$"/>
33-
<argument name="simpleProduct" value="_defaultProduct"/>
34-
</actionGroup>
3535
<!-- Add PageBuilder description -->
3636
<comment userInput="Add PageBuilder description" stepKey="commentAddDescription"/>
3737
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openContentSection"/>
38+
<waitForPageLoad stepKey="waitForPageLoadContentSection"/>
3839
<waitForElementVisible selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="waitForPageBuilderBtn" />
3940
<see userInput="Edit with Page Builder" stepKey="seePageBuilderBtn"/>
4041
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
42+
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
4143
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
4244
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
45+
<!-- Set background color of row -->
4346
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
4447
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
4548
<argument name="contentType" value="PageBuilderRowContentType"/>
@@ -51,24 +54,26 @@
5154
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
5255
<argument name="contentType" value="PageBuilderHeadingContentType"/>
5356
</actionGroup>
57+
<!-- Add heading to stage -->
5458
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
5559
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
5660
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
5761
</actionGroup>
5862
<click selector="{{PageBuilderStage.exitFullScreen}}" stepKey="exitPageBuilderFullScreen" />
63+
<waitForPageLoad stepKey="waitForPageLoadExitFullScreen"/>
5964
<!-- Use Full Width layout -->
6065
<comment userInput="Set Layout to Product - Full Width" stepKey="commentSetLayout"/>
61-
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/>
62-
<waitForElementVisible selector="{{ProductDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
63-
<selectOption selector="{{ProductDesignSection.LayoutDropdown}}" userInput="{{PageBuilderFullWidthLayout.product}}" stepKey="selectProductFullWidthLayout"/>
66+
<actionGroup ref="setLayout" stepKey="setFullWidthLayout">
67+
<argument name="designSection" value="ProductDesignSection"/>
68+
<argument name="layoutOption" value="PageBuilderFullWidthLayout.product"/>
69+
</actionGroup>
6470
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
65-
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
66-
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/>
67-
<waitForPageLoad stepKey="waitForPageLoad2"/>
71+
<waitForPageLoad stepKey="waitForPageLoadSaveProduct"/>
72+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
6873
<!-- Check that description is full width -->
6974
<comment userInput="Check that description is full width" stepKey="commentSeeDescriptionFullWidth"/>
70-
<executeJS function="return document.querySelector('[data-role=row]').clientWidth" stepKey="rowWidth"/>
71-
<executeJS function="return document.querySelector('[class=page-wrapper]').clientWidth" stepKey="pageWidth"/>
72-
<assertEquals expected="pageWidth" expectedType="variable" actual="rowWidth" actualType="variable" stepKey="assertRowWidth100Percent" />
75+
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/>
76+
<waitForPageLoad stepKey="waitForPageLoadProductPage"/>
77+
<actionGroup ref="verifyFullWidthLayout" stepKey="verifyFullWidthLayout"/>
7378
</test>
7479
</tests>

0 commit comments

Comments
 (0)