|
6 | 6 | */ |
7 | 7 | --> |
8 | 8 |
|
9 | | -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
10 | 11 | <test name="StorefrontConfigurableProductWithTwoAttributeSwatchWithDisplayOutOfStockEnabledTest"> |
11 | 12 | <annotations> |
12 | 13 | <features value="Swatches"/> |
|
19 | 20 | <useCaseId value="ACP2E-1342"/> |
20 | 21 | <group value="Swatches"/> |
21 | 22 | </annotations> |
22 | | - <before> |
23 | | - <!--Set Display out of stock Enabled--> |
24 | | - <magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 1"/> |
25 | | - <!-- Create Category --> |
26 | | - <createData entity="ApiCategory" stepKey="createCategory"/> |
27 | | - <!-- Create Configurable Product --> |
28 | | - <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> |
29 | | - <requiredEntity createDataKey="createCategory"/> |
30 | | - </createData> |
31 | | - <!-- Login as Admin --> |
32 | | - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
33 | | - </before> |
| 23 | + <before> |
| 24 | + <!--Set Display out of stock Enabled--> |
| 25 | + <magentoCLI command="config:set cataloginventory/options/show_out_of_stock 1" stepKey="setDisplayOutOfStockProduct"/> |
| 26 | + <!--Create Category--> |
| 27 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 28 | + <!--Create Configurable Product--> |
| 29 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + <!--Login as Admin--> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 34 | + </before> |
34 | 35 | <after> |
35 | 36 | <!--Set Display out of stock Disabled--> |
36 | | - <magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0"/> |
37 | | - <!-- Delete Category --> |
| 37 | + <magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="setDisplayOutOfStockProduct"/> |
| 38 | + <!--Delete Category--> |
38 | 39 | <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
39 | | - <!-- Delete Configurable Product --> |
| 40 | + <!--Delete Configurable Product--> |
40 | 41 | <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts"> |
41 | 42 | <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> |
42 | 43 | </actionGroup> |
43 | | - <!-- Clear Filters --> |
| 44 | + <!--Clear Filters--> |
44 | 45 | <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/> |
45 | | - <!-- Delete Color Attribute --> |
| 46 | + <!--Delete Color Attribute--> |
46 | 47 | <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> |
47 | 48 | <argument name="ProductAttribute" value="ProductColorAttribute"/> |
48 | 49 | </actionGroup> |
49 | | - <!-- Delete Size Attribute --> |
| 50 | + <!--Delete Size Attribute--> |
50 | 51 | <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute"> |
51 | 52 | <argument name="ProductAttribute" value="ProductSizeAttribute"/> |
52 | 53 | </actionGroup> |
53 | | - <!-- Logout from Admin Area --> |
54 | | - <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 54 | + <!--Logout from Admin Area--> |
| 55 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
55 | 56 | </after> |
56 | | - <!-- Create Color Attribute --> |
| 57 | + <!--Create Color Attribute--> |
57 | 58 | <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> |
58 | 59 | <argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> |
59 | 60 | <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
|
71 | 72 | </actionGroup> |
72 | 73 | <!--Go to product page and Configure Size and Color--> |
73 | 74 | <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/> |
74 | | - <actionGroup ref="CreateConfigurationsForTwoAttributeActionGroup" stepKey="createConfigurations"> |
| 75 | + <actionGroup ref="CreateConfigurationsForTwoAttributeActionGroup" stepKey="createConfigurations"> |
75 | 76 | <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
76 | 77 | <argument name="secondAttributeCode" value="{{ProductSizeAttribute.attribute_code}}"/> |
77 | 78 | </actionGroup> |
78 | 79 | <!--Make Simple product OOS--> |
79 | 80 | <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> |
80 | 81 | <argument name="productSku" value="$$createConfigurableProduct.sku$$-Blue-Medium"/> |
81 | 82 | </actionGroup> |
82 | | - <!-- Set Stock Status of Product to Out Of Stock--> |
83 | 83 | <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus"> |
84 | 84 | <argument name="stockStatus" value="Out of Stock"/> |
85 | 85 | </actionGroup> |
86 | | - <!-- Save Product--> |
87 | 86 | <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> |
88 | | - <!-- Perform Reindex--> |
| 87 | + <!--Perform Reindex--> |
89 | 88 | <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
90 | 89 | <argument name="indices" value=""/> |
91 | 90 | </actionGroup> |
92 | 91 | <!--Go to Storefront Product Page--> |
93 | 92 | <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage"> |
94 | 93 | <argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/> |
95 | 94 | </actionGroup> |
96 | | - <waitForPageLoad stepKey="waitForConfigurableProductPage"/> |
97 | | - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Blue')}}" stepKey="clickBlueAttribute"/> |
98 | | - <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Medium')}}" userInput="disabled" stepKey="grabMediumAttribute"/> |
| 95 | + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Blue')}}" |
| 96 | + stepKey="clickBlueAttribute"/> |
| 97 | + <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Medium')}}" |
| 98 | + userInput="disabled" stepKey="grabMediumAttribute"/> |
99 | 99 | <assertEquals stepKey="assertMediumDisabled"> |
100 | 100 | <actualResult type="const">$grabMediumAttribute</actualResult> |
101 | 101 | <expectedResult type="string">true</expectedResult> |
102 | 102 | </assertEquals> |
103 | | - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Large')}}" stepKey="clickLargeAttribute"/> |
104 | | - </test> |
| 103 | + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Large')}}" |
| 104 | + stepKey="clickLargeAttribute"/> |
| 105 | + <see selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Large')}}" userInput="Large" stepKey="seeSwatchSizeLargeRemainsSelected"/> |
| 106 | + </test> |
105 | 107 | </tests> |
0 commit comments