|
18 | 18 | <group value="pagebuilder-tinyMCE"/>
|
19 | 19 | </annotations>
|
20 | 20 | <before>
|
| 21 | + <magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/> |
| 22 | + <magentoCLI command="cache:clean config" stepKey="flushCache"/> |
21 | 23 | <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
|
22 |
| - <magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="switchToTinyMCE4"/> |
23 |
| - <actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/> |
24 | 24 | </before>
|
25 | 25 | <after>
|
26 | 26 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
|
27 | 27 | </after>
|
| 28 | + <actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/> |
28 | 29 | <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
|
29 | 30 | <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
|
30 | 31 | <argument name="contentType" value="PageBuilderColumnContentType"/>
|
|
39 | 40 | <actionGroup ref="dragContentTypeToStage" stepKey="dragTextToColumnContentType">
|
40 | 41 | <argument name="contentType" value="PageBuilderTextContentType"/>
|
41 | 42 | <argument name="containerTargetType" value="PageBuilderColumnContentType"/>
|
| 43 | + <argument name="containerTargetIndex" value="2"/> |
42 | 44 | </actionGroup>
|
43 | 45 | <!-- Add table to Text Editor -->
|
44 | 46 | <clickWithLeftButton x="10" y="10" selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
|
|
53 | 55 | <seeElement selector="{{TextOnStage.elementInText('1', 'td', '7')}}" stepKey="see7TableTd"/>
|
54 | 56 | <dontSeeElement selector="{{TextOnStage.elementInText('1', 'td', '8')}}" stepKey="dontSeeMoreThan7TableTr"/>
|
55 | 57 | <!-- Validate that textarea is visible -->
|
56 |
| - |
| 58 | + <seeElement selector="{{TextOnStage.tinymceInFocus('1')}}" stepKey="seeFocusedTinyMCE"/> |
| 59 | + <seeElement selector="{{WYSIWYGOnPageBuilderInline.tableToolbar}}" stepKey="seeTableToolbar"/> |
| 60 | + <executeJS function="return document.querySelector("{{WYSIWYGOnPageBuilderInline.tableToolbar}}").getBoundingClientRect().top" stepKey="grabTableToolbarTopPosition"/> |
| 61 | + <executeJS function="return document.evaluate("{{WYSIWYGOnPageBuilderInline.toolbarPath('1')}}", document.body).iterateNext().getBoundingClientRect().top" stepKey="grabToolbarTopPosition"/> |
| 62 | + <executeJS function="return Math.abs({$grabTableToolbarTopPosition} - {$grabToolbarTopPosition})" stepKey="topPositionDifference"/> |
| 63 | + <assertLessThanOrEqual stepKey="assertTopPositionDifference"> |
| 64 | + <expectedResult type="int">2</expectedResult> |
| 65 | + <actualResult type="variable">topPositionDifference</actualResult> |
| 66 | + </assertLessThanOrEqual> |
| 67 | + <!-- Add new rows to table and verify that toolbar and textarea changed their position --> |
| 68 | + <waitForElementVisible selector="{{WYSIWYGOnPageBuilderInline.insertRowAfterButton}}" stepKey="waitForInsertRowButton"/> |
| 69 | + <click selector="{{WYSIWYGOnPageBuilderInline.insertRowAfterButton}}" stepKey="clickInsertRowButton"/> |
| 70 | + <waitForElementVisible selector="{{TextOnStage.elementInText('1', 'tr', '2')}}" stepKey="waitForTableSecondRow"/> |
| 71 | + <executeJS function="return document.querySelector("{{WYSIWYGOnPageBuilderInline.tableToolbar}}").getBoundingClientRect().top" stepKey="grabTableToolbarTopPosition2"/> |
| 72 | + <executeJS function="return document.evaluate("{{WYSIWYGOnPageBuilderInline.toolbarPath('1')}}", document.body).iterateNext().getBoundingClientRect().top" stepKey="grabToolbarTopPosition2"/> |
| 73 | + <executeJS function="return Math.abs({$grabTableToolbarTopPosition} - {$grabToolbarTopPosition})" stepKey="topPositionDifference2"/> |
| 74 | + <assertLessThanOrEqual stepKey="assertTopPositionDifference2"> |
| 75 | + <expectedResult type="int">2</expectedResult> |
| 76 | + <actualResult type="variable">topPositionDifference2</actualResult> |
| 77 | + </assertLessThanOrEqual> |
57 | 78 | <!-- Resize column to 4/12 and check toolbar position -->
|
58 |
| - |
| 79 | + <click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unFocusEditor"/> |
| 80 | + <actionGroup ref="duplicateContentType" stepKey="duplicateColumnContentType"> |
| 81 | + <argument name="contentType" value="PageBuilderColumnContentType"/> |
| 82 | + </actionGroup> |
| 83 | + <actionGroup ref="removeContentTypeFromStageByIndex" stepKey="removeColumnContentTypeFromStage"> |
| 84 | + <argument name="contentType" value="PageBuilderColumnContentType"/> |
| 85 | + <argument name="contentTypeNumber" value="2"/> |
| 86 | + </actionGroup> |
| 87 | + <executeJS function="return document.querySelector("{{WYSIWYGOnPageBuilderInline.tableToolbar}}").getBoundingClientRect().top" stepKey="grabTableToolbarTopPosition3"/> |
| 88 | + <executeJS function="return document.evaluate("{{WYSIWYGOnPageBuilderInline.toolbarPath('1')}}", document.body).iterateNext().getBoundingClientRect().top" stepKey="grabToolbarTopPosition3"/> |
| 89 | + <executeJS function="return Math.abs({$grabTableToolbarTopPosition} - {$grabToolbarTopPosition})" stepKey="topPositionDifference3"/> |
| 90 | + <assertLessThanOrEqual stepKey="assertTopPositionDifference3"> |
| 91 | + <expectedResult type="int">2</expectedResult> |
| 92 | + <actualResult type="variable">topPositionDifference3</actualResult> |
| 93 | + </assertLessThanOrEqual> |
59 | 94 | <!-- Resize column back to 3/12 and check toolbar and textarea are visible -->
|
60 |
| - |
61 |
| - |
| 95 | + <executeJS function="return document.querySelector('{{ColumnOnBackend.columnResizeGridLine('1')}}').clientWidth" stepKey="guideWidth"/> |
| 96 | + <dragAndDrop selector1="{{ColumnOnBackend.columnX('1')}} {{ColumnOnBackend.columnResizeHandle}}" selector2="{{ColumnOnBackend.columnResizeGridLine('3')}}" x="$guideWidth" stepKey="dragColumn1"/> |
| 97 | + <waitForPageLoad stepKey="waitForDragAndDrop"/> |
| 98 | + <executeJS function="return document.querySelector("{{WYSIWYGOnPageBuilderInline.tableToolbar}}").getBoundingClientRect().top" stepKey="grabTableToolbarTopPosition4"/> |
| 99 | + <executeJS function="return document.evaluate("{{WYSIWYGOnPageBuilderInline.toolbarPath('1')}}", document.body).iterateNext().getBoundingClientRect().top" stepKey="grabToolbarTopPosition4"/> |
| 100 | + <executeJS function="return Math.abs({$grabTableToolbarTopPosition} - {$grabToolbarTopPosition})" stepKey="topPositionDifference4"/> |
| 101 | + <assertLessThanOrEqual stepKey="assertTopPositionDifference4"> |
| 102 | + <expectedResult type="int">2</expectedResult> |
| 103 | + <actualResult type="variable">topPositionDifference4</actualResult> |
| 104 | + </assertLessThanOrEqual> |
62 | 105 | </test>
|
63 | 106 | </tests>
|
0 commit comments