Skip to content

Commit 6f14ad9

Browse files
committed
MAGETWO-95532: Unable to upload image from TinyMCE3
- modified after CR comments
1 parent ac457a4 commit 6f14ad9

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<element name="imageSelected" type="text" selector="//small[text()='{{var1}}']/parent::*[@class='filecnt selected']" parameterized="true"/>
4242
<element name="ImageSource" type="input" selector=".mce-combobox.mce-abs-layout-item.mce-last.mce-has-open" />
4343
<element name="ImageDescription" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-last" />
44+
<element name="ImageDescriptionTinyMCE3" type="input" selector="#alt" />
4445
<element name="Height" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-first" />
4546
<element name="UploadImage" type="file" selector=".fileupload" />
4647
<element name="OkBtn" type="button" selector="//span[text()='Ok']"/>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,13 @@
2121
<before>
2222
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2323
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
24-
<comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/>
25-
<waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox1" />
26-
<uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/>
27-
<waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown1" />
28-
<selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3" />
29-
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions1" />
30-
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig1" />
24+
<!-- Choose TinyMCE3 as the default WYSIWYG editor-->
25+
<actionGroup ref="SwitchToTinyMCE3" stepKey="switchToTinyMCE3"/>
3126
</before>
3227
<after>
28+
<!-- Switch WYSIWYG editor to TinyMCE4-->
3329
<comment userInput="Reset editor as TinyMCE4" stepKey="chooseTinyMCE4AsEditor"/>
34-
<amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToConfigurationPage" />
35-
<waitForPageLoad stepKey="waitForConfigPageToReload"/>
36-
<conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" />
37-
<waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2" />
38-
39-
<waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown3" />
40-
<selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 4" stepKey="switchToVersion4" />
41-
<checkOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="checkUseSystemValue2"/>
42-
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions2" />
43-
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig2" />
30+
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4"/>
4431
<actionGroup ref="logout" stepKey="logOut"/>
4532
</after>
4633
<amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToPage2"/>
@@ -52,7 +39,8 @@
5239
<comment userInput="Click Insert image button" stepKey="clickImageButton"/>
5340
<click selector="{{TinyMCESection.InsertImageBtnTinyMCE3}}" stepKey="clickInsertImage" />
5441
<waitForPageLoad stepKey="waitForiFrameToLoad" />
55-
<comment userInput="switching to iFrame" stepKey="iFramecomment"/>
42+
<!-- Switch to the Edit/Insert Image iFrame -->
43+
<comment userInput="Switching to iFrame" stepKey="insertImageiFrame"/>
5644
<executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable"/>
5745
<switchToIFrame selector="insert-image" stepKey="switchToIFrame"/>
5846
<click selector="{{MediaGallerySection.browseForImage}}" stepKey="clickBrowse"/>
@@ -65,11 +53,12 @@
6553
<argument name="Image" value="ImageUpload"/>
6654
</actionGroup>
6755
<actionGroup ref="saveImage" stepKey="insertImage"/>
56+
<!-- Switching back to the Edit/Insert Image iFrame-->
6857
<comment userInput="switching back to iFrame" stepKey="switchBackToIFrame"/>
6958
<executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/>
7059
<switchToIFrame selector="insert-image" stepKey="switchToIFrame2"/>
7160
<waitForElementVisible selector="{{MediaGallerySection.insertBtn}}" stepKey="waitForInsertBtnOnIFrame" />
72-
<fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
61+
<fillField selector="{{MediaGallerySection.ImageDescriptionTinyMCE3}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
7362
<click selector="{{MediaGallerySection.insertBtn}}" stepKey="clickInsertBtn" />
7463
<waitForPageLoad stepKey="wait3"/>
7564
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />
2020
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
2121
</actionGroup>
22+
<actionGroup name="SwitchToTinyMCE3">
23+
<comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/>
24+
<waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2" />
25+
<uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/>
26+
<waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2" />
27+
<selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3" />
28+
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />
29+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
30+
</actionGroup>
2231
<actionGroup name="DisabledWYSIWYG">
2332
<amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToConfigurationPage" />
2433
<waitForPageLoad stepKey="wait3"/>

0 commit comments

Comments
 (0)