Skip to content

Commit f5068ec

Browse files
committed
Merge branch 'MC-181' into RE-develop
2 parents 09f5b04 + e38ac26 commit f5068ec

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="productAttributeOptionsError" type="text" selector="//div[@class='mage-error']"/>
1717
<!-- Parameter is the order number of the attribute on the page (1 is the newest) -->
1818
<element name="nthAttributeOnPage" type="block" selector="tr:nth-of-type({{numElement}}) .data" parameterized="true"/>
19+
<element name="stockIndication" type="block" selector=".stock" />
1920
</section>
2021
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminConfigurableProductOutOfStockTest">
12+
<annotations>
13+
<features value="ConfigurableProduct"/>
14+
<stories value="Product visibility when in stock/out of stock"/>
15+
<title value="Configurable Product goes 'Out of Stock' if all associated Simple Products are 'Out of Stock'"/>
16+
<description value="Configurable Product goes 'Out of Stock' if all associated Simple Products are 'Out of Stock'"/>
17+
<testCaseId value="MC-181"/>
18+
<group value="ConfigurableProduct"/>
19+
</annotations>
20+
<before>
21+
<!-- TODO: This should be converted to an actionGroup once MQE-993 is fixed. -->
22+
<!-- Create the category to put the product in -->
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
25+
<!-- Create the configurable product based on the data in the /data folder -->
26+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
31+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
32+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
33+
<requiredEntity createDataKey="createConfigProductAttribute"/>
34+
</createData>
35+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
36+
<requiredEntity createDataKey="createConfigProductAttribute"/>
37+
</createData>
38+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</createData>
41+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
42+
<requiredEntity createDataKey="createConfigProductAttribute"/>
43+
</getData>
44+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
45+
<requiredEntity createDataKey="createConfigProductAttribute"/>
46+
</getData>
47+
48+
<!-- Create the 2 children that will be a part of the configurable product -->
49+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
50+
<requiredEntity createDataKey="createConfigProductAttribute"/>
51+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
52+
</createData>
53+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
54+
<requiredEntity createDataKey="createConfigProductAttribute"/>
55+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
56+
</createData>
57+
58+
<!-- Assign the two products to the configurable product -->
59+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
60+
<requiredEntity createDataKey="createConfigProduct"/>
61+
<requiredEntity createDataKey="createConfigProductAttribute"/>
62+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
63+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
64+
</createData>
65+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
66+
<requiredEntity createDataKey="createConfigProduct"/>
67+
<requiredEntity createDataKey="createConfigChildProduct1"/>
68+
</createData>
69+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
70+
<requiredEntity createDataKey="createConfigProduct"/>
71+
<requiredEntity createDataKey="createConfigChildProduct2"/>
72+
</createData>
73+
74+
<!-- log in -->
75+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
76+
</before>
77+
78+
<after>
79+
<amOnPage url="admin/admin/auth/logout/" stepKey="logout"/>
80+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
81+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
82+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
83+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
84+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
85+
</after>
86+
87+
<!-- Check to make sure that the configurable product shows up as in stock -->
88+
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>
89+
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
90+
<see stepKey="lookForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" />
91+
92+
<!-- Find the first simple product that we just created using the product grid and go to its page-->
93+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
94+
<waitForPageLoad stepKey="waitForAdminProductGridLoad"/>
95+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
96+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
97+
<argument name="product" value="ApiSimpleOne"/>
98+
</actionGroup>
99+
<waitForPageLoad stepKey="waitForFiltersToBeApplied"/>
100+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
101+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
102+
103+
<!-- Edit the quantity of the simple first product as 0 -->
104+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="fillProductQuantity"/>
105+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
106+
<waitForPageLoad stepKey="waitForProductPageSaved"/>
107+
108+
<!-- Check to make sure that the configurable product shows up as in stock -->
109+
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage2"/>
110+
<waitForPageLoad stepKey="waitForStoreFrontLoad2"/>
111+
<see stepKey="lookForOutOfStock2" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/>
112+
113+
<!-- Find the second simple product that we just created using the product grid and go to its page-->
114+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/>
115+
<waitForPageLoad stepKey="waitForAdminProductGridLoad2"/>
116+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
117+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2">
118+
<argument name="product" value="ApiSimpleTwo"/>
119+
</actionGroup>
120+
<waitForPageLoad stepKey="waitForFiltersToBeApplied2"/>
121+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage2"/>
122+
<waitForPageLoad stepKey="waitForProductPageLoad2"/>
123+
124+
<!-- Edit the quantity of the second simple product as 0 -->
125+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="fillProductQuantity2"/>
126+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
127+
<waitForPageLoad stepKey="waitForProductPageSaved2"/>
128+
129+
<!-- Check to make sure that the configurable product shows up as out of stock -->
130+
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage3"/>
131+
<waitForPageLoad stepKey="waitForStoreFrontLoad3"/>
132+
<see stepKey="lookForOutOfStock3" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="OUT OF STOCK"/>
133+
</test>
134+
</tests>

0 commit comments

Comments
 (0)