Skip to content

Commit 980c556

Browse files
committed
MC-2374: Create MFTF Tests
- Resolve CR comments - Open new tab to verify front-end
1 parent 78a180e commit 980c556

File tree

3 files changed

+43
-51
lines changed

3 files changed

+43
-51
lines changed

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
5050
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
5151
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
52-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
52+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
5353
<!-- Set background color of row -->
5454
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
5555
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
@@ -102,6 +102,7 @@
102102
<actionGroup ref="CreateCategory" stepKey="createCategory"/>
103103
</before>
104104
<after>
105+
<closeTab stepKey="closeTab"/>
105106
<actionGroup ref="logout" stepKey="logout"/>
106107
</after>
107108
<!-- Add PageBuilder description -->
@@ -113,7 +114,7 @@
113114
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
114115
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
115116
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
116-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
117+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
117118
<!-- Set background color of row -->
118119
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
119120
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
@@ -123,11 +124,11 @@
123124
<argument name="property" value="PageBuilderBackgroundColor_HSV_Orange"/>
124125
</actionGroup>
125126
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings"/>
127+
<!-- Add heading to stage -->
128+
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
126129
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
127130
<argument name="contentType" value="PageBuilderHeadingContentType"/>
128131
</actionGroup>
129-
<!-- Add heading to stage -->
130-
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
131132
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
132133
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
133134
</actionGroup>
@@ -142,25 +143,26 @@
142143
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
143144
<waitForPageLoad stepKey="waitForPageLoadSaveCategory"/>
144145
<waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>
145-
<!-- Check that description is full width on storefront-->
146-
<comment userInput="Check that description is full width on storefront" stepKey="commentSeeDescriptionFullWidth"/>
146+
<!-- Check the category's heading is still displayed using the Page full width layout-->
147+
<comment userInput="Check the category's heading is still displayed using the Page full width layout" stepKey="commentSeeDescriptionFullWidth"/>
148+
<openNewTab stepKey="openNewTab"/>
147149
<actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCategoryOnStorefront"/>
148-
<!-- Go back to edit category in admin panel -->
149-
<comment userInput="Go back to edit category in admin panel" stepKey="commentEditCategory"/>
150-
<actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedCategory">
151-
<argument name="Category" value="_defaultCategory"/>
152-
</actionGroup>
150+
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText"/>
153151
<!-- Set Layout to Product - Full Width -->
154152
<comment userInput="Set Layout to Product - Full Width" stepKey="commentSetLayout2"/>
153+
<switchToNextTab stepKey="switchToNextTab"/>
155154
<actionGroup ref="setLayout" stepKey="setFullWidthLayout2">
156155
<argument name="designSection" value="CategoryDesignSection"/>
157156
<argument name="layoutOption" value="PageBuilderFullWidthLayout.product"/>
158157
</actionGroup>
159158
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory2"/>
160159
<waitForPageLoad stepKey="waitForPageLoadSaveCategory2"/>
161160
<waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess2"/>
162-
<!-- Check that description is full width on storefront-->
163-
<comment userInput="Check that description is full width on storefront" stepKey="commentSeeDescriptionFullWidth2"/>
164-
<actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCategoryOnStorefront2"/>
161+
<!-- Check the category heading is still displayed on store front with product full width layout -->
162+
<comment userInput="Check the category heading is still displayed on store front with product full width layout" stepKey="commentSeeDescriptionFullWidth2"/>
163+
<switchToNextTab stepKey="switchToNextTab2"/>
164+
<reloadPage stepKey="reloadPage"/>
165+
<waitForPageLoad stepKey="waitForPageReload"/>
166+
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText2"/>
165167
</test>
166168
</tests>

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<description value="Create CMS Page with invalid full page layout"/>
9292
<severity value="MAJOR"/>
9393
<useCaseId value="MC-936"/>
94-
<testCaseId value="MC-3092"/>
94+
<testCaseId value="MC-3171"/>
9595
<group value="pagebuilder"/>
9696
<group value="pagebuilder-fullwidth"/>
9797
</annotations>
@@ -101,6 +101,7 @@
101101
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
102102
</before>
103103
<after>
104+
<closeTab stepKey="closeTab"/>
104105
<actionGroup ref="logout" stepKey="logout"/>
105106
</after>
106107
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
@@ -115,11 +116,11 @@
115116
<argument name="property" value="PageBuilderBackgroundColor_HSV_Orange"/>
116117
</actionGroup>
117118
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
119+
<!-- Add heading to stage -->
120+
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
118121
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
119122
<argument name="contentType" value="PageBuilderHeadingContentType"/>
120123
</actionGroup>
121-
<!-- Add heading to stage -->
122-
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
123124
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
124125
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
125126
</actionGroup>
@@ -130,31 +131,26 @@
130131
<argument name="layoutOption" value="PageBuilderFullWidthLayout.category"/>
131132
</actionGroup>
132133
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
133-
<!-- Check that content is displayed on storefront -->
134-
<comment userInput="Check that content is displayed on storefront" stepKey="commentSeeContent"/>
134+
<!-- Check that content is displayed on storefront with the category full width layout -->
135+
<comment userInput="Check that content is displayed on storefront with the product full width layout" stepKey="commentSeeContent"/>
136+
<openNewTab stepKey="openNewTab"/>
135137
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
136138
<argument name="contentType" value="PageBuilderRowContentType"/>
137139
</actionGroup>
138140
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText"/>
139-
<seeElement selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="seeStorefrontHeadingText"/>
140-
<!-- Edit CMS Page in Admin panel -->
141-
<comment userInput="Edit CMS Page in Admin Panel" stepKey="commentEditPage"/>
142-
<actionGroup ref="searchAndViewCmsPage" stepKey="searchAndViewCmsPage">
143-
<argument name="contentType" value="PageBuilderRowContentType"/>
144-
</actionGroup>
145141
<!-- Use Product - Full Width layout -->
146142
<comment userInput="Set Layout to Product - Full Width" stepKey="commentSetLayout2"/>
143+
<switchToNextTab stepKey="switchToNextTab"/>
147144
<actionGroup ref="setLayout" stepKey="setProductFullWidthLayout">
148145
<argument name="designSection" value="CmsDesignSection"/>
149146
<argument name="layoutOption" value="PageBuilderFullWidthLayout.product"/>
150147
</actionGroup>
151148
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
152-
<!-- Check that content is displayed on storefront -->
153-
<comment userInput="Check that content is displayed on storefront" stepKey="commentSeeContent2"/>
154-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront2">
155-
<argument name="contentType" value="PageBuilderRowContentType"/>
156-
</actionGroup>
149+
<!-- Check that content is displayed on storefront with the product full width layout -->
150+
<comment userInput="Check that content is displayed on storefront with the product full width layout" stepKey="commentSeeContent2"/>
151+
<switchToNextTab stepKey="switchToNextTab1"/>
152+
<reloadPage stepKey="reloadPage"/>
153+
<waitForPageLoad stepKey="waitForPageReload"/>
157154
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText2"/>
158-
<seeElement selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="seeStorefrontHeadingText2"/>
159155
</test>
160156
</tests>

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

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
4242
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
4343
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
44-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
44+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
4545
<!-- Set background color of row -->
4646
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
4747
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
@@ -84,7 +84,7 @@
8484
<description value="Create product with unsupported Page Builder full width layout"/>
8585
<severity value="MAJOR"/>
8686
<useCaseId value="MC-936"/>
87-
<testCaseId value="MC-309"/>
87+
<testCaseId value="MC-3172"/>
8888
<group value="pagebuilder"/>
8989
<group value="pagebuilder-fullwidth"/>
9090
</annotations>
@@ -97,6 +97,7 @@
9797
</actionGroup>
9898
</before>
9999
<after>
100+
<closeTab stepKey="closeTab"/>
100101
<actionGroup ref="logout" stepKey="logout"/>
101102
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
102103
</after>
@@ -109,7 +110,7 @@
109110
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
110111
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
111112
<waitForElementVisible selector="{{PageBuilderPanel.generalGroup}}" stepKey="waiForPageBuilderVisible" />
112-
<seeElement selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
113+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
113114
<!-- Set background color of row -->
114115
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
115116
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
@@ -119,11 +120,11 @@
119120
<argument name="property" value="PageBuilderBackgroundColor_HSV_Orange"/>
120121
</actionGroup>
121122
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings"/>
123+
<!-- Add heading to stage -->
124+
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
122125
<actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage">
123126
<argument name="contentType" value="PageBuilderHeadingContentType"/>
124127
</actionGroup>
125-
<!-- Add heading to stage -->
126-
<comment userInput="Add heading to stage" stepKey="commentAddHeadingToStage"/>
127128
<actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage">
128129
<argument name="headingText" value="PageBuilderHeadingTextProperty"/>
129130
</actionGroup>
@@ -138,34 +139,27 @@
138139
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
139140
<waitForPageLoad stepKey="waitForPageLoadSaveProduct"/>
140141
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
141-
<!-- Check that content is displayed on storefront -->
142-
<comment userInput="Check that content is displayed on storefront" stepKey="commentSeeContent"/>
142+
<!-- Check that content is displayed on storefront with category full width layout -->
143+
<comment userInput="Check that content is displayed on storefront with category full width layout" stepKey="commentSeeContent"/>
144+
<openNewTab stepKey="openNewTab"/>
143145
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/>
144146
<waitForPageLoad stepKey="waitForPageLoadProductPage"/>
145147
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText"/>
146-
<seeElement selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="seeStorefrontHeadingText"/>
147-
<!-- Edit product in admin panel -->
148-
<comment userInput="Edit product in admin panel" stepKey="commentEditProduct"/>
149-
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct">
150-
<argument name="product" value="$$createSimpleProduct$$"/>
151-
</actionGroup>
152-
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
153-
<argument name="product" value="_defaultProduct"/>
154-
</actionGroup>
155148
<!-- Set Layout to Page - Full Width -->
156149
<comment userInput="Set Layout to Page - Full Width" stepKey="commentSetLayout2"/>
150+
<switchToNextTab stepKey="switchToNextTab"/>
157151
<actionGroup ref="setLayout" stepKey="setPageFullWidthLayout">
158152
<argument name="designSection" value="ProductDesignSection"/>
159153
<argument name="layoutOption" value="PageBuilderFullWidthLayout.cms"/>
160154
</actionGroup>
161155
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/>
162156
<waitForPageLoad stepKey="waitForPageLoadSaveProduct2"/>
163157
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess2"/>
164-
<!-- Check that content is displayed on storefront -->
158+
<!-- Check that content is displayed on storefront with Page full width layout -->
165159
<comment userInput="Check that content is displayed on storefront" stepKey="commentSeeContent2"/>
166-
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage2"/>
167-
<waitForPageLoad stepKey="waitForPageLoadProductPage2"/>
160+
<switchToNextTab stepKey="switchToNextTab1"/>
161+
<reloadPage stepKey="reloadPage"/>
162+
<waitForPageLoad stepKey="waitForPageReload"/>
168163
<waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="waitForStorefrontHeadingText2"/>
169-
<seeElement selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextProperty.value, '1')}}" stepKey="seeStorefrontHeadingText2"/>
170164
</test>
171165
</tests>

0 commit comments

Comments
 (0)