Skip to content

Commit c7d6bd0

Browse files
committed
Merge remote-tracking branch 'origin/MC-4526' into mtf-eol
2 parents dab8683 + 6e8277e commit c7d6bd0

File tree

2 files changed

+175
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)