Skip to content

Commit bca5afd

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-4341' into functional-testing-automation
2 parents 4cea0e8 + 571aace commit bca5afd

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
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="customAttribute" type="text" selector="input.admin__control-text[name='{{var}}']" parameterized="true"/>
4243
</section>
4344
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductGridTableHeaderSection">
1212
<element name="id" type="button" selector=".//*[@class='sticky-header']/following-sibling::*//th[@class='data-grid-th _sortable _draggable _{{order}}']/span[text()='ID']" parameterized="true"/>
13+
<element name="column" type="button" selector=".//*[@class='sticky-header']/following-sibling::*//*//th[@class='data-grid-th _sortable _draggable']/span[text()='{{attribute}}']" parameterized="true"/>
1314
</section>
1415
</sections>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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="DisplayingCustomAttributesInProductGridTest">
12+
<annotations>
13+
<stories value="Create custom attribute and check custom attribute is displaying in product grid"/>
14+
<title value="Displaying custom attributes in product grid"/>
15+
<description value="Create custom attribute and check custom attribute is displaying in product grid"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4341"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<!-- Login as admin -->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute">
26+
<argument name="productAttributeLabel" value="new_custom_attribute" />
27+
</actionGroup>
28+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
29+
<argument name="indices" value=""/>
30+
</actionGroup>
31+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
33+
</after>
34+
<!-- Navigate to Stores > Attributes > Products > Product Attribute-->
35+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
36+
<!-- create a custom attribute -->
37+
<!-- Click on Add new Attribute button -->
38+
<click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickAddNewAttributeButton"/>
39+
<!-- Add details to Attribute Properties -->
40+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="new_custom_attribute" stepKey="fillAttributeLabel"/>
41+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Field" stepKey="selectDropdown"/>
42+
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="No" stepKey="selectRequiredAsNo"/>
43+
<!-- Add details to Advanced Attribute Properties -->
44+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="clickAdvancedAttributeProperties"/>
45+
<!-- Provide the Storefront Properties -->
46+
<selectOption selector="{{AdvancedAttributePropertiesSection.AddToColumnOptions}}" userInput="Yes" stepKey="selectYesForColumnOptions"/>
47+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInFilterOptions}}" userInput="Yes" stepKey="selectYesForFilterOptions"/>
48+
<!-- Save the Attribute -->
49+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="saveTheAttribute"/>
50+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
51+
52+
<!-- Navigate to Stores > Attributes > Attribute Set -->
53+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
54+
<waitForPageLoad stepKey="waitForPageLoad"/>
55+
<!-- Search and open Attribute Set from preconditions -->
56+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute">
57+
<argument name="name" value="Default"/>
58+
</actionGroup>
59+
<!-- Move created product attribute from unassigned to assigned -->
60+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute('new_custom_attribute')}}" selector2="{{AdminProductAttributeSetEditSection.assignedAttribute('sku')}}" stepKey="dragAndDrop"/>
61+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
62+
<!-- Click 'Save' -->
63+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
64+
<!-- Navigate to Catalog > Products -->
65+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>
66+
<!-- verify created attribute in grid column -->
67+
<seeElement selector="{{AdminProductGridTableHeaderSection.column('new_custom_attribute')}}" stepKey="seeCreatedAttributeInProductGrid"/>
68+
<!-- expand filters -->
69+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/>
70+
<waitForPageLoad stepKey="waitForFilterOptionsOpen"/>
71+
<!-- verify created attribute is present in filters section-->
72+
<seeElement selector="{{AdminProductGridFilterSection.customAttribute('new_custom_attribute')}}" stepKey="seeCreatedAttributeInFiltersSection"/>
73+
<!-- expand columns option to uncheck created attribute-->
74+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdown"/>
75+
<uncheckOption selector="{{AdminProductGridFilterSection.viewColumnOption('new_custom_attribute')}}" stepKey="unCheckColumn"/>
76+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdown"/>
77+
<!-- verify created custom attribute is not there-->
78+
<dontSeeElement selector="{{AdminProductGridTableHeaderSection.column('new_custom_attribute')}}" stepKey="dontSeeCreatedAttributeInProductGrid"/>
79+
<!-- expand columns option to uncheck created attribute-->
80+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdownAgain"/>
81+
<actionGroup ref="CheckAdminProductGridColumnOptionActionGroup" stepKey="checkCreatedAttributeOption">
82+
<argument name="optionName" value="new_custom_attribute"/>
83+
</actionGroup>
84+
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeAgainColumnsDropdownSpecialPrice"/>
85+
<!-- verify created attribute is present in grid -->
86+
<seeElement selector="{{AdminProductGridFilterSection.customAttribute('new_custom_attribute')}}" stepKey="checkAttributeInProductGrid"/>
87+
</test>
88+
</tests>

0 commit comments

Comments
 (0)