|
| 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="BannerUploadImageWithSecretKeyEnabledTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PageBuilder"/> |
| 13 | + <stories value="Banner"/> |
| 14 | + <title value="Upload Image to Banner with Secret Key Enabled"/> |
| 15 | + <description value="Verify that user are able to upload image to Banner when Secret URL Key is enabled."/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <useCaseId value=""/> |
| 18 | + <testCaseId value="MC-4990"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-banner"/> |
| 21 | + <group value="pagebuilder-bannerCommon"/> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <createData entity="_emptyCmsPage" stepKey="createCMSPage"/> |
| 26 | + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToContentCreatedCMSPage1"> |
| 27 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 28 | + </actionGroup> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <deleteData createDataKey="createCMSPage" stepKey="deleteCreateCMSPage"/> |
| 32 | + <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> |
| 33 | + <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder"> |
| 34 | + <argument name="FolderName" value="{{PageBuilderBackgroundImage_JPG.path}}"/> |
| 35 | + </actionGroup> |
| 36 | + <actionGroup ref="DeleteImageFromStorageActionGroup" stepKey="DeleteImageFromStorage"> |
| 37 | + <argument name="Image" value="PageBuilderBackgroundImage_JPG"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 40 | + </after> |
| 41 | + <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> |
| 42 | + <!-- Add Banner --> |
| 43 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 44 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer"> |
| 45 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 46 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection"> |
| 49 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragBannerIntoStage"> |
| 52 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <actionGroup ref="unFocusOptionMenu" stepKey="unFocusOptionMenu"> |
| 56 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 57 | + </actionGroup> |
| 58 | + <actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons"> |
| 59 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 60 | + </actionGroup> |
| 61 | + <attachFile selector="{{PageBuilderStage.uploadImageInput('1')}}" userInput="{{PageBuilderImageProperty_JPG.value}}" stepKey="attachImageFromLocalToStage"/> |
| 62 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 63 | + <actionGroup ref="ValidateBackgroundImageConfigurationActionGroup" stepKey="validateBackgroundImageStage"> |
| 64 | + <argument name="section" value="BannerOnBackend"/> |
| 65 | + <argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/> |
| 66 | + </actionGroup> |
| 67 | + <!-- Save CMS Page --> |
| 68 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/> |
| 69 | + <actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/> |
| 70 | + |
| 71 | + <!-- Enable Secret Key --> |
| 72 | + <magentoCLI command="config:set admin/security/use_form_key 1" stepKey="enableUrlSecretKeys"/> |
| 73 | + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> |
| 74 | + <actionGroup ref="ValidateBackgroundImageConfigurationActionGroup" stepKey="validateBackgroundImageStage2"> |
| 75 | + <argument name="section" value="BannerOnBackend"/> |
| 76 | + <argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/> |
| 77 | + </actionGroup> |
| 78 | + |
| 79 | + <!-- Disable Secret Key --> |
| 80 | + <magentoCLI command="config:set admin/security/use_form_key 0" stepKey="disableUrlSecretKeys"/> |
| 81 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches2"> |
| 82 | + <argument name="tags" value="config full_page"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!-- Validate Storefront --> |
| 86 | + <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnCmsStorefront"/> |
| 87 | + <waitForPageLoad stepKey="waitForPageLoad4"/> |
| 88 | + <actionGroup ref="validateBackgroundImageContainer" stepKey="validateImageOnStorefront"> |
| 89 | + <argument name="section" value="BannerOnFrontend"/> |
| 90 | + <argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/> |
| 91 | + </actionGroup> |
| 92 | + </test> |
| 93 | +</tests> |
0 commit comments