Skip to content

Commit 2bfdd89

Browse files
authored
Merge pull request #339 from magento-obsessive-owls/PB-285
[Owls] PB-285: Remove 200ms delay from options menu & toolbar on content types
2 parents 7615928 + 9815753 commit 2bfdd89

File tree

6 files changed

+84
-6
lines changed

6 files changed

+84
-6
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<waitForElementVisible selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, targetIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
114114
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, targetIndex)}}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
115115
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, targetIndex)}}" stepKey="waitForOptionsMenu"/>
116+
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeDuplicate(contentType.role, targetIndex)}}" stepKey="waitForDuplicate"/>
116117
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeDuplicate(contentType.role, targetIndex)}}" stepKey="clickDuplicateContentType"/>
117118
<waitForPageLoad time="30" stepKey="waitForAnimation"/>
118119
<executeJS function="return document.querySelectorAll('{{PageBuilderStage.contentTypeTotalInStage(contentType.role)}}').length" stepKey="resultingContentTypeCount"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/StageActionGroup.xml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,43 @@
131131
<arguments>
132132
<argument name="section" defaultValue="TextOnStage"/>
133133
<argument name="index" defaultValue="1" type="string"/>
134+
<argument name="contentTypeXCoordinate" defaultValue="0" type="string"/>
135+
<argument name="contentTypeYCoordinate" defaultValue="0" type="string"/>
134136
</arguments>
135137
<comment userInput="focusOnInlineTinyMCEEditor" stepKey="comment"/>
136138
<waitForElementVisible selector="{{section.tinymce(index)}}" stepKey="waitForEditor"/>
137-
<click selector="{{section.tinymce(index)}}" stepKey="clickEditor"/>
139+
<clickWithLeftButton selector="{{section.tinymce(index)}}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="clickEditor"/>
138140
<waitForPageLoad stepKey="waitForEditorToBeFocused"/>
139141
<waitForElementVisible selector="{{section.tinymceInFocus(index)}}" stepKey="waitForEditorFocused"/>
140142
</actionGroup>
143+
<actionGroup name="goToEndOfLineTinyMCEEditor">
144+
<arguments>
145+
<argument name="section" defaultValue="TextOnStage"/>
146+
<argument name="index" defaultValue="1" type="string"/>
147+
</arguments>
148+
<waitForElementVisible selector="{{section.tinymce(index)}}" stepKey="waitForEditor"/>
149+
<pressKey selector="{{section.tinymce(index)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::END]" stepKey="pressEndKey"/>
150+
</actionGroup>
141151
<actionGroup name="focusOnInlineTextAreaEditor">
142152
<arguments>
143153
<argument name="section" defaultValue="TextOnStage"/>
144154
<argument name="index" defaultValue="1" type="string"/>
155+
<argument name="contentTypeXCoordinate" defaultValue="0" type="string"/>
156+
<argument name="contentTypeYCoordinate" defaultValue="0" type="string"/>
145157
</arguments>
146158
<comment userInput="focusOnInlineTextAreaEditor" stepKey="comment"/>
147159
<waitForElementVisible selector="{{section.textArea(index)}}" stepKey="waitForEditor"/>
148-
<click selector="{{section.textArea(index)}}" stepKey="clickEditor"/>
160+
<clickWithLeftButton selector="{{section.textArea(index)}}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="clickEditor"/>
149161
<waitForPageLoad stepKey="waitForEditorToBeFocused"/>
150162
</actionGroup>
163+
<actionGroup name="goToEndOfLineTextAreaEditor">
164+
<arguments>
165+
<argument name="section" defaultValue="TextOnStage"/>
166+
<argument name="index" defaultValue="1" type="string"/>
167+
</arguments>
168+
<waitForElementVisible selector="{{section.textArea(index)}}" stepKey="waitForEditor"/>
169+
<pressKey selector="{{section.textArea(index)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::END]" stepKey="pressEndKey"/>
170+
</actionGroup>
151171
<actionGroup name="switchTabAndReloadPage">
152172
<switchToNextTab stepKey="switchToNextTab"/>
153173
<reloadPage stepKey="reloadPage"/>

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,30 @@
144144
<!-- Inline Edit: Add Text -->
145145
<comment userInput="Inline Edit: Add Text" stepKey="commentInlineEditAddText"/>
146146
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor"/>
147+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd"/>
147148
<actionGroup ref="addTextToTinyMCEInline" stepKey="addTextToTinyMCEInline">
148149
<argument name="section" value="TextOnStage"/>
149150
<argument name="text" value="{{PageBuilderTextProperty.value}}"/>
150151
</actionGroup>
151152
<!-- Inline Edit: Add Variable -->
152153
<comment userInput="Inline Edit: Add Variable" stepKey="commentInlineEditAddVariable"/>
153154
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor2"/>
155+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd2"/>
154156
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
155157
<argument name="variable" value="TinyMCEVariableBaseURL"/>
156158
</actionGroup>
157159
<!-- Inline Edit: Add Widget -->
158160
<comment userInput="Inline Edit: Add Widget" stepKey="commentInlineEditAddWidget"/>
159161
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor3"/>
162+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd3"/>
160163
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
161164
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
162165
<argument name="page" value="$$createPreReqCMSPage.identifier$$"/>
163166
</actionGroup>
164167
<!-- Inline Edit: Add Image -->
165168
<comment userInput="Inline Edit: Add Image" stepKey="commentInlineEditAddImage"/>
166169
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor4"/>
170+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd4"/>
167171
<actionGroup ref="clickInsertImageInTinyMCE" stepKey="clickInsertImageInTinyMCE"/>
168172
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
169173
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
@@ -315,7 +319,15 @@
315319
<comment userInput="Validate CMS Block Stage" stepKey="commentValidateCMSBlockStage"/>
316320
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaContainsValueCMSBlockStage">
317321
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
318-
<argument name="value" value="{{PageBuilderTextProperty.value}}{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}{{PageBuilderTextArea_WidgetCMSHomepageLink.editPanelValue}}"/>
322+
<argument name="value" value="{{PageBuilderTextProperty.value}}"/>
323+
</actionGroup>
324+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaContainsValueCMSBlockStage2">
325+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
326+
<argument name="value" value="{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}"/>
327+
</actionGroup>
328+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaContainsValueCMSBlockStage3">
329+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
330+
<argument name="value" value="{{PageBuilderTextArea_WidgetCMSHomepageLink.editPanelValue}}"/>
319331
</actionGroup>
320332
<!-- Add Block to CMS Page -->
321333
<comment userInput="Add Block to CMS Page" stepKey="commentAddBlockToCMSPage"/>

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,9 @@
905905
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor">
906906
<argument name="section" value="BannerOnBackend"/>
907907
</actionGroup>
908+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd">
909+
<argument name="section" value="BannerOnBackend"/>
910+
</actionGroup>
908911
<actionGroup ref="addTextToTinyMCEInline" stepKey="addTextToTinyMCEInline">
909912
<argument name="section" value="BannerOnBackend"/>
910913
<argument name="text" value="{{PageBuilderBannerMessageProperty.value}}"/>
@@ -914,6 +917,9 @@
914917
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor2">
915918
<argument name="section" value="BannerOnBackend"/>
916919
</actionGroup>
920+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd2">
921+
<argument name="section" value="BannerOnBackend"/>
922+
</actionGroup>
917923
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
918924
<argument name="variable" value="TinyMCEVariableBaseURL"/>
919925
</actionGroup>
@@ -922,6 +928,9 @@
922928
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor3">
923929
<argument name="section" value="BannerOnBackend"/>
924930
</actionGroup>
931+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd3">
932+
<argument name="section" value="BannerOnBackend"/>
933+
</actionGroup>
925934
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
926935
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
927936
<argument name="page" value="$$createPreReqCMSPage.identifier$$"/>
@@ -931,6 +940,9 @@
931940
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor4">
932941
<argument name="section" value="BannerOnBackend"/>
933942
</actionGroup>
943+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd4">
944+
<argument name="section" value="BannerOnBackend"/>
945+
</actionGroup>
934946
<actionGroup ref="clickInsertImageInTinyMCE" stepKey="clickInsertImageInTinyMCE"/>
935947
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
936948
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
@@ -1064,6 +1076,9 @@
10641076
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor">
10651077
<argument name="section" value="BannerOnBackend"/>
10661078
</actionGroup>
1079+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine">
1080+
<argument name="section" value="BannerOnBackend"/>
1081+
</actionGroup>
10671082
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addTextToTinyMCEInline">
10681083
<argument name="section" value="BannerOnBackend"/>
10691084
<argument name="text" value="{{PageBuilderBannerMessageProperty.value}}"/>
@@ -1072,6 +1087,9 @@
10721087
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor2">
10731088
<argument name="section" value="BannerOnBackend"/>
10741089
</actionGroup>
1090+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine2">
1091+
<argument name="section" value="BannerOnBackend"/>
1092+
</actionGroup>
10751093
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addVariableToTinyMCE">
10761094
<argument name="section" value="BannerOnBackend"/>
10771095
<argument name="text" value="{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}"/>
@@ -1081,6 +1099,9 @@
10811099
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor3">
10821100
<argument name="section" value="BannerOnBackend"/>
10831101
</actionGroup>
1102+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine3">
1103+
<argument name="section" value="BannerOnBackend"/>
1104+
</actionGroup>
10841105
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addPageLinkWidgetToTinyMCE">
10851106
<argument name="section" value="BannerOnBackend"/>
10861107
<argument name="text" value="{{PageBuilderTextArea_WidgetCMSHomepageLink.editPanelValue}}"/>
@@ -1171,6 +1192,9 @@
11711192
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor">
11721193
<argument name="section" value="SlideOnBackend"/>
11731194
</actionGroup>
1195+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd">
1196+
<argument name="section" value="SlideOnBackend"/>
1197+
</actionGroup>
11741198
<actionGroup ref="addTextToTinyMCEInline" stepKey="addTextToTinyMCEInline">
11751199
<argument name="section" value="SlideOnBackend"/>
11761200
<argument name="text" value="{{PageBuilderSlideItemContent_Slide1.value}}"/>
@@ -1803,6 +1827,9 @@
18031827
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor">
18041828
<argument name="section" value="SlideOnBackend"/>
18051829
</actionGroup>
1830+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd">
1831+
<argument name="section" value="SlideOnBackend"/>
1832+
</actionGroup>
18061833
<actionGroup ref="addTextToTinyMCEInline" stepKey="addTextToTinyMCEInline">
18071834
<argument name="section" value="SlideOnBackend"/>
18081835
<argument name="text" value="{{PageBuilderSlideItemContent_Slide1.value}}"/>
@@ -1812,6 +1839,9 @@
18121839
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor2">
18131840
<argument name="section" value="SlideOnBackend"/>
18141841
</actionGroup>
1842+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd2">
1843+
<argument name="section" value="SlideOnBackend"/>
1844+
</actionGroup>
18151845
<actionGroup ref="addVariableToTinyMCEInline" stepKey="addVariableToTinyMCE">
18161846
<argument name="variable" value="TinyMCEVariableBaseURL"/>
18171847
</actionGroup>
@@ -1820,6 +1850,9 @@
18201850
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor3">
18211851
<argument name="section" value="SlideOnBackend"/>
18221852
</actionGroup>
1853+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd3">
1854+
<argument name="section" value="SlideOnBackend"/>
1855+
</actionGroup>
18231856
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
18241857
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
18251858
<argument name="page" value="$$createPreReqCMSPage.identifier$$"/>
@@ -1829,6 +1862,9 @@
18291862
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor4">
18301863
<argument name="section" value="SlideOnBackend"/>
18311864
</actionGroup>
1865+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd4">
1866+
<argument name="section" value="SlideOnBackend"/>
1867+
</actionGroup>
18321868
<actionGroup ref="clickInsertImageInTinyMCE" stepKey="clickInsertImageInTinyMCE"/>
18331869
<actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/>
18341870
<actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/>
@@ -1847,6 +1883,9 @@
18471883
<actionGroup ref="focusOnInlineTinyMCEEditor" stepKey="focusOnInlineTinyMCEEditor5">
18481884
<argument name="section" value="SlideOnBackend"/>
18491885
</actionGroup>
1886+
<actionGroup ref="goToEndOfLineTinyMCEEditor" stepKey="moveCaretToEnd5">
1887+
<argument name="section" value="SlideOnBackend"/>
1888+
</actionGroup>
18501889
<seeElement selector="{{SlideOnBackend.messageContent('1', PageBuilderSlideItemContent_Slide1.value)}}" stepKey="seeTextCMSBlockStage"/>
18511890
<seeElement selector="{{SlideOnBackend.messageContent('1', TinyMCEVariableBaseURL.editPanelValue)}}" stepKey="seeVariableCMSBlockStage"/>
18521891
<seeElement selector="{{SlideOnBackend.messageContent('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="seeWidgetCMSBlockStage"/>
@@ -1965,6 +2004,9 @@
19652004
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor">
19662005
<argument name="section" value="SlideOnBackend"/>
19672006
</actionGroup>
2007+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine">
2008+
<argument name="section" value="SlideOnBackend"/>
2009+
</actionGroup>
19682010
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addTextToTinyMCEInline">
19692011
<argument name="section" value="SlideOnBackend"/>
19702012
<argument name="text" value="{{PageBuilderSlideItemContent_Slide1.value}}"/>
@@ -1973,6 +2015,9 @@
19732015
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor2">
19742016
<argument name="section" value="SlideOnBackend"/>
19752017
</actionGroup>
2018+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine2">
2019+
<argument name="section" value="SlideOnBackend"/>
2020+
</actionGroup>
19762021
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addVariableToTinyMCE">
19772022
<argument name="section" value="SlideOnBackend"/>
19782023
<argument name="text" value="{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}"/>
@@ -1982,6 +2027,9 @@
19822027
<actionGroup ref="focusOnInlineTextAreaEditor" stepKey="focusOnInlineTextAreaEditor3">
19832028
<argument name="section" value="SlideOnBackend"/>
19842029
</actionGroup>
2030+
<actionGroup ref="goToEndOfLineTextAreaEditor" stepKey="goToEndOfLine3">
2031+
<argument name="section" value="SlideOnBackend"/>
2032+
</actionGroup>
19852033
<actionGroup ref="addTextToTinyMCEInlineWYSIWYGDisabled" stepKey="addPageLinkWidgetToTinyMCE">
19862034
<argument name="section" value="SlideOnBackend"/>
19872035
<argument name="text" value="{{PageBuilderTextArea_WidgetCMSHomepageLink.editPanelValue}}"/>

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_toolbar.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
.pagebuilder-toolbar-options {
2121
opacity: 1;
22-
transition-delay: 200ms;
2322
visibility: visible;
2423
}
2524
}

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/_preview.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@
318318

319319
.pagebuilder-options-visible {
320320
opacity: 1;
321-
transition-delay: 200ms;
322321
visibility: visible;
323322
}
324323

@@ -468,7 +467,6 @@
468467
top: -20px;
469468
transform: translate(50%, -50%);
470469
transition: opacity 200ms, visibility 200ms, transform 200ms;
471-
transition-delay: 0ms !important; // Arrow options have no delay in transitioning out
472470

473471
.pagebuilder-options-wrapper {
474472
&:after {

0 commit comments

Comments
 (0)