Skip to content

Commit 088f26e

Browse files
Merge remote-tracking branch 'magento-l3/ACP2E-1342' into PR-L3-21-02-2023
2 parents 912b787 + 551a581 commit 088f26e

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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="StorefrontConfigurableProductWithTwoAttributeSwatchWithDisplayOutOfStockEnabledTest">
12+
<annotations>
13+
<features value="Swatches"/>
14+
<stories value="Configurable product with two swatch attributes and display out of stock enabled"/>
15+
<title value="Configurable product with two swatch attributes and display out of stock enabled"/>
16+
<description value="Storefront selection of out of stock child products of configurable products are
17+
disabled when display out of stock options are enabled"/>
18+
<severity value="MAJOR"/>
19+
<testCaseId value="AC-7020"/>
20+
<useCaseId value="ACP2E-1342"/>
21+
<group value="Swatches"/>
22+
</annotations>
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>
35+
<after>
36+
<!--Set Display out of stock Disabled-->
37+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="setDisplayOutOfStockProduct"/>
38+
<!--Delete Category-->
39+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
40+
<!--Delete Configurable Product-->
41+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts">
42+
<argument name="sku" value="{{ApiConfigurableProduct.sku}}"/>
43+
</actionGroup>
44+
<!--Clear Filters-->
45+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
46+
<!--Delete Color Attribute-->
47+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute">
48+
<argument name="ProductAttribute" value="ProductColorAttribute"/>
49+
</actionGroup>
50+
<!--Delete Size Attribute-->
51+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute">
52+
<argument name="ProductAttribute" value="ProductSizeAttribute"/>
53+
</actionGroup>
54+
<!--Logout from Admin Area-->
55+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
56+
</after>
57+
<!--Create Color Attribute-->
58+
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute">
59+
<argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/>
60+
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
61+
<argument name="option1" value="Black"/>
62+
<argument name="option2" value="White"/>
63+
<argument name="option3" value="Blue"/>
64+
</actionGroup>
65+
<!--Create Size swatch attribute with 3 options: Small, Medium and Large-->
66+
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addSizeAttribute">
67+
<argument name="attributeName" value="{{ProductSizeAttribute.frontend_label}}"/>
68+
<argument name="attributeCode" value="{{ProductSizeAttribute.attribute_code}}"/>
69+
<argument name="option1" value="Small"/>
70+
<argument name="option2" value="Medium"/>
71+
<argument name="option3" value="Large"/>
72+
</actionGroup>
73+
<!--Go to product page and Configure Size and Color-->
74+
<amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/>
75+
<actionGroup ref="CreateConfigurationsForTwoAttributeActionGroup" stepKey="createConfigurations">
76+
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
77+
<argument name="secondAttributeCode" value="{{ProductSizeAttribute.attribute_code}}"/>
78+
</actionGroup>
79+
<!--Make Simple product OOS-->
80+
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct">
81+
<argument name="productSku" value="$$createConfigurableProduct.sku$$-Blue-Medium"/>
82+
</actionGroup>
83+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus">
84+
<argument name="stockStatus" value="Out of Stock"/>
85+
</actionGroup>
86+
<actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/>
87+
<!--Perform Reindex-->
88+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
89+
<argument name="indices" value=""/>
90+
</actionGroup>
91+
<!--Go to Storefront Product Page-->
92+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage">
93+
<argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/>
94+
</actionGroup>
95+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Blue')}}"
96+
stepKey="clickBlueAttribute"/>
97+
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Medium')}}"
98+
userInput="disabled" stepKey="grabMediumAttribute"/>
99+
<assertEquals stepKey="assertMediumDisabled">
100+
<actualResult type="const">$grabMediumAttribute</actualResult>
101+
<expectedResult type="string">true</expectedResult>
102+
</assertEquals>
103+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Large')}}"
104+
stepKey="clickLargeAttribute"/>
105+
<see selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Large')}}" userInput="Large" stepKey="seeSwatchSizeLargeBecomeSelected"/>
106+
</test>
107+
</tests>

0 commit comments

Comments
 (0)