Skip to content

Commit 3511972

Browse files
Subrat Kumar PanditSubrat Kumar Pandit
authored andcommitted
ACQE-7206:Change content of WYSIWYG editor if it's disabled by default
Added detailed comment for eack block
1 parent 7aaf675 commit 3511972

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

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

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2828
</before>
2929
<after>
30+
<!-- Remove Image root folder-->
3031
<actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/>
3132
<actionGroup ref="AdminExpandMediaGalleryFolderActionGroup" stepKey="expandStorageRootFolder">
3233
<argument name="FolderName" value="Storage Root"/>
@@ -42,20 +43,22 @@
4243
<waitForPageLoad stepKey="waitForGridReload"/>
4344
<deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock"/>
4445
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage"/>
46+
<!-- Set default option to WYSIWYG Editor Configuration-->
4547
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
4648
<actionGroup ref="CliMediaGalleryEnhancedEnableActionGroup" stepKey="disableOldMediaGallery">
4749
<argument name="enabled" value="1"/>
4850
</actionGroup>
4951
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
52+
<!-- Logout from admin-->
5053
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
5154
</after>
55+
<!-- Set WYSIWYG Editor to disabled By Default -->
5256
<actionGroup ref="NavigateToAdminContentManagementPageActionGroup" stepKey="navigateToCmsConfigPage"/>
5357
<conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/>
5458
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/>
5559
<uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/>
5660
<selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Disabled by Default" stepKey="disableWYSIWYG"/>
5761
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/>
58-
5962
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
6063
<magentoCLI command="config:set cms/pagebuilder/enabled 0" stepKey="disablePageBuilder"/>
6164
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
@@ -66,15 +69,18 @@
6669
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/>
6770
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="selectCreatedCategory"/>
6871
<waitForPageLoad stepKey="waitForPageToLoaded2"/>
72+
<!-- Navigate to Content & Click On Show hide button and then Asset WYSIWYG editor for Category-->
6973
<click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab"/>
7074
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="toggleShowHiddenForCategory"/>
7175
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCECategory"/>
7276
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="toggleShowHiddenForCategory1"/>
7377
<waitForElementNotVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCECategory1"/>
7478
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="toggleShowHiddenForCategory2"/>
7579
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCECategory2"/>
80+
<!-- Verify Content Description By Adding Text into It -->
7681
<executeJS function="tinyMCE.get('category_form_description').setContent('%Hello Category World!');" stepKey="executeJSFillContent"/>
7782
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="clickOnShowHideEditorBtn"/>
83+
<!-- Verify Content Description By inserting Image -->
7884
<actionGroup ref="AdminOpenMediaGalleryFromPageNoEditorActionGroup" stepKey="openMediaGalleryForPage"/>
7985
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilter"/>
8086
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectWysiwygFolder">
@@ -97,6 +103,7 @@
97103
</actionGroup>
98104
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
99105
<waitForElementVisible selector="{{TinyMCESection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSourceCategoryDescription"/>
106+
<!-- Assert Content Description In Storefront (Image and Text) -->
100107
<waitForText userInput="%Hello Category World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/>
101108
<actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery2"/>
102109
<actionGroup ref="AdminExpandMediaGalleryFolderActionGroup" stepKey="expandWysiwygFolder2">
@@ -113,6 +120,7 @@
113120
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openSimpleProduct">
114121
<argument name="product" value="$$createSimpleProduct$$"/>
115122
</actionGroup>
123+
<!-- Navigate to Content & Click On Show hide button and then Asset WYSIWYG editor for Product-->
116124
<waitForElementClickable selector="{{AdminProductFormSection.contentTab}}" stepKey="waitToClickContentTab"/>
117125
<click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTabForProduct"/>
118126
<waitForPageLoad stepKey="waitForGridLoad2"/>
@@ -123,14 +131,15 @@
123131
<click selector="{{ProductShortDescriptionWysiwygSection.form}} {{TinyMCESection.ShowHideBtn}}" stepKey="clickAgainShowHideBtn2"/>
124132
<click selector="{{ProductShortDescriptionWysiwygSection.form}} {{TinyMCESection.EditArea}}" stepKey="focusProductShortDescriptionWysiwyg2"/>
125133
<waitForElementVisible selector="{{ProductShortDescriptionWysiwygSection.form}} {{TinyMCESection.TinyMCE}}" stepKey="waitForShortDescription2"/>
134+
<!-- Verify Product Content ShortDescription By Adding Text into It -->
126135
<executeJS function="tinyMCE.get('product_form_short_description').setContent('%Hello World! Short Content');" stepKey="executeJSFillContent2"/>
127136
<scrollTo selector="{{ProductDescriptionWysiwygSection.form}} {{TinyMCESection.ShowHideBtn}}" stepKey="scrollToDesShowHideBtn1"/>
128137
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="clickShowHideEditorBtn1"/>
129138
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProductAgain"/>
130139
<conditionalClick selector="{{CmsNewPagePageContentSection.header}}" dependentSelector="{{CmsNewPagePageContentSection.contentHeading}}" visible="false" stepKey="clickExpandContent1"/>
131140
<waitForElementVisible selector="{{ProductShortDescriptionWysiwygSection.form}} {{TinyMCESection.InsertImageBtn}}" stepKey="waitForInsertImageButton1"/>
132141
<click selector="{{ProductShortDescriptionWysiwygSection.form}} {{TinyMCESection.InsertImageBtn}}" stepKey="clickInsertImage1"/>
133-
<!-- wait for initial media gallery load, where the gallery chrome loads (and triggers loading modal) -->
142+
<!--Verify Product Content Short Description By inserting Image -->
134143
<waitForPageLoad stepKey="waitForMediaGalleryInitialLoad1"/>
135144
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetToDefaultView1"/>
136145
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectWysiwygFolder1">
@@ -154,6 +163,7 @@
154163
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache1">
155164
<argument name="tags" value=""/>
156165
</actionGroup>
166+
<!-- Verify the Text and Image in Product short description -->
157167
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goBackToProductPage">
158168
<argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
159169
</actionGroup>
@@ -174,6 +184,7 @@
174184
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
175185
<argument name="product" value="$$createSimpleProduct$$"/>
176186
</actionGroup>
187+
<!-- Navigate to Content & Click On Show hide button and then Asset WYSIWYG editor for Product-->
177188
<waitForElementClickable selector="{{AdminProductFormSection.contentTab}}" stepKey="waitToClickContentTab1"/>
178189
<click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTabForProduct1"/>
179190
<waitForElementNotVisible selector="{{ProductDescriptionWysiwygSection.form}} {{TinyMCESection.TinyMCE}}" stepKey="waitForDescription1"/>
@@ -184,7 +195,7 @@
184195
<waitForElementNotVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="assertWYSIWYGEditorNotToBeVisible1"/>
185196
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="clickAgainShowHideBtn1"/>
186197
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="assertAgainWYSIWYGEditorToBeVisible1"/>
187-
<!-- Add content into description -->
198+
<!-- Adding Text for content into Product description -->
188199
<actionGroup ref="AdminOpenContentSectionOnProductPageActionGroup" stepKey="openDescriptionDropDown1"/>
189200
<actionGroup ref="AdminFillInProductDescriptionActionGroup" stepKey="fillLongDescription">
190201
<argument name="description" value="%Hello Test World!"/>
@@ -193,7 +204,7 @@
193204
<conditionalClick selector="{{CmsNewPagePageContentSection.header}}" dependentSelector="{{CmsNewPagePageContentSection.contentHeading}}" visible="false" stepKey="clickExpandContent2"/>
194205
<waitForElementVisible selector="{{ProductDescriptionWysiwygSection.form}} {{TinyMCESection.InsertImageBtn}}" stepKey="waitForInsertImageButton2"/>
195206
<click selector="{{ProductDescriptionWysiwygSection.form}} {{TinyMCESection.InsertImageBtn}}" stepKey="clickInsertImage2"/>
196-
<!-- wait for initial media gallery load, where the gallery chrome loads (and triggers loading modal) -->
207+
<!-- Inserting Image into Product Description -->
197208
<waitForPageLoad stepKey="waitForMediaGalleryLoad"/>
198209
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetToDefaultView2"/>
199210
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectWysiwygFolder2">
@@ -217,6 +228,7 @@
217228
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache2">
218229
<argument name="tags" value=""/>
219230
</actionGroup>
231+
<!-- Verify the Text and Image in Product description -->
220232
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
221233
<argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
222234
</actionGroup>
@@ -241,13 +253,16 @@
241253
<fillField selector="{{BasicFieldNewsletterSection.templateSubject}}" userInput="{{_defaultNewsletter.subject}}" stepKey="fillTemplateSubject"/>
242254
<fillField selector="{{BasicFieldNewsletterSection.senderName}}" userInput="{{_defaultNewsletter.senderName}}" stepKey="fillSenderName"/>
243255
<fillField selector="{{BasicFieldNewsletterSection.senderEmail}}" userInput="{{_defaultNewsletter.senderEmail}}" stepKey="fillSenderEmail"/>
256+
<!-- Navigate to Template & Click On Show hide button and then Asset WYSIWYG editor for Newsletter-->
244257
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="toggleEditorIfHidden"/>
245258
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCEToBeDisplayed"/>
246259
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="toggleEditorIfNotHidden"/>
247260
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCENotToBeDisplayed"/>
248261
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="toggleEditorAgainIfHidden"/>
249262
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCEAgainDisplayed"/>
263+
<!-- Adding Text for content into Newsletter description -->
250264
<executeJS function="tinyMCE.get('text').setContent('%Hello World From Newsletter Template');" stepKey="executeJSFillContentForNewsletter"/>
265+
<!-- Inserting Image for content into Newsletter description -->
251266
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon"/>
252267
<waitForPageLoad stepKey="waitForPageLoad"/>
253268
<actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/>
@@ -275,7 +290,7 @@
275290
<click selector="{{AdminNewsletterGridMainActionsSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview"/>
276291
<switchToWindow stepKey="switchToWindow" userInput="action_window"/>
277292
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/>
278-
<!--Verify that the text and image are present-->
293+
<!--Verify that the text and image are present For NewsLetter-->
279294
<waitForText userInput="%Hello World From Newsletter Template" stepKey="waitForPageLoad3"/>
280295
<waitForElementVisible selector="{{StorefrontNewsletterSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
281296
<closeTab stepKey="closeTab"/>
@@ -293,13 +308,15 @@
293308
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1">
294309
<argument name="CMSPage" value="$$createCMSPage$$"/>
295310
</actionGroup>
311+
<!-- Navigate to Content & Click On Show hide button and then Asset WYSIWYG editor for CMS Page-->
296312
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickOnExpandContent"/>
297313
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="clickShowHiddenForCMSPage"/>
298314
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCE1"/>
299315
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="toggleShowHiddenForCMSPage"/>
300316
<waitForElementNotVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCENotDisplayedInCMSPage"/>
301317
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="toggleShowHiddenForCMSPageAgain"/>
302318
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCEDisplayInCMSPage"/>
319+
<!-- Adding Text for content into CMS Page description -->
303320
<executeJS function="tinyMCE.get('cms_page_form_content').setContent('%Hello CMS World!');" stepKey="executeJSFillCmsContent"/>
304321
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="clickShowHideBtn"/>
305322
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
@@ -312,10 +329,10 @@
312329
<waitForPageLoad stepKey="waitForCMSPageLoad"/>
313330
<actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickOnBrowserBtn"/>
314331
<actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="assertMediaGalleryStorageBtn"/>
315-
<comment userInput="BIC workaround" stepKey="navigateToFolder"/>
316332
<actionGroup ref="AdminExpandMediaGalleryFolderActionGroup" stepKey="expandStorageRootFolder3">
317333
<argument name="FolderName" value="Storage Root"/>
318334
</actionGroup>
335+
<!-- Inserting Image for content into CMS Page description -->
319336
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToWysiwygFolder2">
320337
<argument name="FolderName" value="wysiwyg"/>
321338
</actionGroup>
@@ -336,6 +353,7 @@
336353
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/>
337354
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
338355
<waitForPageLoad stepKey="wait4"/>
356+
<!--Verify that the text and image are present For CMS Page-->
339357
<waitForText userInput="%Hello CMS World" stepKey="seeCmsContent"/>
340358
<waitForElementVisible selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource2"/>
341359
<!--Code Section To Delete ImageFolder-->
@@ -363,13 +381,16 @@
363381
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
364382
</actionGroup>
365383
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView"/>
384+
<!-- Navigate to Content & Click On Show hide button and then Asset WYSIWYG editor for Block-->
366385
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="clickShowEditorBtn3"/>
367386
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCEToBeAppear"/>
368387
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="true" stepKey="clickShowEditorBtn4"/>
369388
<waitForElementNotVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCENotToBeAppear"/>
370389
<conditionalClick selector="{{TinyMCESection.ShowHideBtn}}" dependentSelector="{{TinyMCESection.TinyMCE}}" visible="false" stepKey="clickShowEditorBtn5"/>
371390
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCE5"/>
391+
<!-- Adding Text for content into CMS Block description -->
372392
<executeJS function="tinyMCE.get('cms_block_form_content').setContent('%Hello CMS Block Page');" stepKey="executeJSFillContentForBlock"/>
393+
<!-- Inserting Image for content into CMS Block description -->
373394
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon1"/>
374395
<waitForPageLoad stepKey="waitForPageLoad4"/>
375396
<actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn1"/>
@@ -395,7 +416,7 @@
395416
<click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="clickSaveBlock"/>
396417
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnCMSTestPage"/>
397418
<waitForPageLoad stepKey="waitForPageBlockLoad"/>
398-
<!--see image on Storefront-->
419+
<!--Verify Text & Image on Storefront-->
399420
<waitForText userInput="%Hello CMS Block Page" stepKey="seeContentForCMSBlock"/>
400421
<waitForElementVisible selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource1"/>
401422
</test>

0 commit comments

Comments
 (0)