Skip to content

Commit 48e4cf0

Browse files
committed
Merge remote-tracking branch 'origin/MC-4409' into mtf-eol
2 parents db5ee0a + f187765 commit 48e4cf0

6 files changed

+229
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,14 @@
6464
<waitForPageLoad stepKey="waitForUserInput"/>
6565
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
6666
</actionGroup>
67+
<actionGroup name="FilterProductAttributeSetGridByAttributeSetName">
68+
<arguments>
69+
<argument name="name" type="string"/>
70+
</arguments>
71+
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
72+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
73+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
74+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
75+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
76+
</actionGroup>
6777
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@
7373
<data key="used_for_sort_by">true</data>
7474
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
7575
</entity>
76+
<entity name="productDropDownAttributeNotSearchable" type="ProductAttribute">
77+
<data key="attribute_code" unique="suffix">attribute</data>
78+
<data key="frontend_input">select</data>
79+
<data key="scope">global</data>
80+
<data key="is_required">false</data>
81+
<data key="is_unique">false</data>
82+
<data key="is_searchable">false</data>
83+
<data key="is_visible">true</data>
84+
<data key="is_visible_in_advanced_search">true</data>
85+
<data key="is_visible_on_front">true</data>
86+
<data key="is_filterable">true</data>
87+
<data key="is_filterable_in_search">true</data>
88+
<data key="used_in_product_listing">true</data>
89+
<data key="is_used_for_promo_rules">true</data>
90+
<data key="is_comparable">true</data>
91+
<data key="is_used_in_grid">true</data>
92+
<data key="is_visible_in_grid">true</data>
93+
<data key="is_filterable_in_grid">true</data>
94+
<data key="used_for_sort_by">true</data>
95+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
96+
</entity>
7697
<entity name="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
7798
<data key="attribute_code">testattribute</data>
7899
<data key="frontend_input">select</data>
@@ -115,6 +136,27 @@
115136
<data key="used_for_sort_by">true</data>
116137
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
117138
</entity>
139+
<entity name="productAttributeMultiselectTwoOptionsNotSearchable" type="ProductAttribute">
140+
<data key="attribute_code" unique="suffix">attribute</data>
141+
<data key="frontend_input">multiselect</data>
142+
<data key="scope">global</data>
143+
<data key="is_required">false</data>
144+
<data key="is_unique">false</data>
145+
<data key="is_searchable">false</data>
146+
<data key="is_visible">true</data>
147+
<data key="is_visible_in_advanced_search">true</data>
148+
<data key="is_visible_on_front">true</data>
149+
<data key="is_filterable">true</data>
150+
<data key="is_filterable_in_search">true</data>
151+
<data key="used_in_product_listing">true</data>
152+
<data key="is_used_for_promo_rules">true</data>
153+
<data key="is_comparable">true</data>
154+
<data key="is_used_in_grid">true</data>
155+
<data key="is_visible_in_grid">true</data>
156+
<data key="is_filterable_in_grid">true</data>
157+
<data key="used_for_sort_by">true</data>
158+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
159+
</entity>
118160
<entity name="newsFromDate" type="ProductAttribute">
119161
<data key="attribute_code">news_from_date</data>
120162
<data key="default_frontend_label">Set Product as New from Date</data>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,7 @@
9696
<element name="AddToColumnOptions" type="select" selector="#is_used_in_grid"/>
9797
<element name="UseInFilterOptions" type="select" selector="#is_filterable_in_grid"/>
9898
<element name="UseInProductListing" type="select" selector="#used_in_product_listing"/>
99+
<element name="UseInSearch" type="select" selector="#is_searchable"/>
100+
<element name="VisibleInAdvancedSearch" type="select" selector="#is_visible_in_advanced_search"/>
99101
</section>
100102
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create product Dropdown attribute and check its visibility on frontend in Advanced Search form"/>
15+
<title value="AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest"/>
16+
<description value="Admin should able to create product Dropdown attribute and check its visibility on frontend in Advanced Search form"/>
17+
<testCaseId value="MC-10827"/>
18+
<severity value="CRITICAL"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<!-- Create product attribute with 2 options -->
24+
<createData entity="productDropDownAttributeNotSearchable" stepKey="attribute"/>
25+
<createData entity="productAttributeOption1" stepKey="option1">
26+
<requiredEntity createDataKey="attribute"/>
27+
</createData>
28+
<createData entity="productAttributeOption2" stepKey="option2">
29+
<requiredEntity createDataKey="attribute"/>
30+
</createData>
31+
32+
<!-- Create product attribute set -->
33+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
34+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
35+
</before>
36+
<after>
37+
<actionGroup ref="logout" stepKey="logout"/>
38+
</after>
39+
40+
<!-- Filter product attribute set by attribute set name -->
41+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
42+
<actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName">
43+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
44+
</actionGroup>
45+
46+
<!-- Assert created attribute in an unassigned attributes -->
47+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/>
48+
49+
<!-- Assign attribute in the group -->
50+
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
51+
<argument name="group" value="Product Details"/>
52+
<argument name="attribute" value="$$attribute.attribute_code$$"/>
53+
</actionGroup>
54+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
55+
<actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/>
56+
57+
<!-- Go to Product Attribute Grid page -->
58+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
59+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$$attribute.attribute_code$$" stepKey="fillAttrCodeField" />
60+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
61+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" />
62+
63+
<!-- Change attribute property: Frontend Label -->
64+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel"/>
65+
66+
<!-- Change attribute property: Use in Search >Yes -->
67+
<scrollToTopOfPage stepKey="scrollToTabs"/>
68+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
69+
<waitForPageLoad stepKey="waitForPageLoad1"/>
70+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="seeInSearch"/>
71+
72+
<!-- Change attribute property: Visible In Advanced Search >No -->
73+
<waitForPageLoad stepKey="waitForPageLoad2"/>
74+
<selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="No" stepKey="dontSeeInAdvancedSearch"/>
75+
76+
<!-- Save the new product attributes -->
77+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/>
78+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
79+
80+
<!-- Flash cache -->
81+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
82+
83+
<!-- Go to store's advanced catalog search page -->
84+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
85+
<dontSeeElement selector="{{StorefrontCatalogSearchAdvancedFormSection.AttributeByCode('$$attribute.attribute_code$$')}}" stepKey="dontSeeAttribute"/>
86+
</test>
87+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create Multiple Select product attribute and check its visibility in Advanced Search form"/>
15+
<title value="Create product attribute of type Multiple Select and check its visibility on frontend in Advanced Search form"/>
16+
<description value="Admin should be able to create product attribute of type Multiple Select and check its visibility on frontend in Advanced Search form"/>
17+
<testCaseId value="MC-10828"/>
18+
<severity value="CRITICAL"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<!-- Create a multiple select product attribute with two options -->
24+
<createData entity="productAttributeMultiselectTwoOptionsNotSearchable" stepKey="attribute"/>
25+
<createData entity="productAttributeOption1" stepKey="option1">
26+
<requiredEntity createDataKey="attribute"/>
27+
</createData>
28+
<createData entity="productAttributeOption2" stepKey="option2">
29+
<requiredEntity createDataKey="attribute"/>
30+
</createData>
31+
32+
<!-- Create product attribute set -->
33+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
34+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
35+
</before>
36+
<after>
37+
<actionGroup ref="logout" stepKey="logout"/>
38+
</after>
39+
40+
<!-- Filter product attribute set by attribute set name -->
41+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
42+
<actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName">
43+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
44+
</actionGroup>
45+
46+
<!-- Assert created attribute in an unassigned attributes -->
47+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/>
48+
49+
<!-- Assign attribute in the group -->
50+
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
51+
<argument name="group" value="Product Details"/>
52+
<argument name="attribute" value="$$attribute.attribute_code$$"/>
53+
</actionGroup>
54+
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
55+
<actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/>
56+
57+
<!-- Go to Product Attribute Grid page -->
58+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
59+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$$attribute.attribute_code$$" stepKey="fillAttrCodeField" />
60+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
61+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" />
62+
63+
<!-- Change attribute property: Frontend Label -->
64+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel"/>
65+
66+
<!-- Change attribute property: Use in Search >Yes -->
67+
<scrollToTopOfPage stepKey="scrollToTabs"/>
68+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
69+
<waitForPageLoad stepKey="waitForPageLoad1"/>
70+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="seeInSearch"/>
71+
72+
<!-- Change attribute property: Visible In Advanced Search >No -->
73+
<waitForPageLoad stepKey="waitForPageLoad2"/>
74+
<selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="No" stepKey="dontSeeInAdvancedSearch"/>
75+
76+
<!-- Save the new product attributes -->
77+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/>
78+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
79+
80+
<!-- Flash cache -->
81+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
82+
83+
<!-- Go to store's advanced catalog search page -->
84+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
85+
<dontSeeElement selector="{{StorefrontCatalogSearchAdvancedFormSection.AttributeByCode('$$attribute.attribute_code$$')}}" stepKey="dontSeeAttribute"/>
86+
</test>
87+
</tests>

app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<!-- Go to store's advanced catalog search page -->
4949
<actionGroup name="GoToStoreViewAdvancedCatalogSearchActionGroup">
5050
<amOnPage url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
51-
<waitForPageLoad stepKey="waitForPageLoad"/>
51+
<waitForPageLoad time="90" stepKey="waitForPageLoad"/>
5252
</actionGroup>
5353

5454
<!-- Storefront advanced catalog search by product name -->

0 commit comments

Comments
 (0)