|
3004 | 3004 | </actionGroup>
|
3005 | 3005 | <seeElement selector="{{TextOnStage.textAnchorText('1', PageBuilderTextProperty.value)}}" stepKey="seeAnchorInWysiwyg"/>
|
3006 | 3006 | </test>
|
| 3007 | + <test name="TextVerifySelectionInlineWYSIWYG"> |
| 3008 | + <annotations> |
| 3009 | + <features value="PageBuilder"/> |
| 3010 | + <stories value="Text"/> |
| 3011 | + <title value="TinyMCE4 selection is preserved after initiation"/> |
| 3012 | + <description value="Verify that a users selection is not lost between select and initiation"/> |
| 3013 | + <severity value="MAJOR"/> |
| 3014 | + <useCaseId value=""/> |
| 3015 | + <testCaseId value=""/> |
| 3016 | +<!-- <group value="pagebuilder"/>--> |
| 3017 | + <group value="pagebuilder-text"/> |
| 3018 | + </annotations> |
| 3019 | + <before> |
| 3020 | + <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> |
| 3021 | + <magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="switchToTinyMCE4"/> |
| 3022 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 3023 | + </before> |
| 3024 | + <after> |
| 3025 | + <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> |
| 3026 | + <actionGroup ref="logout" stepKey="logout"/> |
| 3027 | + </after> |
| 3028 | + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1"> |
| 3029 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 3030 | + </actionGroup> |
| 3031 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection1"> |
| 3032 | + <argument name="contentType" value="PageBuilderTextContentType"/> |
| 3033 | + </actionGroup> |
| 3034 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragButtonsOntoStage"> |
| 3035 | + <argument name="contentType" value="PageBuilderTextContentType"/> |
| 3036 | + </actionGroup> |
| 3037 | + <click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/> |
| 3038 | + <!-- Create new Heading 2 --> |
| 3039 | + <actionGroup ref="formatTextInlineTinyMCE" stepKey="formatTextHeading2"> |
| 3040 | + <argument name="format" value="TinyMCEFormatHeading2"/> |
| 3041 | + </actionGroup> |
| 3042 | + <pressKey selector="{{TextOnStage.tinymce('1')}}" userInput="{{PageBuilderTextHeadingProperty.value}}" stepKey="addHeadingText"/> |
| 3043 | + <waitForElementVisible selector="{{TextOnStage.textWithTag('1', TinyMCEFormatHeading2.tagName, PageBuilderTextHeadingProperty.value)}}" stepKey="waitForHeadingVisible"/> |
| 3044 | + <seeElement selector="{{TextOnStage.textWithTag('1', TinyMCEFormatHeading2.tagName, PageBuilderTextHeadingProperty.value)}}" stepKey="seeHeadingElement"/> |
| 3045 | + <!-- Add basic text --> |
| 3046 | + <pressKey selector="{{TextOnStage.tinymce('1')}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="goToNewLine"/> |
| 3047 | + <pressKey selector="{{TextOnStage.tinymce('1')}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="addParagraphText"/> |
| 3048 | + <waitForElementVisible selector="{{TextOnStage.text('1', PageBuilderTextProperty.value)}}" stepKey="waitForText"/> |
| 3049 | + <seeElement selector="{{TextOnStage.text('1', PageBuilderTextProperty.value)}}" stepKey="seeText"/> |
| 3050 | + <!-- Add a variable on the previous line --> |
| 3051 | + <pressKey selector="{{TextOnStage.tinymce('1')}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::HOME, \Facebook\WebDriver\WebDriverKeys::ENTER, \Facebook\WebDriver\WebDriverKeys::ARROW_UP]" stepKey="goToPreviousLine"/> |
| 3052 | + <actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE"> |
| 3053 | + <argument name="variable" value="TinyMCEVariableBaseURL"/> |
| 3054 | + </actionGroup> |
| 3055 | + <waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="waitForVariable"/> |
| 3056 | + <seeElement selector="{{TextOnStage.text('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="seeVariableOnStage"/> |
| 3057 | + <actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/> |
| 3058 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 3059 | + <scrollTo selector="{{TextOnStage.tinymce('1')}}" stepKey="scrollToTinyMCE"/> |
| 3060 | + <!-- Select portion of Heading "his is a h" --> |
| 3061 | + <executeInSelenium function="function ($webdriver) use ($I) { |
| 3062 | + $heading = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//div[contains(@class, \'inline-wysiwyg\')]//h2')); |
| 3063 | + $actions = new \Facebook\WebDriver\Interactions\WebDriverActions($webdriver); |
| 3064 | + $actions->moveToElement($heading, {{TinyMCEPartialHeadingSelection.startX}}, {{TinyMCEPartialHeadingSelection.startY}}) |
| 3065 | + ->clickAndHold() |
| 3066 | + ->moveToElement($heading, {{TinyMCEPartialHeadingSelection.endX}}, {{TinyMCEPartialHeadingSelection.endY}}) |
| 3067 | + ->release() |
| 3068 | + ->perform(); |
| 3069 | + }" stepKey="selectTextInTinyMCE"/> |
| 3070 | + <waitForElementVisible selector="{{TextOnStage.tinymceInFocus('1')}}" stepKey="waitForTinyMCEFocus"/> |
| 3071 | + <executeJS function="return window.getSelection().toString()" stepKey="selectionString"/> |
| 3072 | + <assertEquals stepKey="assertSelectionText"> |
| 3073 | + <expectedResult type="string">{{TinyMCEPartialHeadingSelection.selection}}</expectedResult> |
| 3074 | + <actualResult type="variable">selectionString</actualResult> |
| 3075 | + </assertEquals> |
| 3076 | + </test> |
3007 | 3077 | </tests>
|
0 commit comments