|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="ImageTestCMSPageOnTabletTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PageBuilder"/> |
| 13 | + <stories value="Image"/> |
| 14 | + <title value="Add Image with PageBuilder to the new CMS page and view it on Storefront with the screen size of 768x1024"/> |
| 15 | + <description value="Mobile and desktop images added with Page Builder should not be visible at the same time with the viewport width of 786px"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <useCaseId value="MC-41760"/> |
| 18 | + <testCaseId value="MC-42373"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-image"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/> |
| 27 | + <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> |
| 28 | + <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder"> |
| 29 | + <argument name="FolderName" value="{{PageBuilderImageProperty_JPG2.path}}"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="DeleteImageFromStorageActionGroup" stepKey="DeleteImageFromStorage"> |
| 32 | + <argument name="Image" value="PageBuilderImageProperty_JPG2"/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + |
| 37 | + <!-- Create a new CMS page and edit with Page Builder --> |
| 38 | + <actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/> |
| 39 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 40 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer"> |
| 41 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 42 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle"> |
| 45 | + <argument name="contentType" value="PageBuilderImageContentType"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection"> |
| 48 | + <argument name="contentType" value="PageBuilderImageContentType"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragImageIntoStage"> |
| 51 | + <argument name="contentType" value="PageBuilderImageContentType"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage"> |
| 54 | + <argument name="contentType" value="PageBuilderImageContentType"/> |
| 55 | + </actionGroup> |
| 56 | + |
| 57 | + <!-- Validate Edit Panel --> |
| 58 | + <waitForElement selector="[name='{{PageBuilderImageAppearance.fieldName}}']" stepKey="waitForImageAppearanceField"/> |
| 59 | + <dontSeeElement selector="[name='{{PageBuilderImageAppearance.fieldName}}']" stepKey="dontSeeImageAppearanceField"/> |
| 60 | + <grabValueFrom selector="[name='{{PageBuilderImageAppearance.fieldName}}']" stepKey="defaultAppearanceValue"/> |
| 61 | + <assertEquals message="pass" stepKey="assertDefaultAppearanceValue"> |
| 62 | + <actualResult type="variable">defaultAppearanceValue</actualResult> |
| 63 | + <expectedResult type="string">full-width</expectedResult> |
| 64 | + </assertEquals> |
| 65 | + |
| 66 | + <!-- Upload image from local machine --> |
| 67 | + <actionGroup ref="attachFileSlideOutPropertyGeneral" stepKey="attachImageFile"> |
| 68 | + <argument name="property" value="PageBuilderImageProperty_JPG2"/> |
| 69 | + </actionGroup> |
| 70 | + <waitForElementVisible selector="{{ImageOnConfigurationPanel.imageName(PageBuilderImageProperty_JPG2.value)}}" stepKey="waitForUploadImage"/> |
| 71 | + <waitForElementVisible selector="{{ImageOnConfigurationPanel.imageSource(PageBuilderImageProperty_JPG2.fileName)}}" stepKey="seeMainImageSource"/> |
| 72 | + <waitForElementVisible selector="{{ImageOnConfigurationPanel.imagePreview}}" stepKey="seeImageDisplayed"/> |
| 73 | + |
| 74 | + <!-- Save Changes to the page --> |
| 75 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/> |
| 76 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/> |
| 77 | + <actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/> |
| 78 | + |
| 79 | + <!-- Navigate to the newly created page on the storefront --> |
| 80 | + <actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront"> |
| 81 | + <argument name="contentType" value="PageBuilderImageContentType"/> |
| 82 | + </actionGroup> |
| 83 | + <waitForElementVisible selector="{{ImageOnStorefront.imageDisplay}}" stepKey="seeMainImageDisplayed"/> |
| 84 | + |
| 85 | + <!-- Validate images with default window width --> |
| 86 | + <seeElement selector="{{ImageOnStorefront.imageDesktop('1')}}" stepKey="seeMainImageOnDefaultRes"/> |
| 87 | + <dontSeeElement selector="{{ImageOnStorefront.imageMobile('1')}}" stepKey="dontSeeMobileImageOnDefaultRes"/> |
| 88 | + |
| 89 | + <!-- Validate images with window width of 768px --> |
| 90 | + <resizeWindow width="768" height="1024" stepKey="resizeWindowTo768by1024"/> |
| 91 | + <seeElement selector="{{ImageOnStorefront.imageDesktop('1')}}" stepKey="seeMainImageOn768by1024"/> |
| 92 | + <dontSeeElement selector="{{ImageOnStorefront.imageMobile('1')}}" stepKey="dontSeeMobileImageOn768by1024"/> |
| 93 | + |
| 94 | + <!-- Validate images with window width of 767px --> |
| 95 | + <resizeWindow width="767" height="1024" stepKey="resizeWindowTo767by1024"/> |
| 96 | + <seeElement selector="{{ImageOnStorefront.imageMobile('1')}}" stepKey="seeMobileImageOn767by1024"/> |
| 97 | + <dontSeeElement selector="{{ImageOnStorefront.imageDesktop('1')}}" stepKey="dontSeeDesktopImageOn767by1024"/> |
| 98 | + </test> |
| 99 | +</tests> |
0 commit comments