Skip to content

Commit 2a7a738

Browse files
Chhandak.Baruadevarul
authored andcommitted
ACP2E-1479: Product with any custom option causes an error when deleting product images
1 parent 848042d commit 2a7a738

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct7"/>
155155
<!--Assert notification and success messages-->
156156
<see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage2"/>
157-
<see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification2"/>
157+
<dontSee selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification2"/>
158158
<!--Reopen image tab and see the image is not deleted-->
159159
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesTab2"/>
160160
<waitForPageLoad stepKey="waitForImagesLoad2"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageTest.xml renamed to app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageWithCustomOptionTest.xml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminDeleteProductsImageTest">
11+
<test name="AdminDeleteProductsImageWithCustomOptionTest">
1212
<annotations>
1313
<stories value="Product with any custom option causes an error when deleting product images"/>
1414
<features value="Catalog"/>
@@ -29,8 +29,6 @@
2929
<argument name="productId" value="$$createProduct.id$$"/>
3030
</actionGroup>
3131
<waitForPageLoad stepKey="waitForProductPageLoad0"/>
32-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="['Default Category', $$createRootCategory.name$$, $$createSubCategory.name$$]" stepKey="fillCategory"/>
33-
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
3432
<!--Add images to the product-->
3533
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="visitAdminProductPage2">
3634
<argument name="productId" value="$$createProduct.id$$"/>
@@ -39,9 +37,17 @@
3937
<actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct">
4038
<argument name="image" value="ProductImage"/>
4139
</actionGroup>
42-
<actionGroup ref="AddProductImageActionGroup" stepKey="addImage1ToProduct">
43-
<argument name="image" value="TestImageNew"/>
40+
<!-- opens the custom option panel and clicks add options -->
41+
<click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}"/>
42+
<waitForPageLoad stepKey="waitForCustomOptionsOpen"/>
43+
44+
<!-- Create a custom option with 2 values -->
45+
<actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption1">
46+
<argument name="customOptionName" value="ProductOptionRadiobutton.title"/>
47+
<argument name="productOption" value="ProductOptionField"/>
48+
<argument name="productOption2" value="ProductOptionField2"/>
4449
</actionGroup>
50+
<waitForPageLoad stepKey="waitForProductPageLoad2"/>
4551
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/>
4652
</before>
4753
<after>
@@ -54,7 +60,6 @@
5460
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
5561
<argument name="productId" value="$$createProduct.id$$"/>
5662
</actionGroup>
57-
<waitForPageLoad stepKey="waitForProductPageLoad2"/>
5863
<!--Remove product image and save-->
5964
<actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductImage">
6065
<argument name="image" value="ProductImage"/>

0 commit comments

Comments
 (0)