Skip to content

Commit 96614af

Browse files
committed
MAGETWO-92070: Automate MFTF
- Added tests for verifying 2 buttons when switching between Appearance and updated test regarding mockup changes for button label
1 parent 9791911 commit 96614af

File tree

6 files changed

+159
-12
lines changed

6 files changed

+159
-12
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
<actionGroup name="verifyUploadImageButtons">
2121
<arguments>
2222
<argument name="contentBlockType" defaultValue=""/>
23+
<argument name="section" defaultValue=""/>
2324
</arguments>
2425
<comment userInput="Hover uploaded image to check Upload New Image button and Select From Gallery button" stepKey="commentHover"/>
2526
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStage(contentBlockType.role)}}" x="10" y="0" stepKey="onMouseOverBannerContentBlockStage"/>
26-
<waitForElementVisible selector="{{ImageOnStage.uploadNewImageBtn}}" stepKey="waitForUploadNewImageBtn" />
27-
<waitForElementVisible selector="{{ImageOnStage.selectFromGalleryImageBtn}}" stepKey="seeSelectFromGalleryBtn2" />
27+
<waitForElementVisible selector="{{section.uploadNewImageBtn}}" stepKey="waitForUploadNewImageBtn" />
28+
<waitForElementVisible selector="{{section.selectFromGalleryImageBtn}}" stepKey="seeSelectFromGalleryBtn2" />
2829
</actionGroup>
2930
<actionGroup name="verifyImageOnSlideout">
3031
<arguments>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@
102102
<element name="bannerBorderRadiusStyle" type="button" selector="div[style*='border-radius: {{arg1}}']" parameterized="true"/>
103103
<element name="editFormBackgroundImagePreview" type="button" selector="//input[@name='background_image']/ancestor::div[@class='admin__field-control']/descendant::img"/>
104104
<element name="editFormBackgroundMobileImagePreview" type="button" selector="//input[@name='mobile_image']/ancestor::div[@class='admin__field-control']/descendant::img"/>
105-
<element name="uploadLocalImageBtn" type="button" selector="input[type='file'][name='background_image']"/>
105+
<element name="uploadLocalImageBtn" type="button" selector="//div[contains(@class,'pagebuilder-image-uploader-container')]//input[@name='background_image']"/>
106+
<element name="uploadNewImageBtn" type="button" selector="//label[text()='Upload Image']" />
107+
<element name="selectFromGalleryImageBtn" type="button" selector="//ul[@class='pagebuilder-options-links']//label[text()='Select from Gallery']"/>
106108
</section>
107109
<section name="BannerOnConfigurationPanel">
108110
<element name="tinyMCEIFrame" type="text" selector="pagebuilder_banner_form_message_ifr"/>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@
187187
<element name="editFormBackgroundImagePreview" type="button" selector="//input[@name='background_image']/ancestor::div[@class='admin__field-control']/descendant::img"/>
188188
<element name="editFormBackgroundMobileImagePreview" type="button" selector="//input[@name='mobile_image']/ancestor::div[@class='admin__field-control']/descendant::img"/>
189189
<element name="uploadLocalImageBtn" type="button" selector="//div[contains(@class,'pagebuilder-image-uploader-container')]//input[@name='background_image']"/>
190+
<element name="collageOverlay" type="button" selector=".pagebuilder-collage-overlay"/>
191+
<element name="uploadNewImageBtn" type="button" selector="//label[text()='Upload Image']" />
192+
<element name="selectFromGalleryImageBtn" type="button" selector="//ul[@class='pagebuilder-options-links']//label[text()='Select from Gallery']"/>
190193
</section>
191194
<section name="SlideOnConfigurationPanel">
192195
<element name="tinyMCEIFrame" type="text" selector="pagebuilder_slide_form_content_ifr"/>

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

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@
10731073
<title value="Add image into Banner from the Stage"/>
10741074
<description value="A user should be able to add image to Banner stage."/>
10751075
<severity value="CRITICAL"/>
1076-
<testCaseId value="MAGETWO-92116"/>
1076+
<testCaseId value="MAGETWO-92118"/>
10771077
<group value="pagebuilder"/>
10781078
<group value="pagebuilder-banner"/>
10791079
<group value="pagebuilder-bannerCommon"/>
@@ -1097,18 +1097,17 @@
10971097
<actionGroup ref="dragContentBlockToStage" stepKey="dragBannerIntoStage">
10981098
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
10991099
</actionGroup>
1100-
11011100
<!--Verify there are 2 buttons when hovering-->
11021101
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons" />
11031102
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStage(PageBuilderBannerContentBlock.role)}}" x="10" y="0" stepKey="onMouseOverBannerContentBlockStage"/>
11041103
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons" >
11051104
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1105+
<argument name="section" value="BannerOnBackend"/>
11061106
</actionGroup>
11071107
<!--Upload image from local machine -->
11081108
<comment userInput="Upload image from local machine" stepKey="commentUploadImageFromLocal" />
11091109
<attachFile userInput="{{PageBuilderLocalImagePropertyJpg.value}}" selector="{{BannerOnBackend.uploadLocalImageBtn}}" stepKey="attachImageFromLocalToStage"/>
11101110
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource1"/>
1111-
11121111
<!--Upload image from Media Gallery Storage -->
11131112
<comment userInput="Upload image from Media Gallery Storage" stepKey="commentUploadImageFromStorage"/>
11141113
<click selector="{{ImageOnStage.selectFromGalleryImageBtn}}" stepKey="clickSelectFromGallery" />
@@ -1123,7 +1122,6 @@
11231122
<actionGroup ref="saveImage" stepKey="saveImage"/>
11241123
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource2"/>
11251124
<comment userInput="Go to Banner slide-out to verify uploaded image" stepKey="commentGoToBannerSlideOut"/>
1126-
11271125
<!--Verify uploaded image is displayed on slide-out-->
11281126
<comment userInput="Verify uploaded image is displayed on slide-out" stepKey="commentVerifyImageOnSlideout"/>
11291127
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
@@ -1133,12 +1131,85 @@
11331131
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource3"/>
11341132
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
11351133
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
1136-
11371134
<!-- Validate Storefront -->
11381135
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
11391136
<openNewTab stepKey="openNewTab"/>
11401137
<amOnPage url="$$createPreReqCMSPage.identifier$$" stepKey="amOnCMSStorefront" />
11411138
<waitForPageLoad stepKey="waitForPageLoad3" />
11421139
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSourceOnFrontend"/>
11431140
</test>
1141+
<test name="VerifyUploadImageOnBannerStageDependOnEachTypeOfAppearance">
1142+
<annotations>
1143+
<features value="Pagebuilder: Banner"/>
1144+
<stories value="MAGETWO-75104: Add image into Slide, Banner from the Stage"/>
1145+
<title value="Add image into Banner from the Stage"/>
1146+
<description value="A user should be able to add image to Banner stage when switching between appearance type"/>
1147+
<severity value="CRITICAL"/>
1148+
<testCaseId value="MAGETWO-92118"/>
1149+
<group value="pagebuilder"/>
1150+
<group value="pagebuilder-banner"/>
1151+
<group value="pagebuilder-bannerCommon"/>
1152+
</annotations>
1153+
<before>
1154+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1155+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1156+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
1157+
<createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" />
1158+
</before>
1159+
<after>
1160+
<deleteData createDataKey="createPreReqCMSPage" stepKey="deleteCreatePreReqCMSPage"/>
1161+
<actionGroup ref="logout" stepKey="logout"/>
1162+
</after>
1163+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToContentCreatedCMSPage1">
1164+
<argument name="CMSPage" value="$$createPreReqCMSPage$$"/>
1165+
</actionGroup>
1166+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1167+
<argument name="group" value="PageBuilderBannerContentBlock"/>
1168+
</actionGroup>
1169+
<actionGroup ref="dragContentBlockToStage" stepKey="dragBannerIntoStage">
1170+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1171+
</actionGroup>
1172+
<!--Verify there are 2 buttons display when user select appearance Left-->
1173+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
1174+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1175+
</actionGroup>
1176+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty1">
1177+
<argument name="property" value="PageBuilderBannerCollageLeftProperty"/>
1178+
</actionGroup>
1179+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
1180+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons1" />
1181+
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStage(PageBuilderBannerContentBlock.role)}}" x="10" y="0" stepKey="onMouseOverBannerContentBlockStage1"/>
1182+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons1" >
1183+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1184+
<argument name="section" value="BannerOnBackend"/>
1185+
</actionGroup>
1186+
<!--Verify there are 2 buttons display when user select appearance Center-->
1187+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
1188+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1189+
</actionGroup>
1190+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty2">
1191+
<argument name="property" value="PageBuilderSlideCollageCenteredProperty"/>
1192+
</actionGroup>
1193+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
1194+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons2" />
1195+
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStage(PageBuilderBannerContentBlock.role)}}" x="10" y="0" stepKey="onMouseOverBannerContentBlockStage2"/>
1196+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons2" >
1197+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1198+
<argument name="section" value="BannerOnBackend"/>
1199+
</actionGroup>
1200+
<!--Verify there are 2 buttons display when user select appearance Right-->
1201+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage3">
1202+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1203+
</actionGroup>
1204+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty3">
1205+
<argument name="property" value="PageBuilderBannerCollageRightProperty"/>
1206+
</actionGroup>
1207+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings3"/>
1208+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons3" />
1209+
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStage(PageBuilderBannerContentBlock.role)}}" x="10" y="0" stepKey="onMouseOverBannerContentBlockStage3"/>
1210+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons3" >
1211+
<argument name="contentBlockType" value="PageBuilderBannerContentBlock"/>
1212+
<argument name="section" value="BannerOnBackend"/>
1213+
</actionGroup>
1214+
</test>
11441215
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<!-- Hover uploaded image to check Upload New Image button and Select From Gallery button -->
7070
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons" >
7171
<argument name="contentBlockType" value="PageBuilderImageContentBlock"/>
72+
<argument name="section" value="ImageOnStage"/>
7273
</actionGroup>
7374
<!-- Duplicate Image Content Block -->
7475
<comment userInput="Duplicate Image Content Block" stepKey="commentDuplicate"/>

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

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,18 +1073,17 @@
10731073
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
10741074
</actionGroup>
10751075
<actionGroup ref="closeEditPanelSettings" stepKey="closeEditPanelSettings"/>
1076-
10771076
<!--Verify there are 2 buttons when hovering-->
10781077
<click selector="{{SliderInAdmin.slideWrapper}}" stepKey="clickSliderInStage1"/>
10791078
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons" />
10801079
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons" >
10811080
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
1081+
<argument name="section" value="SlideOnBackend"/>
10821082
</actionGroup>
10831083
<!--Upload image from local machine -->
10841084
<comment userInput="Upload image from local machine" stepKey="commentUploadImageFromLocal" />
10851085
<attachFile userInput="{{PageBuilderLocalImagePropertyJpg.value}}" selector="{{SlideOnBackend.uploadLocalImageBtn}}" stepKey="attachImageFromLocalToStage"/>
10861086
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource1"/>
1087-
10881087
<!--Upload image from Media Gallery Storage -->
10891088
<comment userInput="Upload image from Media Gallery Storage" stepKey="commentUploadImageFromStorage"/>
10901089
<click selector="{{SliderInAdmin.slideWrapper}}" stepKey="clickSliderInStage"/>
@@ -1101,7 +1100,6 @@
11011100
<actionGroup ref="saveImage" stepKey="saveImage"/>
11021101
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource2"/>
11031102
<comment userInput="Go to Banner slide-out to verify uploaded image" stepKey="commentGoToBannerSlideOut"/>
1104-
11051103
<!--Verify uploaded image is displayed on slide-out-->
11061104
<comment userInput="Verify uploaded image is displayed on slide-out" stepKey="commentVerifyImageOnSlideout"/>
11071105
<actionGroup ref="openSlideOptionsByIndex" stepKey="openFirstSlideOptions">
@@ -1111,12 +1109,83 @@
11111109
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSource3"/>
11121110
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
11131111
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
1114-
11151112
<!-- Validate Storefront -->
11161113
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
11171114
<openNewTab stepKey="openNewTab"/>
11181115
<amOnPage url="$$createPreReqCMSPage.identifier$$" stepKey="amOnCMSStorefront" />
11191116
<waitForPageLoad stepKey="waitForPageLoad3" />
11201117
<seeElement selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImagePropertyJpg.fileName)}}" stepKey="seeMainImageSourceOnFrontend"/>
11211118
</test>
1119+
<test name="VerifyUploadImageOnSliderStageDependOnEachTypeOfAppearance">
1120+
<annotations>
1121+
<features value="Pagebuilder: Slider"/>
1122+
<stories value="MAGETWO-75104: Add image into Slider, Banner from the Stage"/>
1123+
<title value="Add image into Slider from the Stage"/>
1124+
<description value="A user should be able to add image to Slider stage when switching between appearance type."/>
1125+
<severity value="CRITICAL"/>
1126+
<testCaseId value="MAGETWO-92116"/>
1127+
<group value="pagebuilder"/>
1128+
<group value="pagebuilder-slider"/>
1129+
<group value="pagebuilder-sliderCommon"/>
1130+
</annotations>
1131+
<before>
1132+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1133+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1134+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
1135+
<createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" />
1136+
</before>
1137+
<after>
1138+
<deleteData createDataKey="createPreReqCMSPage" stepKey="deleteCreatePreReqCMSPage"/>
1139+
<actionGroup ref="logout" stepKey="logout"/>
1140+
</after>
1141+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToContentCreatedCMSPage1">
1142+
<argument name="CMSPage" value="$$createPreReqCMSPage$$"/>
1143+
</actionGroup>
1144+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1145+
<argument name="group" value="PageBuilderSliderContentBlock"/>
1146+
</actionGroup>
1147+
<actionGroup ref="dragContentBlockToStage" stepKey="dragSliderIntoStage">
1148+
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
1149+
</actionGroup>
1150+
<!--Verify there are 2 buttons display when user select appearance Left-->
1151+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty1">
1152+
<argument name="property" value="PageBuilderBannerCollageLeftProperty"/>
1153+
</actionGroup>
1154+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings1"/>
1155+
<click selector="{{SlideOnBackend.collageOverlay}}" stepKey="clickSliderInStage1"/>
1156+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons1" />
1157+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons1" >
1158+
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
1159+
<argument name="section" value="SlideOnBackend"/>
1160+
</actionGroup>
1161+
<!--Verify there are 2 buttons display when user select appearance Center-->
1162+
<actionGroup ref="openSlideOptionsByIndex" stepKey="openFirstSlideOptions2">
1163+
<argument name="index" value="1"/>
1164+
</actionGroup>
1165+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty2">
1166+
<argument name="property" value="PageBuilderSlideCollageCenteredProperty"/>
1167+
</actionGroup>
1168+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
1169+
<click selector="{{SlideOnBackend.collageOverlay}}" stepKey="clickSliderInStage2"/>
1170+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons2" />
1171+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons2" >
1172+
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
1173+
<argument name="section" value="SlideOnBackend"/>
1174+
</actionGroup>
1175+
<!--Verify there are 2 buttons display when user select appearance Right-->
1176+
<actionGroup ref="openSlideOptionsByIndex" stepKey="openFirstSlideOptions3">
1177+
<argument name="index" value="1"/>
1178+
</actionGroup>
1179+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearanceProperty3">
1180+
<argument name="property" value="PageBuilderBannerCollageRightProperty"/>
1181+
</actionGroup>
1182+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings3"/>
1183+
<!--Verify there are 2 buttons when hovering-->
1184+
<click selector="{{SlideOnBackend.collageOverlay}}" stepKey="clickSliderInStage3"/>
1185+
<comment userInput="Verify there are 2 buttons when hovering" stepKey="commentVerifyButtons3" />
1186+
<actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons3" >
1187+
<argument name="contentBlockType" value="PageBuilderSliderContentBlock"/>
1188+
<argument name="section" value="SlideOnBackend"/>
1189+
</actionGroup>
1190+
</test>
11221191
</tests>

0 commit comments

Comments
 (0)