Skip to content

Commit 70e70b9

Browse files
committed
Merge branch 'MAGETWO-92775-tabs' into cms-team-1-delivery
2 parents 6907b0e + e6cdc4e commit 70e70b9

22 files changed

+668
-540
lines changed

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

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -228,23 +228,20 @@
228228
<waitForPageLoad stepKey="waitForAnimation1" time="30"/>
229229
<waitForElementVisible selector="{{PageBuilderActionsSection.editForm}}" stepKey="waitForEditForm"/>
230230
<see userInput="Edit {{contentType.name}}" selector="{{PageBuilderActionsSection.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
231-
<waitForPageLoad stepKey="waitForAnimation2" time="30"/>
232231
</actionGroup>
233232
<actionGroup name="openPageBuilderEditPanelSmallByIndex">
234233
<arguments>
235-
<argument name="contentType" defaultValue=""/>
236-
<argument name="contentTypeIndex" defaultValue="1" type="string"/>
234+
<argument name="section"/>
235+
<argument name="targetIndex" defaultValue="1" type="string"/>
237236
</arguments>
238-
<waitForElementVisible time="20" selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForButtonElement"/>
239-
<click selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="clickButtonElement"/>
240-
<waitForPageLoad stepKey="waitForPageLoad"/>
241-
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentTypeOptionsMenuByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForOptions"/>
242-
<waitForElementVisible selector="{{PageBuilderActionsSection.contentTypeEditByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForEditButton"/>
243-
<click selector="{{PageBuilderActionsSection.contentTypeEditByIndex(contentType.role, contentTypeIndex)}}" stepKey="clickEditButton"/>
237+
<waitForElementVisible time="20" selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="waitForContentType"/>
238+
<click selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="clickContentType"/>
239+
<waitForPageLoad stepKey="waitForPageLoad1"/>
240+
<waitForElementVisible time="10" selector="{{section.optionsMenu(targetIndex)}}" stepKey="waitForOptionsMenu"/>
241+
<waitForElementVisible selector="{{section.optionsMenuButton(targetIndex, 'edit')}}" stepKey="waitForEditButton"/>
242+
<click selector="{{section.optionsMenuButton(targetIndex, 'edit')}}" stepKey="clickEditButton"/>
243+
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
244244
<waitForElementVisible time="5" selector="{{PageBuilderActionsSection.editForm}}" stepKey="waitForEditForm"/>
245-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
246-
<see userInput="Edit {{contentType.name}}" selector="{{PageBuilderActionsSection.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
247-
<waitForPageLoad stepKey="waitForPageLoad2"/>
248245
</actionGroup>
249246
<actionGroup name="duplicateContentType">
250247
<arguments>
@@ -261,17 +258,22 @@
261258
</actionGroup>
262259
<actionGroup name="duplicateSmallContentType">
263260
<arguments>
264-
<argument name="contentType" defaultValue=""/>
261+
<argument name="section"/>
265262
<argument name="targetIndex" defaultValue="1" type="string"/>
266-
<argument name="expectedIndex" defaultValue="2" type="string"/>
267263
</arguments>
268-
<waitForElementVisible selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, targetIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
269-
<click selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, targetIndex)}}" stepKey="clickContentTypeStage"/>
264+
<waitForElement selector="{{section.all}}" stepKey="waitForAllContentTypes"/>
265+
<executeJS function="return document.querySelectorAll('{{section.all}}').length+1" stepKey="expectedContentTypeCount"/>
266+
<waitForElementVisible selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="waitForContentTypeVisible"/>
267+
<click selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="clickContentType"/>
270268
<waitForPageLoad stepKey="waitForPageLoad1"/>
271-
<waitForElementVisible selector="{{PageBuilderActionsSection.contentTypeOptionsMenuByIndex(contentType.role, targetIndex)}}" stepKey="waitForOptionsMenu"/>
272-
<click selector="{{PageBuilderActionsSection.contentTypeDuplicate(contentType.role, targetIndex)}}" stepKey="clickDuplicateContentType"/>
269+
<waitForElementVisible selector="{{section.optionsMenu(targetIndex)}}" stepKey="waitForOptionsMenu"/>
270+
<click selector="{{section.optionsMenuButton(targetIndex, 'duplicate')}}" stepKey="clickDuplicate"/>
273271
<waitForPageLoad stepKey="waitForPageLoad2"/>
274-
<waitForElementVisible selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, expectedIndex)}}" stepKey="waitForDuplicateContentType"/>
272+
<executeJS function="return document.querySelectorAll('{{section.all}}').length" stepKey="resultingContentTypeCount"/>
273+
<assertEquals stepKey="assertContentTypeCount">
274+
<actualResult type="variable">$resultingContentTypeCount</actualResult>
275+
<expectedResult type="variable">$expectedContentTypeCount</expectedResult>
276+
</assertEquals>
275277
</actionGroup>
276278
<actionGroup name="openPageBuilderOptionsByIndex">
277279
<arguments>
@@ -284,6 +286,16 @@
284286
<moveMouseOver selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
285287
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentTypeEditByIndex(contentType.role, contentTypeNumber)}}" stepKey="waitForOptions" />
286288
</actionGroup>
289+
<actionGroup name="openPageBuilderOptionsMenuSmallByIndex">
290+
<arguments>
291+
<argument name="section"/>
292+
<argument name="targetIndex" defaultValue="1" type="string"/>
293+
</arguments>
294+
<waitForElementVisible time="20" selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="waitForContentType"/>
295+
<click selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="clickContentType"/>
296+
<waitForPageLoad stepKey="waitForPageLoad"/>
297+
<waitForElementVisible time="10" selector="{{section.optionsMenu(targetIndex)}}" stepKey="waitForOptionsMenu"/>
298+
</actionGroup>
287299
<actionGroup name="removeEmptyContentTypeFromStage">
288300
<!-- Remove a content type which is in it's default state -->
289301
<arguments>
@@ -316,15 +328,15 @@
316328
</actionGroup>
317329
<actionGroup name="removeContentTypeFromStageSmallByIndex">
318330
<arguments>
319-
<argument name="contentType" defaultValue=""/>
320-
<argument name="contentTypeIndex" defaultValue="2" type="string"/>
331+
<argument name="section"/>
332+
<argument name="targetIndex" defaultValue="1" type="string"/>
321333
</arguments>
322-
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForButtonElement"/>
323-
<click selector="{{PageBuilderActionsSection.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="clickButtonElement"/>
334+
<waitForElementVisible time="20" selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="waitForContentType"/>
335+
<click selector="{{section.openOptionsMenu(targetIndex)}}" stepKey="clickContentType"/>
324336
<waitForPageLoad stepKey="waitForPageLoad"/>
325-
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentTypeOptionsMenuByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForOptions"/>
326-
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentTypeRemoveByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForRemoveButton"/>
327-
<click selector="{{PageBuilderActionsSection.contentTypeRemoveByIndex(contentType.role, contentTypeIndex)}}" stepKey="clickRemoveContentType"/>
337+
<waitForElementVisible time="10" selector="{{section.optionsMenu(targetIndex)}}" stepKey="waitForOptionsMenu"/>
338+
<waitForElementVisible time="10" selector="{{section.optionsMenuButton(targetIndex, 'remove')}}" stepKey="waitForRemoveButton"/>
339+
<click selector="{{section.optionsMenuButton(targetIndex, 'remove')}}" stepKey="clickRemoveButton"/>
328340
<waitForPageLoad stepKey="waitForPageLoad2"/>
329341
</actionGroup>
330342
<actionGroup name="confirmRemovalModal">
@@ -835,7 +847,7 @@
835847
<argument name="group"/>
836848
</arguments>
837849
<waitForElementVisible selector="{{PageBuilderActionsSection.panelGroup(group.section)}}" stepKey="waitForGroupVisible"/>
838-
<conditionalClick selector="{{PageBuilderActionsSection.panelGroup(group.section)}}" dependentSelector="{{PageBuilderActionsSection.panelGroupActive(group.name)}}" visible="false" stepKey="expandGroup"/>
850+
<conditionalClick selector="{{PageBuilderActionsSection.panelGroup(group.section)}}" dependentSelector="{{PageBuilderActionsSection.panelGroupActive(group.section)}}" visible="false" stepKey="expandGroup"/>
839851
<waitForElementVisible selector="{{PageBuilderActionsSection.panelGroupActive(group.section)}}" stepKey="waitForGroupExpanded"/>
840852
</actionGroup>
841853
<actionGroup name="navigateToStoreFront">

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

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,27 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="switchSlide">
1212
<arguments>
13+
<argument name="section" defaultValue="SliderOnFrontend"/>
1314
<argument name="index" defaultValue="2" type="string"/>
1415
</arguments>
15-
<waitForElementVisible selector="{{SliderOnFrontend.slideNavigator(index)}}" stepKey="waitForSliderButton"/>
16-
<click selector="{{SliderOnFrontend.slideNavigator(index)}}" stepKey="clickSliderButton"/>
17-
<waitForElementVisible selector="{{SlideOnFrontend.slide(index)}}" stepKey="waitForSlide"/>
16+
<waitForElementVisible selector="{{section.slideNavigator(index)}}" stepKey="waitForSliderButton"/>
17+
<click selector="{{section.slideNavigator(index)}}" stepKey="clickSliderButton"/>
18+
<waitForElementVisible selector="{{section.slide(index)}}" stepKey="waitForSlide"/>
1819
</actionGroup>
1920
<actionGroup name="unfocusSlideOptions">
2021
<click selector="{{PageBuilderActionsSection.searchPanel}}" stepKey="clickOutsideLiveEdit"/>
2122
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
22-
<waitForElementNotVisible selector="{{SliderInAdmin.slideOptionsEdit}}" stepKey="dontSeeSlideOptionsEdit"/>
23-
</actionGroup>
24-
<actionGroup name="openSlideOptions">
25-
<comment userInput="Open slide options" stepKey="commentOpen"/>
26-
<waitForElementVisible time="10" selector="{{SliderInAdmin.sliderContainer}}" stepKey="waitForContentTypeInStageVisible" />
27-
<click stepKey="clickNavigationDot" selector="{{SliderInAdmin.firstSlideNavigationDot}}"/>
28-
<waitForElementVisible selector="{{SliderInAdmin.slideOptionsEdit}}" stepKey="waitForSlideOptionsEdit"/>
29-
<click selector="{{SliderInAdmin.slideOptionsEdit}}" stepKey="clickEditContentType"/>
30-
<waitForLoadingMaskToDisappear stepKey="waitForAnimation" />
31-
<waitForElementVisible time="5" selector="{{PageBuilderActionsSection.editForm}}" stepKey="waitForEditForm" />
32-
<see userInput="Edit Slide" selector="{{PageBuilderActionsSection.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
33-
</actionGroup>
34-
<actionGroup name="openSlideOptionsByIndex">
35-
<arguments>
36-
<argument name="index" defaultValue="1" type="string"/>
37-
</arguments>
38-
<comment userInput="Open slide options by index" stepKey="commentOpenByIndex"/>
39-
<waitForElementVisible time="10" selector="{{SliderInAdmin.sliderContainer}}" stepKey="waitForContentTypeInStageVisible" />
40-
<click stepKey="clickNavigationDot" selector="{{SliderInAdmin.slideNavigationDot(index)}}"/>
41-
<waitForElementVisible selector="{{SliderInAdmin.slideOptionsEdit}}" stepKey="waitForSlideOptionsEdit"/>
42-
<click selector="{{SliderInAdmin.slideOptionsEdit}}" stepKey="clickEditContentType"/>
43-
<waitForLoadingMaskToDisappear stepKey="waitForAnimation" />
44-
<waitForElementVisible time="5" selector="{{PageBuilderActionsSection.editForm}}" stepKey="waitForEditForm" />
45-
<see userInput="Edit Slide" selector="{{PageBuilderActionsSection.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
46-
</actionGroup>
47-
<actionGroup name="removeSlide">
48-
<waitForElementVisible time="10" selector="{{SliderInAdmin.sliderContainer}}" stepKey="waitForContentTypeInStageVisible" />
49-
<click selector="{{SliderInAdmin.activeSlideNavigationDot}}" stepKey="clickActiveSlideNavigationDot"/>
50-
<seeElement selector="{{SliderInAdmin.slideOptions}}" stepKey="seeContentTypeOptionsMenu"/>
51-
<click selector="{{SliderInAdmin.slideOptionsRemove}}" stepKey="clickRemoveContentType"/>
52-
<wait time="0.5" stepKey="waitForRemovalAnimation" />
53-
</actionGroup>
54-
<actionGroup name="duplicateSlide">
55-
<waitForElementVisible time="10" selector="{{SliderInAdmin.sliderContainer}}" stepKey="waitForContentBlockInStageVisible" />
56-
<click selector="{{SliderInAdmin.activeSlideNavigationDot}}" stepKey="clickActiveSlideNavigationDot"/>
57-
<seeElement selector="{{SliderInAdmin.slideOptions}}" stepKey="seeContentBlockOptionsMenu"/>
58-
<click selector="{{SliderInAdmin.slideOptionsDuplicate}}" stepKey="clickRemoveContentBlock"/>
23+
<waitForElementNotVisible selector="{{SlideOnBackend.optionTitle}}" stepKey="dontSeeSlideOptionsEdit"/>
5924
</actionGroup>
6025
<actionGroup name="addSlide">
6126
<waitForElementVisible time="10" selector="{{SliderInAdmin.sliderContainer}}" stepKey="waitForContentTypeInStageVisible" />
6227
<click stepKey="focusOnSlider" selector="{{SliderInAdmin.sliderContainer}}"/>
6328
<scrollTo selector="div.pagebuilder-header" x="0" y="-100" stepKey="scrollToTop"/>
6429
<moveMouseOver selector="{{SliderInAdmin.sliderContainer}}" x="10" y="10" stepKey="onMouseOverContentTypeStage"/>
6530
<waitForPageLoad stepKey="waitForPageLoad"/>
66-
<waitForElementVisible time="5" selector="{{SliderInAdmin.sliderOptions}}" stepKey="seeContentTypeOptionsMenu"/>
67-
<moveMouseOver selector="{{SliderInAdmin.sliderOptions}}" stepKey="onMouseOverOptionsMenu"/>
68-
<click selector="{{SliderInAdmin.addNewSlide}}" stepKey="clickAddNewSlideChild"/>
31+
<waitForElementVisible time="5" selector="{{PageBuilderActionsSection.contentTypeOptionsMenu(PageBuilderSliderContentType.role)}}" stepKey="seeContentTypeOptionsMenu"/>
32+
<moveMouseOver selector="{{PageBuilderActionsSection.contentTypeOptionsMenu(PageBuilderSliderContentType.role)}}" stepKey="onMouseOverOptionsMenu"/>
33+
<click selector="{{PageBuilderActionsSection.contentTypeAdd(PageBuilderSliderContentType.role)}}" stepKey="clickAddNewSlideChild"/>
6934
<waitForLoadingMaskToDisappear stepKey="waitForAnimation"/>
7035
</actionGroup>
7136
</actionGroups>

0 commit comments

Comments
 (0)