Skip to content

Commit 4830955

Browse files
committed
ACP2E-1342:Create test coverage for ACP2E-1334
1 parent fc1c464 commit 4830955

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductWithTwoAttributeSwatchWithDisplayOutOfStockEnabledTest.xml

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
*/
77
-->
88

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">
1011
<test name="StorefrontConfigurableProductWithTwoAttributeSwatchWithDisplayOutOfStockEnabledTest">
1112
<annotations>
1213
<features value="Swatches"/>
@@ -19,41 +20,41 @@
1920
<useCaseId value="ACP2E-1342"/>
2021
<group value="Swatches"/>
2122
</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>
3435
<after>
3536
<!--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-->
3839
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
39-
<!-- Delete Configurable Product -->
40+
<!--Delete Configurable Product-->
4041
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts">
4142
<argument name="sku" value="{{ApiConfigurableProduct.sku}}"/>
4243
</actionGroup>
43-
<!-- Clear Filters -->
44+
<!--Clear Filters-->
4445
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
45-
<!-- Delete Color Attribute -->
46+
<!--Delete Color Attribute-->
4647
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute">
4748
<argument name="ProductAttribute" value="ProductColorAttribute"/>
4849
</actionGroup>
49-
<!-- Delete Size Attribute -->
50+
<!--Delete Size Attribute-->
5051
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute">
5152
<argument name="ProductAttribute" value="ProductSizeAttribute"/>
5253
</actionGroup>
53-
<!-- Logout from Admin Area -->
54-
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
54+
<!--Logout from Admin Area-->
55+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
5556
</after>
56-
<!-- Create Color Attribute -->
57+
<!--Create Color Attribute-->
5758
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute">
5859
<argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/>
5960
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
@@ -71,35 +72,36 @@
7172
</actionGroup>
7273
<!--Go to product page and Configure Size and Color-->
7374
<amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/>
74-
<actionGroup ref="CreateConfigurationsForTwoAttributeActionGroup" stepKey="createConfigurations">
75+
<actionGroup ref="CreateConfigurationsForTwoAttributeActionGroup" stepKey="createConfigurations">
7576
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
7677
<argument name="secondAttributeCode" value="{{ProductSizeAttribute.attribute_code}}"/>
7778
</actionGroup>
7879
<!--Make Simple product OOS-->
7980
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct">
8081
<argument name="productSku" value="$$createConfigurableProduct.sku$$-Blue-Medium"/>
8182
</actionGroup>
82-
<!-- Set Stock Status of Product to Out Of Stock-->
8383
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus">
8484
<argument name="stockStatus" value="Out of Stock"/>
8585
</actionGroup>
86-
<!-- Save Product-->
8786
<actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/>
88-
<!-- Perform Reindex-->
87+
<!--Perform Reindex-->
8988
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
9089
<argument name="indices" value=""/>
9190
</actionGroup>
9291
<!--Go to Storefront Product Page-->
9392
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage">
9493
<argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/>
9594
</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"/>
9999
<assertEquals stepKey="assertMediumDisabled">
100100
<actualResult type="const">$grabMediumAttribute</actualResult>
101101
<expectedResult type="string">true</expectedResult>
102102
</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>
105107
</tests>

0 commit comments

Comments
 (0)