|
20 | 20 | <group value="Catalog"/> |
21 | 21 | </annotations> |
22 | 22 | <before> |
23 | | - <!--Login as admin--> |
24 | 23 | <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"/> |
| 24 | + <createData entity="ApiCategory" stepKey="category"/> |
| 25 | + <!--Create product with small, base, and thumbnail image--> |
| 26 | + <createData entity="ApiSimpleProduct" stepKey="productWithImages"> |
| 27 | + <requiredEntity createDataKey="category"/> |
| 28 | + </createData> |
| 29 | + <updateData createDataKey="productWithImages" entity="productWithOptions2" stepKey="updateProductWithCustomOption"/> |
32 | 30 | <!--Add images to the product--> |
33 | 31 | <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="visitAdminProductPage2"> |
34 | | - <argument name="productId" value="$$createProduct.id$$"/> |
| 32 | + <argument name="productId" value="$$productWithImages.id$$"/> |
35 | 33 | </actionGroup> |
36 | 34 | <waitForPageLoad stepKey="waitForProductPageLoad1"/> |
37 | 35 | <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> |
38 | 36 | <argument name="image" value="ProductImage"/> |
39 | 37 | </actionGroup> |
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"/> |
49 | | - </actionGroup> |
50 | 38 | <waitForPageLoad stepKey="waitForProductPageLoad2"/> |
51 | 39 | <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> |
52 | 40 | </before> |
53 | 41 | <after> |
54 | | - <deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/> |
55 | | - <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> |
56 | | - <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 42 | + <!--Delete prerequisite entities--> |
| 43 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 44 | + <deleteData createDataKey="productWithImages" stepKey="deleteProductWithImages"/> |
57 | 45 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
58 | 46 | </after> |
59 | 47 | <!--Open product page on admin--> |
60 | 48 | <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
61 | | - <argument name="productId" value="$$createProduct.id$$"/> |
| 49 | + <argument name="productId" value="$$productWithImages.id$$"/> |
62 | 50 | </actionGroup> |
| 51 | + <waitForPageLoad stepKey="waitForProductPageLoad1"/> |
63 | 52 | <!--Remove product image and save--> |
64 | | - <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductImage"> |
| 53 | + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductFromCart2"> |
65 | 54 | <argument name="image" value="ProductImage"/> |
66 | 55 | </actionGroup> |
67 | 56 | <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> |
68 | | - <!--Assert notification and success messages--> |
69 | | - <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage"/> |
70 | | - <dontSee selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification"/> |
71 | | - <!--Reopen image tab and see the image is not deleted--> |
72 | | - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesTab"/> |
73 | | - <waitForPageLoad stepKey="waitForImagesLoad"/> |
74 | | - <dontSeeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted"/> |
| 57 | + <!--Verify the success messages without notification--> |
| 58 | + <actionGroup ref="VerifySuccessMessagesWithoutNotificationActionGroup" stepKey="verifySuccessMessages"> |
| 59 | + <argument name="image" value="ProductImage"/> |
| 60 | + </actionGroup> |
75 | 61 | </test> |
76 | 62 | </tests> |
0 commit comments