Skip to content

Commit eaf8caa

Browse files
committed
MAGETWO-91434: Default option for Status attribute not being set
- added functional test to cover bug fix
1 parent 080dba1 commit eaf8caa

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section name="AdminProductFormSection">
1111
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
1212
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
13+
<element name="enableProduct" type="checkbox" selector="input[name='product[status]']"/>
1314
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
1415
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']"/>
1516
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="AdminProductStatusAttributeDisabledByDefaultTest">
12+
<annotations>
13+
<title value="Verify the default option value for product Status attribute is set correctly during product creation"/>
14+
<description value="The default option value for product Status attribute is set correctly during product creation"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MAGETWO-92424"/>
17+
<group value="Catalog"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
21+
22+
</before>
23+
<after>
24+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttribute"/>
25+
<waitForPageLoad stepKey="wait1"/>
26+
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid1"/>
27+
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="Enable Product" stepKey="setAttributeLabel1"/>
28+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid1"/>
29+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow1"/>
30+
<waitForPageLoad stepKey="wait2"/>
31+
<click selector="{{AdminNewAttributePanel.isDefault('1')}}" stepKey="resetOptionForStatusAttribute"/>
32+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute1"/>
33+
<waitForPageLoad stepKey="waitForSaveAttribute1"/>
34+
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache1"/>
35+
36+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
37+
</after>
38+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttribute"/>
39+
<waitForPageLoad stepKey="wait1"/>
40+
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
41+
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="Enable Product" stepKey="setAttributeLabel"/>
42+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
43+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
44+
<waitForPageLoad stepKey="wait2"/>
45+
<click selector="{{AdminNewAttributePanel.isDefault('2')}}" stepKey="chooseDisabledOptionForStatus"/>
46+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
47+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
48+
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/>
49+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
50+
<waitForPageLoad time="30" stepKey="waitForProductGridPageToLoad"/>
51+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductDropdown"/>
52+
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickOnAddSimpleProduct"/>
53+
<waitForPageLoad stepKey="waitForProductEditToLoad"/>
54+
<dontSeeCheckboxIsChecked selector="{{AdminProductFormSection.enableProduct}}" stepKey="dontSeeCheckboxEnableProductIsChecked"/>
55+
56+
</test>
57+
</tests>

0 commit comments

Comments
 (0)