Skip to content

Commit 586ae9d

Browse files
shanthiManjusha
authored andcommitted
ACQE-4569
1 parent 4a41ec4 commit 586ae9d

File tree

2 files changed

+117
-1
lines changed

2 files changed

+117
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributePropertiesSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/>
2626
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button" timeout="30"/>
2727
<element name="storefrontProperties" type="text" selector="//*[@id='product_attribute_tabs_front']/span[1]"/>
28-
28+
<element name="useInSearchResultsLayeredNavigation" type="select" selector="#is_filterable_in_search"/>
2929
<!-- Manage Options nth child-->
3030
<element name="dropdownNthOptionIsDefault" type="checkbox" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) .input-radio" parameterized="true"/>
3131
<element name="dropdownNthOptionAdmin" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(3) input" parameterized="true"/>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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="SavingCustomAttributeValuesUsingUITest">
12+
<annotations>
13+
<group value="Custom Attribute"/>
14+
<stories value="Create Customer Attribute with Multi Select Input Type"/>
15+
<title value="Saving custom attribute values using UI"/>
16+
<description value="Saving custom attribute values using UI"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-7325"/>
19+
</annotations>
20+
21+
<before>
22+
<!--Login as admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
24+
<!-- Create Simple Product -->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
26+
<!--Navigate to Stores > Attributes > Product.-->
27+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
28+
29+
<!--Create new Product Attribute as TextField, with code and default value.-->
30+
<actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute">
31+
<argument name="attribute" value="multiselectProductAttribute"/>
32+
</actionGroup>
33+
34+
<!--Navigate to Product Attribute, add Product Options and Save - 1-->
35+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1">
36+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
37+
</actionGroup>
38+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1">
39+
<argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/>
40+
<argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/>
41+
<argument name="row" value="1"/>
42+
</actionGroup>
43+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2">
44+
<argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/>
45+
<argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/>
46+
<argument name="row" value="2"/>
47+
</actionGroup>
48+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3">
49+
<argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/>
50+
<argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/>
51+
<argument name="row" value="3"/>
52+
</actionGroup>
53+
54+
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
55+
<argument name="useInLayeredNavigationValue" value="Filterable (with results)"/>
56+
</actionGroup>
57+
<selectOption selector="{{AttributePropertiesSection.useInSearchResultsLayeredNavigation}}" userInput="Yes" stepKey="selectUseInLayeredNavigationOption"/>
58+
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
59+
60+
<magentoCron groups="index" stepKey="reindex"/>
61+
</before>
62+
<after>
63+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/>
64+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage">
65+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
66+
</actionGroup>
67+
<click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/>
68+
<click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/>
69+
<waitForPageLoad stepKey="waitForDeletion"/>
70+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
71+
<argument name="indices" value=""/>
72+
</actionGroup>
73+
<!--Log out-->
74+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/>
75+
</after>
76+
77+
<!-- Open created product for edit -->
78+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
79+
<argument name="productId" value="$createSimpleProduct.id$"/>
80+
</actionGroup>
81+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82+
83+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/>
84+
<waitForPageLoad stepKey="waitForAttributeAdded"/>
85+
<!-- Filter By Attribute Label on Add Attribute Page -->
86+
<click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/>
87+
<fillField selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{multiselectProductAttribute.attribute_code}}" stepKey="fillAttrCodeField" />
88+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
89+
<click stepKey="clickonFirstRow" selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}"/>
90+
<click stepKey="clickOnAddSelected" selector="{{AdminProductAttributeGridSection.addSelected}}"/>
91+
<waitForPageLoad stepKey="waitForAttributeAdded2"/>
92+
93+
<!--<actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterByAttributeCode">
94+
<argument name="ProductAttributeCode" value="$$createAttribute.attribute_code$$"/>
95+
</actionGroup>-->
96+
<!-- Expand 'Attributes' tab -->
97+
<actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTab"/>
98+
<!-- Check created attribute presents in the 'Attributes' tab -->
99+
<seeElement selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" stepKey="assertAttributeIsPresentInTab"/>
100+
<!-- Select attribute options -->
101+
<!--<selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" parameterArray="multiselectProductAttribute.option1_admin" stepKey="selectAttributeOptions"/>-->
102+
<selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" userInput="{{multiselectProductAttribute.option1_admin}}" stepKey="selectProduct1AttributeOption"/>
103+
<!-- Save product -->
104+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
105+
106+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/>
107+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
108+
<argument name="phrase" value="$createSimpleProduct.name$"/>
109+
</actionGroup>
110+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" stepKey="waitForAttributeVisible"/>
111+
<conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/>
112+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForAttributeOptionsVisible"/>
113+
<wait time="90" stepKey="Wait"/>
114+
<see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="{{multiselectProductAttribute.option1_frontend}}" stepKey="seeOption2"/>
115+
</test>
116+
</tests>

0 commit comments

Comments
 (0)