|
| 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 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StoreFrontDeleteProductImagesAssignedDifferentRolesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Delete Product Images assigned as Base, Small and Thumbnail"/> |
| 14 | + <stories value="Delete Product Images"/> |
| 15 | + <title value="Test verifies the process of deleting product image"/> |
| 16 | + <description value="Test verifies the process of deleting product image"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4473"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!--Create Category--> |
| 23 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 24 | + <!-- Create SimpleProductWithPrice100 --> |
| 25 | + <createData entity="SimpleProduct_100" stepKey="simpleProductOne"> |
| 26 | + <requiredEntity createDataKey="testCategory"/> |
| 27 | + </createData> |
| 28 | + <!-- Assign SimpleProductOne to Category --> |
| 29 | + <createData entity="AssignProductToCategory" stepKey="assignSimpleProductOneToTestCategory"> |
| 30 | + <requiredEntity createDataKey="testCategory"/> |
| 31 | + <requiredEntity createDataKey="simpleProductOne"/> |
| 32 | + </createData> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 34 | + <!-- Open product edit page --> |
| 35 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEdit"> |
| 36 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Halt test execution for 10 seconds before continuing. --> |
| 39 | + <wait time="10" stepKey="waitForAddImageSectionToOpen"/> |
| 40 | + |
| 41 | + <!-- Add Image Base--> |
| 42 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addBaseImage"> |
| 43 | + <argument name="image" value="TestImageAdobe"/> |
| 44 | + </actionGroup> |
| 45 | + <!--Unassign Default Roles--> |
| 46 | + <actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="unassignDefaultRoles"> |
| 47 | + <argument name="image" value="TestImageAdobe"/> |
| 48 | + </actionGroup> |
| 49 | + <!-- Assign Base Role--> |
| 50 | + <actionGroup ref="AdminAssignImageBaseRoleActionGroup" stepKey="assignTestImageAdobeBaseRole"> |
| 51 | + <argument name="image" value="TestImageAdobe"/> |
| 52 | + </actionGroup> |
| 53 | + <!-- Add Image Small--> |
| 54 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addSmallImage"> |
| 55 | + <argument name="image" value="AdobeSmallImage"/> |
| 56 | + </actionGroup> |
| 57 | + <!-- Assign Small Role--> |
| 58 | + <actionGroup ref="AdminAssignImageSmallRoleActionGroup" stepKey="assignSmallRole"> |
| 59 | + <argument name="image" value="AdobeSmallImage"/> |
| 60 | + </actionGroup> |
| 61 | + <!-- Add Image Thumb--> |
| 62 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addThumbImage"> |
| 63 | + <argument name="image" value="AdobeThumbImage"/> |
| 64 | + </actionGroup> |
| 65 | + <!-- Assign Thumb Role--> |
| 66 | + <actionGroup ref="AdminAssignImageThumbNailRoleActionGroup" stepKey="assignThumbRole"> |
| 67 | + <argument name="image" value="AdobeThumbImage"/> |
| 68 | + </actionGroup> |
| 69 | + <!--Save Product After Assigning Roles and Images--> |
| 70 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="save"/> |
| 71 | + <!-- Go to the admin grid and see the Thumbnail image --> |
| 72 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProductOnProductGridPage"> |
| 73 | + <argument name="product" value="$$simpleProductOne$$"/> |
| 74 | + </actionGroup> |
| 75 | + <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeThumBImageInGrid"/> |
| 76 | + <!-- Go to the product page on StoreFront and see the Base image --> |
| 77 | + <amOnPage url="{{StorefrontProductPage.url($simpleProductOne.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/> |
| 78 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 79 | + <seeElement selector="{{StorefrontProductMediaSection.imageFile('/adobe-base')}}" stepKey="seeBaseImageOnProductPage"/> |
| 80 | + <!-- Go to the category page and see the Small image --> |
| 81 | + <amOnPage url="{{StorefrontCategoryPage.url($testCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> |
| 82 | + <waitForPageLoad stepKey="waitForPageLoadingToFinish"/> |
| 83 | + <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="seeSmallImageOnCategoryPage"/> |
| 84 | + </before> |
| 85 | + <after> |
| 86 | + <deleteData createDataKey="testCategory" stepKey="deleteCategory"/> |
| 87 | + <deleteData createDataKey="simpleProductOne" stepKey="deleteCustomer"/> |
| 88 | + </after> |
| 89 | + |
| 90 | + <!--Open Product On Admin Side--> |
| 91 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductPage"> |
| 92 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 93 | + </actionGroup> |
| 94 | + <!--Delete ThumbNail Image and Check Thumb Image is Absent after save--> |
| 95 | + <waitForElementVisible selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="waitForImagesSection"/> |
| 96 | + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> |
| 97 | + <waitForPageLoad stepKey="waitForRefresh"/> |
| 98 | + <waitForElementVisible selector="{{AdminProductImagesSection.nthRemoveImageBtn('3')}}" stepKey="waitForRemoveImageButtonVisible"/> |
| 99 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('3')}}" stepKey="removeThumbNailImage"/> |
| 100 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductPage"/> |
| 101 | + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(AdobeThumbImage)}}" stepKey="dontSeeThumbImageAfterSave"/> |
| 102 | + <!-- Go to the Product grid and see the Thumbnail image is not present --> |
| 103 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct"> |
| 104 | + <argument name="product" value="$$simpleProductOne$$"/> |
| 105 | + </actionGroup> |
| 106 | + <dontSeeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="dontSeeThumbImageInGrid"/> |
| 107 | + <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('placeholder/thumbnail')}}" stepKey="seeThumbPlaceHolderInstead"/> |
| 108 | + |
| 109 | + <!-- Open product edit page To Delete Small Image--> |
| 110 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProduct"> |
| 111 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 112 | + </actionGroup> |
| 113 | + <!--Delete Small Image and Check Small Image is Absent after save--> |
| 114 | + <waitForElementVisible selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="waitForImagesSectionsmall"/> |
| 115 | + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSectionsmall"/> |
| 116 | + <waitForPageLoad stepKey="waitForPageRefresh"/> |
| 117 | + <waitForElementVisible selector="{{AdminProductImagesSection.nthRemoveImageBtn('2')}}" stepKey="waitForRemoveImageButtonVisiblesmall"/> |
| 118 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('2')}}" stepKey="removeImagesmall"/> |
| 119 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterSmallImageDelete"/> |
| 120 | + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(AdobeSmallImage)}}" stepKey="seeImageSmallIsAbsentAfterSave"/> |
| 121 | + <!-- Go to the category page and see Small image is not present , placeholder image is present--> |
| 122 | + <amOnPage url="{{StorefrontCategoryPage.url($testCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPageOnStoreFront"/> |
| 123 | + <waitForPageLoad stepKey="waitforElementStorefrontCategoryProductSectionProductImageToOpen"/> |
| 124 | + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="dontSeeSmallImageOnCategoryPage"/> |
| 125 | + <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('placeholder/small_image')}}" stepKey="seePlaceholderSmallInstead"/> |
| 126 | + |
| 127 | + <!--Open Product On Admin Side--> |
| 128 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductPageOnAdmin"> |
| 129 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 130 | + </actionGroup> |
| 131 | + <!--Delete Base Image and Check Base Image is Absent after save--> |
| 132 | + <waitForElementVisible selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="waitForImagesSectionButton"/> |
| 133 | + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImageSection"/> |
| 134 | + <waitForPageLoad stepKey="waitForPageLoadAdminProductImagesSection"/> |
| 135 | + <waitForElementVisible selector="{{AdminProductImagesSection.nthRemoveImageBtn('1')}}" stepKey="waitForRemoveBaseImageButtonVisible"/> |
| 136 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('1')}}" stepKey="removeBaseImage"/> |
| 137 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterBaseImageDelete"/> |
| 138 | + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(TestImageAdobe)}}" stepKey="dontSeeBaseImageAfterSave"/> |
| 139 | + <!-- Go to the product page on StoreFront and Dont see the Base image --> |
| 140 | + <amOnPage url="{{StorefrontProductPage.url($simpleProductOne.custom_attributes[url_key]$)}}" stepKey="goToProductPageOnStoreFront"/> |
| 141 | + <waitForPageLoad stepKey="waitForStorefrontProductMediaSection"/> |
| 142 | + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile('TestImageAdobe')}}" stepKey="dontseeBaseImageOnProductPage"/> |
| 143 | + <seeElement selector="{{StorefrontProductMediaSection.imageFile('placeholder/image')}}" stepKey="seePlaceholderBaseInstead"/> |
| 144 | + |
| 145 | + </test> |
| 146 | +</tests> |
0 commit comments