|
| 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 URLs Enabled"/> |
| 15 | + <description value="Verify that users are able to upload images to a Banner when 'Add Secret Key to URLs' is |
| 16 | + enabled and that the images render correctly on the storefront."/> |
| 17 | + <severity value="BLOCKER"/> |
| 18 | + <testCaseId value="PB-907"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-banner"/> |
| 21 | + <group value="pagebuilder-bannerCommon"/> |
| 22 | + <group value="secret-key-urls"/> |
| 23 | + </annotations> |
| 24 | + |
| 25 | + <before> |
| 26 | + <!-- Create CMS Page, Add Banner to Row on Page --> |
| 27 | + <createData entity="_emptyCmsPage" stepKey="createCMSPage"/> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> |
| 30 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 33 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer"> |
| 34 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 35 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection"> |
| 38 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragBannerToRow"> |
| 41 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/> |
| 44 | + <actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/> |
| 45 | + </before> |
| 46 | + |
| 47 | + <after> |
| 48 | + <!-- Revert Configurations & Delete Data --> |
| 49 | + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> |
| 50 | + <magentoCLI command="config:set admin/security/use_form_key 0" stepKey="disableSecretKeyUrls"/> |
| 51 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 52 | + <argument name="tags" value="config full_page"/> |
| 53 | + </actionGroup> |
| 54 | + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> |
| 55 | + <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> |
| 56 | + <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder"> |
| 57 | + <argument name="FolderName" value="{{PageBuilderBackgroundImage_JPG.path}}"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="DeleteImageFromStorageActionGroup" stepKey="DeleteImageFromStorage"> |
| 60 | + <argument name="Image" value="PageBuilderBackgroundImage_JPG"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 63 | + </after> |
| 64 | + |
| 65 | + <!-- Enable 'Add Secret Key to URLs' --> |
| 66 | + <magentoCLI command="config:set admin/security/use_form_key 1" stepKey="enableSecretKeyUrls"/> |
| 67 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 68 | + <argument name="tags" value="config full_page"/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> |
| 71 | + |
| 72 | + <!-- Navigate Back to CMS Page --> |
| 73 | + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCMSPagesGrid"> |
| 74 | + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> |
| 75 | + <argument name="submenuUiId" value="{{AdminMenuContentElementsPages.dataUiId}}"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="AdminNavigateToCreatedCMSPageWithEnabledSecretKeyActionGroup" stepKey="navigateToCreatedCMSPage"> |
| 78 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!-- Upload Image to Banner --> |
| 82 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 83 | + <actionGroup ref="verifyUploadImageButtons" stepKey="verifyUploadImageButtons"> |
| 84 | + <argument name="contentType" value="PageBuilderBannerContentType"/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="uploadImageToContentTypeFromStage" stepKey="uploadImageToBanner"> |
| 87 | + <argument name="property" value="PageBuilderImageProperty_JPG"/> |
| 88 | + <argument name="section" value="BannerOnBackend"/> |
| 89 | + </actionGroup> |
| 90 | + |
| 91 | + <!-- Save CMS Page --> |
| 92 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/> |
| 93 | + <actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/> |
| 94 | + |
| 95 | + <!-- Verify Banner Background Image Renders on Storefront --> |
| 96 | + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToStorefront"> |
| 97 | + <argument name="page" value="$$createCMSPage.identifier$$"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="validateBackgroundImageContainer" stepKey="validateImageOnStorefront"> |
| 100 | + <argument name="section" value="BannerOnFrontend"/> |
| 101 | + <argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/> |
| 102 | + </actionGroup> |
| 103 | + |
| 104 | + <!-- Disable 'Add Secret Key to URLs' --> |
| 105 | + <magentoCLI command="config:set admin/security/use_form_key 0" stepKey="disableSecretKeyUrls"/> |
| 106 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches2"> |
| 107 | + <argument name="tags" value="config full_page"/> |
| 108 | + </actionGroup> |
| 109 | + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage2"/> |
| 110 | + |
| 111 | + <!-- Verify Banner Background Image Renders on Storefront --> |
| 112 | + <actionGroup ref="validateBackgroundImageContainer" stepKey="validateImageOnStorefront2"> |
| 113 | + <argument name="section" value="BannerOnFrontend"/> |
| 114 | + <argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/> |
| 115 | + </actionGroup> |
| 116 | + </test> |
| 117 | +</tests> |
0 commit comments