Skip to content

Commit ee4972c

Browse files
committed
ACP2E-1073 - Test coverage for ACP2E-897
1 parent c6aeb6a commit ee4972c

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@
3939
<element name="inputByCodeRangeFrom" type="input" selector="input.admin__control-text[name='{{code}}[from]']" parameterized="true"/>
4040
<element name="inputByCodeRangeTo" type="input" selector="input.admin__control-text[name='{{code}}[to]']" parameterized="true"/>
4141
<element name="storeViewOptions" type="text" selector=".admin__data-grid-outer-wrap select[name='store_id'] > option[value='{{value}}']" parameterized="true"/>
42+
<element name="viewColumnOptionName" type="text" selector="//div[contains(@class, '_active')]//div[contains(@class, 'admin__data-grid-action-columns-menu')]//div[@class='admin__field-option']//label[text()='{{col}}']" parameterized="true"/>
43+
4244
</section>
4345
</sections>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="AdminProductGridCustomViewColumnDisplayTest">
12+
<annotations>
13+
<stories value="The list of the visible columns didn't save for custom view when column position is changed"/>
14+
<title value="The list of the visible columns didn't save for custom view"/>
15+
<description value="Login as Admin, go to Product grid and move column position"/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="ACP2E-1073"/>
18+
<useCaseId value="ACP2E-1073"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<!--Create Simple Product and Category -->
23+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
</before>
31+
<!-- Log in as admin-->
32+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
33+
<!-- Navigate to products list page and select created products -->
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
35+
<!-- Open the column dropdown to add the special price from the catalog product grid -->
36+
<dragAndDrop selector1="{{AdminProductGridSection.columnHeader('SKU')}}" selector2="{{AdminProductGridSection.columnHeader('Name')}}" stepKey="moveCustomOptionRecord"/>
37+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
38+
<!--Remove Price column-->
39+
<seeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="seeProductPriceColumn"/>
40+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdownPrice"/>
41+
<waitForElementVisible selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="waitForViewBookmarks"/>
42+
43+
<uncheckOption selector="{{AdminProductGridFilterSection.viewColumnOptionName('Price')}}" stepKey="hidePriceColumn"/>
44+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdownPrice"/>
45+
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="dontSeeProductPriceColumn"/>
46+
<!--Add Weight column-->
47+
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="dontSeeWeightColumn"/>
48+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdownWeight"/>
49+
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOptionName('Weight')}}" stepKey="showWeightColumn"/>
50+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdownWeight"/>
51+
<seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/>
52+
<after>
53+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
54+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
55+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="beginWithLogout"/>
57+
</after>
58+
59+
</test>
60+
</tests>

app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<input class="admin__control-checkbox" type="checkbox"
1616
disable="isDisabled($col())"
1717
ko-checked="$col().visible"
18-
attr="id: ++ko.uid"/>
18+
attr="id: ++ko.uid">
1919
<label class="admin__field-label"
2020
translate="$col().label"
21-
attr="for: ko.uid, title: $col().label"></label>
21+
attr="for: ko.uid"></label>
2222
</div>
2323
</div>
2424
<div class="admin__action-dropdown-menu-footer">

0 commit comments

Comments
 (0)