Skip to content

Commit 8200acc

Browse files
committed
MC-4526: Convert VerifyConfigurableProductLayeredNavigationTest to MFTF
1 parent 47d89b7 commit 8200acc

File tree

2 files changed

+174
-0
lines changed

2 files changed

+174
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Check configurable product attribute options on the category page -->
12+
<actionGroup name="SelectStorefrontSideBarAttributeOption">
13+
<arguments>
14+
<argument name="categoryName" type="string"/>
15+
<argument name="attributeDefaultLabel" type="string"/>
16+
</arguments>
17+
<amOnPage url="categoryName" stepKey="openCategoryStoreFrontPage"/>
18+
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
19+
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="seeCategoryInFrontPage"/>
20+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="clickOnCategory"/>
21+
<waitForPageLoad stepKey="waitForCategoryPageToLoad1"/>
22+
<seeElement selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(attributeDefaultLabel)}}" stepKey="seeAttributeOptionsTitle"/>
23+
<click selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(attributeDefaultLabel)}}" stepKey="clickAttributeOptions"/>
24+
<waitForPageLoad stepKey="waitForPageToLoad"/>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontVerifyConfigurableProductLayeredNavigationTest">
11+
<annotations>
12+
<stories value="Create configurable product"/>
13+
<title value="Out of stock configurable attribute option doesn't show in Layered Navigation"/>
14+
<description value=" Login as admin and verify out of stock configurable attribute option doesn't show in Layered Navigation"/>
15+
<testCaseId value="MC-13734"/>
16+
<severity value="CRITICAL"/>
17+
<group value="ConfigurableProduct"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Login as Admin -->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
24+
25+
<!-- Create Default Category -->
26+
<createData entity="_defaultCategory" stepKey="createCategory"/>
27+
28+
<!-- Create an attribute with three options -->
29+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
30+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
31+
<requiredEntity createDataKey="createConfigProductAttribute"/>
32+
</createData>
33+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
34+
<requiredEntity createDataKey="createConfigProductAttribute"/>
35+
</createData>
36+
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
37+
<requiredEntity createDataKey="createConfigProductAttribute"/>
38+
</createData>
39+
40+
<!-- Add the attribute just created to default attribute set -->
41+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
42+
<requiredEntity createDataKey="createConfigProductAttribute"/>
43+
</createData>
44+
45+
<!-- Get the first option of the attribute created -->
46+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
47+
<requiredEntity createDataKey="createConfigProductAttribute"/>
48+
</getData>
49+
50+
<!-- Get the second option of the attribute created -->
51+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
</getData>
54+
55+
<!-- Get the third option of the attribute created -->
56+
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
57+
<requiredEntity createDataKey="createConfigProductAttribute"/>
58+
</getData>
59+
60+
<!-- Create Configurable product -->
61+
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
62+
<requiredEntity createDataKey="createCategory"/>
63+
</createData>
64+
65+
<!-- Create a simple product and give it the attribute with the first option -->
66+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
67+
<requiredEntity createDataKey="createConfigProductAttribute"/>
68+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
69+
</createData>
70+
71+
<!--Create a simple product and give it the attribute with the second option -->
72+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
73+
<requiredEntity createDataKey="createConfigProductAttribute"/>
74+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
75+
</createData>
76+
77+
<!--Create a simple product and give it the attribute with the Third option -->
78+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
79+
<requiredEntity createDataKey="createConfigProductAttribute"/>
80+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
81+
</createData>
82+
83+
<!-- Create the configurable product -->
84+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
85+
<requiredEntity createDataKey="createConfigProduct"/>
86+
<requiredEntity createDataKey="createConfigProductAttribute"/>
87+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
88+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
89+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
90+
</createData>
91+
92+
<!-- Add the first simple product to the configurable product -->
93+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
94+
<requiredEntity createDataKey="createConfigProduct"/>
95+
<requiredEntity createDataKey="createConfigChildProduct1"/>
96+
</createData>
97+
98+
<!-- Add the second simple product to the configurable product -->
99+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
100+
<requiredEntity createDataKey="createConfigProduct"/>
101+
<requiredEntity createDataKey="createConfigChildProduct2"/>
102+
</createData>
103+
104+
<!-- Add the third simple product to the configurable product -->
105+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
106+
<requiredEntity createDataKey="createConfigProduct"/>
107+
<requiredEntity createDataKey="createConfigChildProduct3"/>
108+
</createData>
109+
</before>
110+
<after>
111+
<!-- Delete Created Data -->
112+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
113+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
114+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
115+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
116+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/>
117+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/>
118+
<actionGroup ref="logout" stepKey="logout"/>
119+
</after>
120+
121+
<!-- Open Product Index Page and Filter First Child product -->
122+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
123+
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
124+
<actionGroup ref="filterProductGridBySku" stepKey="filterProduct">
125+
<argument name="product" value="ApiSimpleOne"/>
126+
</actionGroup>
127+
128+
<!-- Change the First Child Product stock status as 'Out Of Stock'-->
129+
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/>
130+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
131+
<scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToProductQuantity"/>
132+
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="disableProduct"/>
133+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
134+
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
135+
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
136+
137+
<!--Open Category in Store Front and select product attribute option from sidebar -->
138+
<actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="selectStorefrontProductAttributeOption">
139+
<argument name="categoryName" value="$$createCategory.name$$"/>
140+
<argument name="attributeDefaultLabel" value="$$createConfigProductAttribute.default_value$$"/>
141+
</actionGroup>
142+
143+
<!--Assert Out Of Stock product is not visible in Storefront Page -->
144+
<dontSee selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="dontSeeOption1"/>
145+
<see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="seeOption2"/>
146+
<see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="$$getConfigAttributeOption3.label$$" stepKey="seeOption3"/>
147+
</test>
148+
</tests>

0 commit comments

Comments
 (0)