|
| 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="AdminDeleteProductsImageTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Product with any custom option causes an error when deleting product images"/> |
| 14 | + <features value="Catalog"/> |
| 15 | + <title value="Error occurred while delete products image any custom option"/> |
| 16 | + <description value="When a product is created with custom option and added images, then save the product after deleting the image, Magento shows a warming message."/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-7556"/> |
| 19 | + <useCaseId value="ACP2E-1479"/> |
| 20 | + <group value="Catalog"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Login as admin--> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 26 | + <createData entity="SubCategory" stepKey="createSubCategory"/> |
| 27 | + <createData entity="NewRootCategory" stepKey="createRootCategory"/> |
| 28 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="visitAdminProductPage"> |
| 29 | + <argument name="productId" value="$$createProduct.id$$"/> |
| 30 | + </actionGroup> |
| 31 | + <waitForPageLoad stepKey="waitForProductPageLoad0"/> |
| 32 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="['Default Category', $$createRootCategory.name$$, $$createSubCategory.name$$]" stepKey="fillCategory"/> |
| 33 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 34 | + <!--Add images to the product--> |
| 35 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="visitAdminProductPage2"> |
| 36 | + <argument name="productId" value="$$createProduct.id$$"/> |
| 37 | + </actionGroup> |
| 38 | + <waitForPageLoad stepKey="waitForProductPageLoad1"/> |
| 39 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> |
| 40 | + <argument name="image" value="ProductImage"/> |
| 41 | + </actionGroup> |
| 42 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1ToProduct"> |
| 43 | + <argument name="image" value="TestImageNew"/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> |
| 46 | + </before> |
| 47 | + <after> |
| 48 | + <deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/> |
| 49 | + <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> |
| 50 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 51 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 52 | + </after> |
| 53 | + <!--Open product page on admin--> |
| 54 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
| 55 | + <argument name="productId" value="$$createProduct.id$$"/> |
| 56 | + </actionGroup> |
| 57 | + <waitForPageLoad stepKey="waitForProductPageLoad2"/> |
| 58 | + <!--Remove product image and save--> |
| 59 | + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductImage"> |
| 60 | + <argument name="image" value="ProductImage"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> |
| 63 | + <!--Assert notification and success messages--> |
| 64 | + <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage"/> |
| 65 | + <dontSee selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification"/> |
| 66 | + <!--Reopen image tab and see the image is not deleted--> |
| 67 | + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesTab"/> |
| 68 | + <waitForPageLoad stepKey="waitForImagesLoad"/> |
| 69 | + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted"/> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments