|
| 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="StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Wishlist"/> |
| 14 | + <stories value="Update from Wishlist"/> |
| 15 | + <title value="Update Configurable Product Option from Wishlist"/> |
| 16 | + <description value="Verify that Configurable Product Option has correct value after navigating to Wishlist Item editing page"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-40881"/> |
| 19 | + <useCaseId value="MC-40651"/> |
| 20 | + <group value="catalog"/> |
| 21 | + <group value="configurableProduct"/> |
| 22 | + <group value="wishlist"/> |
| 23 | + </annotations> |
| 24 | + <before> |
| 25 | + <!-- Create Customer --> |
| 26 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 27 | + |
| 28 | + <!-- Create Product Attribute with two Options --> |
| 29 | + <createData entity="productDropDownAttribute" stepKey="createConfigurableProductAttribute"/> |
| 30 | + <createData entity="productAttributeOption1" stepKey="createAttributeFirstOption"> |
| 31 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 32 | + </createData> |
| 33 | + <createData entity="productAttributeOption2" stepKey="createAttributeSecondOption"> |
| 34 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 35 | + </createData> |
| 36 | + |
| 37 | + <!-- Add attribute to Default Attribute Set --> |
| 38 | + <createData entity="AddToDefaultSet" stepKey="addAttributeToDefaultSet"> |
| 39 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 40 | + </createData> |
| 41 | + |
| 42 | + <!-- Get Options of created Attribute --> |
| 43 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigurableAttributeFirstOption"> |
| 44 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 45 | + </getData> |
| 46 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigurableAttributeSecondOption"> |
| 47 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 48 | + </getData> |
| 49 | + |
| 50 | + <!-- Create Configurable Product --> |
| 51 | + <createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigurableProduct"/> |
| 52 | + |
| 53 | + <!-- Create first Simple Product and assign Attribute with Option to it --> |
| 54 | + <createData entity="ApiSimpleOne" stepKey="createFirstChildProduct"> |
| 55 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 56 | + <requiredEntity createDataKey="getConfigurableAttributeFirstOption"/> |
| 57 | + </createData> |
| 58 | + |
| 59 | + <!-- Create second Simple Product and assign Attribute with Option to it --> |
| 60 | + <createData entity="ApiSimpleOne" stepKey="createSecondChildProduct"> |
| 61 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 62 | + <requiredEntity createDataKey="getConfigurableAttributeSecondOption"/> |
| 63 | + </createData> |
| 64 | + |
| 65 | + <!-- Create Configurable Product Options --> |
| 66 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigurableProductOptions"> |
| 67 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 68 | + <requiredEntity createDataKey="createConfigurableProductAttribute"/> |
| 69 | + <requiredEntity createDataKey="getConfigurableAttributeFirstOption"/> |
| 70 | + <requiredEntity createDataKey="getConfigurableAttributeSecondOption"/> |
| 71 | + </createData> |
| 72 | + |
| 73 | + <!-- Assign Simple Products to Configurable Product --> |
| 74 | + <createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductFirstChild"> |
| 75 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 76 | + <requiredEntity createDataKey="createFirstChildProduct"/> |
| 77 | + </createData> |
| 78 | + <createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductSecondChild"> |
| 79 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 80 | + <requiredEntity createDataKey="createSecondChildProduct"/> |
| 81 | + </createData> |
| 82 | + |
| 83 | + <!-- Reindex invalidated indices after Product Attribute has been created/deleted --> |
| 84 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 85 | + </before> |
| 86 | + <after> |
| 87 | + <!-- Delete Configurable Product data --> |
| 88 | + <deleteData createDataKey="createFirstChildProduct" stepKey="deleteFirstChildProduct"/> |
| 89 | + <deleteData createDataKey="createSecondChildProduct" stepKey="deleteSecondChildProduct"/> |
| 90 | + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> |
| 91 | + <deleteData createDataKey="createConfigurableProductAttribute" stepKey="deleteProductAttribute"/> |
| 92 | + |
| 93 | + <!-- Logout from Customer account --> |
| 94 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/> |
| 95 | + |
| 96 | + <!-- Delete Customer --> |
| 97 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 98 | + |
| 99 | + <!-- Reindex invalidated indices after Product Attribute has been created/deleted --> |
| 100 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndicesAfterDelete"/> |
| 101 | + </after> |
| 102 | + |
| 103 | + <!-- Login as Customer --> |
| 104 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 105 | + <argument name="Customer" value="$createCustomer$"/> |
| 106 | + </actionGroup> |
| 107 | + |
| 108 | + <!-- Open Product details page --> |
| 109 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 110 | + <argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/> |
| 111 | + </actionGroup> |
| 112 | + |
| 113 | + <!-- Select first Drop-down Attribute Option and click 'Add to Wish List' button --> |
| 114 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOption"> |
| 115 | + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> |
| 116 | + <argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/> |
| 117 | + </actionGroup> |
| 118 | + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> |
| 119 | + <argument name="productVar" value="$createConfigurableProduct$"/> |
| 120 | + </actionGroup> |
| 121 | + |
| 122 | + <!-- Click 'Edit Item' button from Wishlist page and assert first Option in Drop-down Attribute --> |
| 123 | + <actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItem"> |
| 124 | + <argument name="productName" value="$createConfigurableProduct.name$"/> |
| 125 | + </actionGroup> |
| 126 | + <actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeFirstOption"> |
| 127 | + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> |
| 128 | + <argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/> |
| 129 | + </actionGroup> |
| 130 | + |
| 131 | + <!-- Select second Drop-down Option and click 'Update Wish List' button --> |
| 132 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectSecondOption"> |
| 133 | + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> |
| 134 | + <argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/> |
| 135 | + </actionGroup> |
| 136 | + <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="clickUpdateWishlist"/> |
| 137 | + |
| 138 | + <!-- Click 'Edit Item' button again and assert second Option in Drop-down Attribute --> |
| 139 | + <actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItemAgain"> |
| 140 | + <argument name="productName" value="$createConfigurableProduct.name$"/> |
| 141 | + </actionGroup> |
| 142 | + <actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeSecondOption"> |
| 143 | + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> |
| 144 | + <argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/> |
| 145 | + </actionGroup> |
| 146 | + </test> |
| 147 | +</tests> |
0 commit comments