Skip to content

Commit b4ce538

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-90473-add-missing-tests-for-buttons' into cms-team-2-sprint-9
2 parents aa6b3d5 + e1bad4f commit b4ce538

File tree

3 files changed

+236
-1
lines changed

3 files changed

+236
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<argument name="newTab" defaultValue="PageBuilderButtonItemOpenInNewTab_False"/>
3636
<argument name="index" defaultValue="1" type="string"/>
3737
</arguments>
38+
<comment userInput="validateButtonItemContent" stepKey="comment"/>
3839
<waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForButtonElement"/>
3940
<waitForElementVisible selector="{{page.buttonItemText(index, text.value)}}" stepKey="waitForButtonText"/>
4041
<waitForElementVisible selector="{{page.buttonItemType(index, type.value)}}" stepKey="waitForButtonType"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderActionsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<element name="contentBlockMoveByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="move-structural"]' parameterized="true"/>
5555
<element name="contentBlockAdd" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.add-child" parameterized="true"/>
5656
<element name="contentBlockEdit" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.edit-block" parameterized="true"/>
57-
<element name="contentBlockEditByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-block"]' parameterized="true"/>
57+
<element name="contentBlockEditByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//descendant::*[@class="edit-block"]' parameterized="true"/>
5858
<element name="contentBlockDuplicate" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//a[@title="Duplicate"]' parameterized="true"/>
5959
<element name="contentBlockRemove" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.remove-structural" parameterized="true"/>
6060
<element name="contentBlockRemoveByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//a[@title="Remove"]' parameterized="true"/>

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

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,238 @@
328328
<dontSeeElement selector="{{ButtonGroupOnStage.oldAddNewButtonItem}}" stepKey="dontSeeOldAddButton"/>
329329
<seeElement selector="{{ButtonItemOnStage.emptyButtonItemElement('1')}}" stepKey="seeEmptyButton"/>
330330
</test>
331+
<test name="ButtonGroupDuplicate">
332+
<annotations>
333+
<features value="Pagebuilder"/>
334+
<stories value="Button Group"/>
335+
<title value="Buttons - Duplicate Button Group"/>
336+
<description value="A user should be able to duplicate a Button Group content block. Verify on Stage amd Storefront."/>
337+
<severity value="AVERAGE"/>
338+
<useCaseId value="MAGETWO-90473"/>
339+
<testCaseId value="MAGETWO-92013"/>
340+
<group value="pagebuilder"/>
341+
<group value="pagebuilder-buttons"/>
342+
</annotations>
343+
<before>
344+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
345+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
346+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
347+
</before>
348+
<after>
349+
<actionGroup ref="logout" stepKey="logout"/>
350+
</after>
351+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
352+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
353+
</actionGroup>
354+
<actionGroup ref="dragContentBlockToStage" stepKey="dragContentBlockToStage">
355+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
356+
</actionGroup>
357+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
358+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
359+
</actionGroup>
360+
<!-- Fill All Fields -->
361+
<comment userInput="Fill All Fields" stepKey="commentEdit"/>
362+
<actionGroup ref="expandConfigurationSection" stepKey="expandAdvancedSection"/>
363+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAlignment">
364+
<argument name="property" value="PageBuilderAdvancedAlignmentPropertyCenter"/>
365+
</actionGroup>
366+
<actionGroup ref="selectSlideOutPanelField" stepKey="enterBorder">
367+
<argument name="property" value="PageBuilderAdvancedBorderPropertyDouble"/>
368+
</actionGroup>
369+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBorderColor">
370+
<argument name="property" value="PageBuilderAdvancedBorderColorProperty_green"/>
371+
</actionGroup>
372+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBorderWidth">
373+
<argument name="property" value="PageBuilderAdvancedBorderWidthProperty10"/>
374+
</actionGroup>
375+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBorderRadius">
376+
<argument name="property" value="PageBuilderAdvancedBorderRadiusProperty12"/>
377+
</actionGroup>
378+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterCssClasses">
379+
<argument name="property" value="PageBuilderAdvancedCssClassesPropertyThreeClasses"/>
380+
</actionGroup>
381+
<actionGroup ref="fillSlideOutPanelFieldMargins" stepKey="enterMargins">
382+
<argument name="property" value="PageBuilderMarginsPropertyUnique"/>
383+
</actionGroup>
384+
<actionGroup ref="fillSlideOutPanelFieldPadding" stepKey="enterPadding">
385+
<argument name="property" value="PageBuilderPaddingPropertyUnique"/>
386+
</actionGroup>
387+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
388+
<!-- Add Button -->
389+
<comment userInput="Add Button" stepKey="commentAddButton"/>
390+
<actionGroup ref="addButton" stepKey="addButton2"/>
391+
<!-- Edit 1st button -->
392+
<comment userInput="Edit 1st Button" stepKey="commentEditButton"/>
393+
<actionGroup ref="openPageBuilderEditPanelSmallByIndex" stepKey="openEditMenuOnStage1">
394+
<argument name="contentBlockType" value="PageBuilderButtonItemContentBlock"/>
395+
<argument name="contentBlockIndex" value="1"/>
396+
</actionGroup>
397+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="fillButton1TextField">
398+
<argument name="property" value="PageBuilderButtonItemText_Common2"/>
399+
</actionGroup>
400+
<actionGroup ref="selectSlideOutPanelFieldGeneral" stepKey="fillButton1TypeField">
401+
<argument name="property" value="PageBuilderButtonItemType_Secondary"/>
402+
</actionGroup>
403+
<actionGroup ref="fillSlideOutPanelLinkUrlField" stepKey="fillButton1LinkField">
404+
<argument name="property" value="PageBuilderButtonItemLink_Secure"/>
405+
<argument name="selection" value="ExternalLink"/>
406+
<argument name="newTab" value="PageBuilderButtonItemOpenInNewTab_False"/>
407+
</actionGroup>
408+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
409+
<!-- Duplicate and Validate Stage -->
410+
<comment userInput="Duplicate" stepKey="commentDuplicate"/>
411+
<actionGroup ref="duplicateContentBlock" stepKey="duplicateContentBlock">
412+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
413+
</actionGroup>
414+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
415+
<actionGroup ref="validateAdvancedStyleWithAllUpdated" stepKey="validateAllAdvancedStage">
416+
<argument name="page" value="ButtonGroupOnStage"/>
417+
<argument name="alignment" value="PageBuilderAdvancedAlignmentPropertyCenter"/>
418+
<argument name="border" value="PageBuilderAdvancedBorderPropertyDouble"/>
419+
<argument name="borderColor" value="PageBuilderAdvancedBorderColorProperty_green"/>
420+
<argument name="borderWidth" value="PageBuilderAdvancedBorderWidthProperty10"/>
421+
<argument name="borderRadius" value="PageBuilderAdvancedBorderRadiusProperty12"/>
422+
<argument name="cssClasses" value="PageBuilderAdvancedCssClassesPropertyThreeClasses"/>
423+
<argument name="margin" value="PageBuilderMarginsPropertyUnique"/>
424+
<argument name="padding" value="PageBuilderPaddingPropertyUnique"/>
425+
<argument name="index" value="2"/>
426+
</actionGroup>
427+
<!-- 1st Button -->
428+
<actionGroup ref="validateButtonItemContent" stepKey="validateButton2Stage1">
429+
<argument name="page" value="ButtonItemOnStage"/>
430+
<argument name="text" value="PageBuilderButtonItemText_Common2"/>
431+
<argument name="type" value="PageBuilderButtonItemType_Secondary"/>
432+
<argument name="url" value="PageBuilderButtonItemLink_Secure"/>
433+
<argument name="newTab" value="PageBuilderButtonItemOpenInNewTab_False"/>
434+
<argument name="index" value="3"/>
435+
</actionGroup>
436+
<!-- 2nd Button -->
437+
<actionGroup ref="validateButtonItemContent" stepKey="validateButton1Stage1">
438+
<argument name="page" value="ButtonItemOnStage"/>
439+
<argument name="index" value="4"/>
440+
</actionGroup>
441+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage2">
442+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
443+
<argument name="contentBlockIndex" value="2"/>
444+
</actionGroup>
445+
<!-- Validate Edit Panel For Duplicate -->
446+
<comment userInput="Validate Edit Panel For Duplicate" stepKey="commentValidateEdit"/>
447+
<actionGroup ref="expandConfigurationSection" stepKey="expandAdvancedSection2"/>
448+
<actionGroup ref="seeOptionIsSelectedSlideOutProperty" stepKey="validateAlignment">
449+
<argument name="property" value="PageBuilderAdvancedAlignmentPropertyCenter"/>
450+
</actionGroup>
451+
<actionGroup ref="seeOptionIsSelectedSlideOutProperty" stepKey="validateBorder">
452+
<argument name="property" value="PageBuilderAdvancedBorderPropertyDouble"/>
453+
</actionGroup>
454+
<actionGroup ref="seeInFieldSlideOutProperty" stepKey="validateBorderColor">
455+
<argument name="property" value="PageBuilderAdvancedBorderColorProperty_green"/>
456+
</actionGroup>
457+
<actionGroup ref="seeInFieldSlideOutProperty" stepKey="validateBorderWidth">
458+
<argument name="property" value="PageBuilderAdvancedBorderWidthProperty10"/>
459+
</actionGroup>
460+
<actionGroup ref="seeInFieldSlideOutProperty" stepKey="validateBorderRadius">
461+
<argument name="property" value="PageBuilderAdvancedBorderRadiusProperty12"/>
462+
</actionGroup>
463+
<actionGroup ref="seeInFieldSlideOutProperty" stepKey="validateCssClasses">
464+
<argument name="property" value="PageBuilderAdvancedCssClassesPropertyThreeClasses"/>
465+
</actionGroup>
466+
<actionGroup ref="seeInMarginFieldsSlideOutPanel" stepKey="validateMargins">
467+
<argument name="property" value="PageBuilderMarginsPropertyUnique"/>
468+
</actionGroup>
469+
<actionGroup ref="seeInPaddingFieldsSlideOutPanel" stepKey="validatePadding">
470+
<argument name="property" value="PageBuilderPaddingPropertyUnique"/>
471+
</actionGroup>
472+
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanel"/>
473+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
474+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
475+
<!-- Validate Stage After Save -->
476+
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
477+
<actionGroup ref="validateAdvancedStyleWithAllUpdated" stepKey="validateAllAdvancedStage2">
478+
<argument name="page" value="ButtonGroupOnStage"/>
479+
<argument name="alignment" value="PageBuilderAdvancedAlignmentPropertyCenter"/>
480+
<argument name="border" value="PageBuilderAdvancedBorderPropertyDouble"/>
481+
<argument name="borderColor" value="PageBuilderAdvancedBorderColorProperty_green"/>
482+
<argument name="borderWidth" value="PageBuilderAdvancedBorderWidthProperty10"/>
483+
<argument name="borderRadius" value="PageBuilderAdvancedBorderRadiusProperty12"/>
484+
<argument name="cssClasses" value="PageBuilderAdvancedCssClassesPropertyThreeClasses"/>
485+
<argument name="margin" value="PageBuilderMarginsPropertyUnique"/>
486+
<argument name="padding" value="PageBuilderPaddingPropertyUnique"/>
487+
<argument name="index" value="2"/>
488+
</actionGroup>
489+
<!-- 1st Button -->
490+
<actionGroup ref="validateButtonItemContent" stepKey="validateButton2Stage2">
491+
<argument name="page" value="ButtonItemOnStage"/>
492+
<argument name="text" value="PageBuilderButtonItemText_Common2"/>
493+
<argument name="type" value="PageBuilderButtonItemType_Secondary"/>
494+
<argument name="url" value="PageBuilderButtonItemLink_Secure"/>
495+
<argument name="newTab" value="PageBuilderButtonItemOpenInNewTab_False"/>
496+
<argument name="index" value="3"/>
497+
</actionGroup>
498+
<!-- 2nd Button -->
499+
<actionGroup ref="validateButtonItemContent" stepKey="validateButton1Stage2">
500+
<argument name="page" value="ButtonItemOnStage"/>
501+
<argument name="index" value="4"/>
502+
</actionGroup>
503+
<!-- Validate Storefront -->
504+
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
505+
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
506+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
507+
</actionGroup>
508+
<actionGroup ref="validateAdvancedStyleWithAllUpdated" stepKey="validateAllAdvancedStorefront">
509+
<argument name="page" value="ButtonGroupOnStorefront"/>
510+
<argument name="alignment" value="PageBuilderAdvancedAlignmentPropertyCenter"/>
511+
<argument name="border" value="PageBuilderAdvancedBorderPropertyDouble"/>
512+
<argument name="borderColor" value="PageBuilderAdvancedBorderColorProperty_green"/>
513+
<argument name="borderWidth" value="PageBuilderAdvancedBorderWidthProperty10"/>
514+
<argument name="borderRadius" value="PageBuilderAdvancedBorderRadiusProperty12"/>
515+
<argument name="cssClasses" value="PageBuilderAdvancedCssClassesPropertyThreeClasses"/>
516+
<argument name="margin" value="PageBuilderMarginsPropertyUnique"/>
517+
<argument name="padding" value="PageBuilderPaddingPropertyUnique"/>
518+
<argument name="index" value="2"/>
519+
</actionGroup>
520+
<!-- 1st Button -->
521+
<actionGroup ref="validateButtonItemContent" stepKey="validateButton2Storefront">
522+
<argument name="page" value="ButtonItemOnStorefront"/>
523+
<argument name="text" value="PageBuilderButtonItemText_Common2"/>
524+
<argument name="type" value="PageBuilderButtonItemType_Secondary"/>
525+
<argument name="url" value="PageBuilderButtonItemLink_Secure"/>
526+
<argument name="newTab" value="PageBuilderButtonItemOpenInNewTab_False"/>
527+
<argument name="index" value="3"/>
528+
</actionGroup>
529+
<!-- 2nd Button -->
530+
<waitForElementVisible selector="{{ButtonItemOnStorefront.base('4')}}" stepKey="waitForButton2"/>
531+
<waitForElement selector="{{ButtonItemOnStorefront.emptyButtonItemElement('4')}}" stepKey="waitForButton2Empty"/>
532+
</test>
533+
<test name="ButtonGroupNoRequiredAttributes">
534+
<annotations>
535+
<features value="Pagebuilder"/>
536+
<stories value="Button Group"/>
537+
<title value="Button Group - Validate No Required Attributes"/>
538+
<description value="A user should be able to save a Button Group edit form without inputting data into any attribute field."/>
539+
<severity value="AVERAGE"/>
540+
<useCaseId value="MAGETWO-90473"/>
541+
<testCaseId value="MAGETWO-92014"/>
542+
<group value="pagebuilder"/>
543+
<group value="pagebuilder-buttons"/>
544+
</annotations>
545+
<before>
546+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
547+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
548+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
549+
</before>
550+
<after>
551+
<actionGroup ref="logout" stepKey="logout"/>
552+
</after>
553+
<actionGroup ref="dragContentBlockToStage" stepKey="dragContentBlockToStage">
554+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
555+
</actionGroup>
556+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
557+
<argument name="contentBlockType" value="PageBuilderButtonsContentBlock"/>
558+
</actionGroup>
559+
<!-- Validate No Required Fields -->
560+
<comment userInput="Validate No Required Fields" stepKey="commentValidateNoRequired"/>
561+
<dontSeeElementInDOM selector="{{PageBuilderActionsSection.editFormAllRequiredFields}}" stepKey="dontSeeRequiredClassInEditForm"/>
562+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
563+
<waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForCmsPageSaveButton"/>
564+
</test>
331565
</tests>

0 commit comments

Comments
 (0)