Skip to content

Commit 276fbb1

Browse files
committed
MC-3308: Automate MFTF for MC-1416
1 parent 7609f85 commit 276fbb1

File tree

4 files changed

+188
-17
lines changed

4 files changed

+188
-17
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTextSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<element name="textInIFrame" type="text" selector="//body//p[.='{{arg1}}']" parameterized="true"/>
3939
<element name="tinyMCEVariable" type="text" selector="(//body//span[contains(@class,'magento-variable') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
4040
<element name="tinyMCEWidget" type="text" selector="(//body//span[contains(@class,'magento-widget') and .='{{arg1}}'])[{{arg2}}]" parameterized="true"/>
41+
<element name="tinyMCEImage" type="text" selector="//img[contains(@src,'{{arg}}')]" parameterized="true"/>
4142
<!-- WYSIWYG Disabled -->
4243
<element name="textArea" type="text" selector="#pagebuilder_text_form_content"/>
4344
<element name="textAreaId" type="text" selector="pagebuilder_text_form_content"/>

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

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,110 @@
88

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">
11+
<test name="CanAddTextBLockToColumnBlock">
12+
<annotations>
13+
<features value="PageBuilder"/>
14+
<stories value="Text"/>
15+
<title value="Add text content block to column"/>
16+
<description value="Verify that user are able to add Text Content Block to Column"/>
17+
<severity value="CRITICAL"/>
18+
<useCaseId value=""/>
19+
<testCaseId value=""/>
20+
<group value="pagebuilder"/>
21+
<group value="pagebuilder-text"/>
22+
<group value="pagebuilder-column-content"/>
23+
</annotations>
24+
<before>
25+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
26+
<createData entity="_defaultCmsPage" stepKey="createCMSPageB" />
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
28+
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
32+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCMSPageB" />
33+
<actionGroup ref="logout" stepKey="logout"/>
34+
</after>
35+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
36+
<argument name="CMSPage" value="$$createCMSPage$$"/>
37+
</actionGroup>
38+
<actionGroup ref="dragContentTypeToStage" stepKey="dragColumnIntoStage">
39+
<argument name="contentType" value="PageBuilderColumnContentType"/>
40+
</actionGroup>
41+
<actionGroup ref="dragContentTypeToStage" stepKey="dragButtonsOntoStage">
42+
<argument name="contentType" value="PageBuilderTextContentType"/>
43+
</actionGroup>
44+
<!--Input text into stage-->
45+
<comment userInput="Input text into stage" stepKey="commentInputTextIntoStage"/>
46+
<executeJS function="tinymce.get(jQuery('.inline-wysiwyg').eq(0).attr('id')).insertContent('Hello World')" stepKey="addTextToWYSIWYG"/>
47+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG1"/>
48+
<!--Verify inputed text on slideout-->
49+
<comment userInput="Verify inputed text on slideout" stepKey="commentVerifyTextOnSlideout"/>
50+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
51+
<argument name="contentType" value="PageBuilderTextContentType"/>
52+
</actionGroup>
53+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame1"/>
54+
<waitForElementVisible selector="{{TextOnConfiguration.textInIFrame('Hello World')}}" stepKey="waitForText"/>
55+
<switchToIFrame stepKey="exitIFrame1"/>
56+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings1"/>
57+
<!--Input variable into stage-->
58+
<comment userInput="Input variable into stage" stepKey="commentInputVariableIntoStage"/>
59+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnEditorArea1"/>
60+
<actionGroup ref="addVariableToTinyMCE" stepKey="addVariableToTinyMCE">
61+
<argument name="variable" value="TinyMCEVariableBaseURL"/>
62+
</actionGroup>
63+
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariableBaseURLStage"/>
64+
<!--Verify inputed variable on slideout-->
65+
<comment userInput="Verify inputed variable on slideout" stepKey="commentVerifyVariableOnSlideout"/>
66+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG2"/>
67+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
68+
<argument name="contentType" value="PageBuilderTextContentType"/>
69+
</actionGroup>
70+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame2"/>
71+
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCEVariable(TinyMCEVariableBaseURL.editPanelValue, '1')}}" stepKey="waitForVariable2"/>
72+
<switchToIFrame stepKey="exitIFrame2"/>
73+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings2"/>
74+
<!--Input widget into stage-->
75+
<comment userInput="Input widget into stage" stepKey="commentInputWidgetIntoStage"/>
76+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnEditorArea2"/>
77+
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
78+
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
79+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
80+
</actionGroup>
81+
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetStage"/>
82+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG"/>
83+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
84+
<argument name="contentType" value="PageBuilderTextContentType"/>
85+
</actionGroup>
86+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame3"/>
87+
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCEWidget(TinyMCEWidgetCMSPageLink.editPanelValue, '1')}}" stepKey="waitForWidget"/>
88+
<switchToIFrame stepKey="exitIFrame3"/>
89+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings"/>
90+
<!--Input image into stage-->
91+
<comment userInput="Input text into stage" stepKey="commentInputImageIntoStage"/>
92+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnTextEditorArea"/>
93+
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" />
94+
<waitForPageLoad stepKey="waitForPageLoad" />
95+
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
96+
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
97+
<actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder">
98+
<argument name="ImageFolder" value="ImageFolder"/>
99+
</actionGroup>
100+
<actionGroup ref="attachImage" stepKey="attachImage1">
101+
<argument name="Image" value="ImageUpload3"/>
102+
</actionGroup>
103+
<actionGroup ref="saveImage" stepKey="insertImage"/>
104+
<actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" />
105+
<seeElementInDOM selector="{{CmsWYSIWYGSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceOnStage"/>
106+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
107+
<!--Verify Content Block on storefront-->
108+
<comment userInput="Verify empty Content Block on storefront" stepKey="commentVerifyEmptyBlock"/>
109+
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
110+
<see userInput="Hello World" stepKey="seeTextContentType"/>
111+
<seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
112+
<seeElementInDOM selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
113+
<seeElementInDOM selector="div.block-cms-link a[href='{{_ENV.MAGENTO_BASE_URL}}/$$createCMSPageB.identifier$$']" stepKey="waitForWidgetStorefront"/>
114+
</test>
11115
<test name="ColumnAddToRowAndHeightAdjusts">
12116
<annotations>
13117
<features value="PageBuilder"/>

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

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<title value="Tabs Content - Add Text to Tabs container and view on Admin and Storefront"/>
1616
<description value="As a Content Manager I want tab to be a container so that I can add any content inside the Tab, not only text"/>
1717
<severity value="CRITICAL"/>
18-
<useCaseId value="MAGETWO-88269"/>
19-
<testCaseId value="MAGETWO-89954"/>
18+
<useCaseId value=""/>
19+
<testCaseId value=""/>
2020
<group value="pagebuilder"/>
2121
<group value="pagebuilder-tabs-content"/>
2222
</annotations>
@@ -50,20 +50,77 @@
5050
<argument name="containerTargetType" value="PageBuilderTabContentType"/>
5151
<argument name="containerTargetIndex" value="1" />
5252
</actionGroup>
53+
<!--Input text into stage-->
54+
<comment userInput="Input text into stage" stepKey="commentInputTextIntoStage"/>
55+
<executeJS function="tinymce.get(jQuery('.inline-wysiwyg').eq(0).attr('id')).insertContent('Hello World')" stepKey="addTextToWYSIWYG"/>
56+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG1"/>
57+
<!--Verify inputed text on slideout-->
58+
<comment userInput="Verify inputed text on slideout" stepKey="commentVerifyTextOnSlideout"/>
59+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
60+
<argument name="contentType" value="PageBuilderTextContentType"/>
61+
</actionGroup>
62+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame1"/>
63+
<waitForElementVisible selector="{{TextOnConfiguration.textInIFrame('Hello World')}}" stepKey="waitForText"/>
64+
<switchToIFrame stepKey="exitIFrame1"/>
65+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings1"/>
66+
<!--Input variable into stage-->
67+
<comment userInput="Input variable into stage" stepKey="commentInputVariableIntoStage"/>
68+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnEditorArea1"/>
69+
<actionGroup ref="addVariableToTinyMCE" stepKey="addVariableToTinyMCE">
70+
<argument name="variable" value="TinyMCEVariableBaseURL"/>
71+
</actionGroup>
72+
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariableBaseURLStage"/>
73+
<!--Verify inputed variable on slideout-->
74+
<comment userInput="Verify inputed variable on slideout" stepKey="commentVerifyVariableOnSlideout"/>
75+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG2"/>
76+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
77+
<argument name="contentType" value="PageBuilderTextContentType"/>
78+
</actionGroup>
79+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame2"/>
80+
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCEVariable(TinyMCEVariableBaseURL.editPanelValue, '1')}}" stepKey="waitForVariable2"/>
81+
<switchToIFrame stepKey="exitIFrame2"/>
82+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings2"/>
83+
<!--Input widget into stage-->
84+
<comment userInput="Input widget into stage" stepKey="commentInputWidgetIntoStage"/>
85+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnEditorArea2"/>
86+
<actionGroup ref="addPageLinkWidgetToTinyMCE" stepKey="addPageLinkWidgetToTinyMCE">
87+
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
88+
<argument name="page" value="$$createCMSPageB.identifier$$"/>
89+
</actionGroup>
90+
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetStage"/>
91+
<click selector="{{CmsNewPagePageBasicFieldsSection.contentHeading}}" stepKey="lostFocusFromWYSIWYG"/>
5392
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
5493
<argument name="contentType" value="PageBuilderTextContentType"/>
5594
</actionGroup>
56-
<waitForLoadingMaskToDisappear stepKey="waitForEditPanelSpinner"/>
57-
<executeJS function="tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'This is some text')" stepKey="addTextToWYSIWYG"/>
58-
<click selector="{{TextOnBackend.triggerValidation}}" stepKey="clickToTriggerValidation"/>
59-
<waitForLoadingMaskToDisappear stepKey="waitForSpinner"/>
60-
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
95+
<switchToIFrame selector="{{TextOnConfiguration.tinyMCEIFrame}}" stepKey="switchToIFrame3"/>
96+
<waitForElementVisible selector="{{TextOnConfiguration.tinyMCEWidget(TinyMCEWidgetCMSPageLink.editPanelValue, '1')}}" stepKey="waitForWidget"/>
97+
<switchToIFrame stepKey="exitIFrame3"/>
98+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings"/>
99+
<!--Input image into stage-->
100+
<comment userInput="Input text into stage" stepKey="commentInputImageIntoStage"/>
101+
<click selector="{{TextOnStage.tinymce}}" stepKey="focusOnTextEditorArea"/>
102+
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" />
103+
<waitForPageLoad stepKey="waitForPageLoad" />
104+
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
105+
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
106+
<actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder">
107+
<argument name="ImageFolder" value="ImageFolder"/>
108+
</actionGroup>
109+
<actionGroup ref="attachImage" stepKey="attachImage1">
110+
<argument name="Image" value="ImageUpload3"/>
111+
</actionGroup>
112+
<actionGroup ref="saveImage" stepKey="insertImage"/>
113+
<actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" />
114+
<seeElementInDOM selector="{{CmsWYSIWYGSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceOnStage"/>
61115
<!-- Verify Tab Height Adjusts to Content - Depends on MQE-818 -->
62116
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
63117
<!-- Verify Text in Tab on storefront -->
64118
<comment userInput="View Tab on storefront" stepKey="viewTabOnStorefront"/>
65-
<amOnPage url="tabs{{PageBuilderPageTitle.pageName}}" stepKey="amOnPageBuilderPage"/>
66-
<see userInput="This is some text" stepKey="assertTextOnStorefront"/>
119+
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
120+
<see userInput="Hello World" stepKey="seeTextContentType"/>
121+
<seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
122+
<seeElementInDOM selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
123+
<seeElementInDOM selector="div.block-cms-link a[href='{{_ENV.MAGENTO_BASE_URL}}/$$createCMSPageB.identifier$$']" stepKey="waitForWidgetStorefront"/>
67124
</test>
68125
<test name="CanAddContentTypeToTab">
69126
<annotations>

0 commit comments

Comments
 (0)