Skip to content

Commit f599970

Browse files
shanthishanthi
authored andcommitted
ACQE:4370:Product can be found by value of 'Searchable' attribute
1 parent 1c553ec commit f599970

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="ChooseElasticSearchAsSearchEngineActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'elasticsearch7'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="configureSearchEngine"/>
17+
<waitForPageLoad stepKey="waitForConfigPage"/>
18+
<scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab"/>
19+
<conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.checkIfCatalogSearchTabExpand}}" visible="true" stepKey="expandCatalogSearchTab"/>
20+
<waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" stepKey="waitForDropdownToBeVisible"/>
21+
<uncheckOption selector="{{AdminCatalogSearchConfigurationSection.searchEngineDefaultSystemValue}}" stepKey="uncheckUseSystemValue"/>
22+
<selectOption selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" userInput="Elasticsearch 7" stepKey="chooseES5"/>
23+
<!--<scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab2"/>-->
24+
<!--<click selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="collapseCatalogSearchTab"/>-->
25+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/>
26+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/>
27+
</actionGroup>
28+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
<?xml version="1.0" encoding="UTF-8"?>
3+
<!--
4+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
12+
<test name="ElasticsearchProductCanBeFoundByValueOfSearchableAttributeTest">
13+
<annotations>
14+
<stories value="Elastic Search"/>
15+
<title value="Product can be found by value of 'Searchable' attribute"/>
16+
<description value="Product can be found by value of 'Searchable' attribute"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4086"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<actionGroup ref="ChooseElasticSearchAsSearchEngineActionGroup" stepKey="chooseElasticSearch"/>
24+
<!--Create new searchable product attribute-->
25+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
26+
<actionGroup ref="AdminCreateSearchableProductAttributeActionGroup" stepKey="createAttribute">
27+
<argument name="attribute" value="textProductAttribute"/>
28+
</actionGroup>
29+
<!--Assign attribute to the Default set-->
30+
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
31+
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
32+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
33+
<argument name="group" value="Product Details"/>
34+
<argument name="attribute" value="{{textProductAttribute.attribute_code}}"/>
35+
</actionGroup>
36+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
37+
<!--Create product and fill new attribute field-->
38+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
39+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
40+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
41+
<argument name="product" value="SimpleProduct"/>
42+
</actionGroup>
43+
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm">
44+
<argument name="product" value="SimpleProduct"/>
45+
</actionGroup>
46+
<fillField selector="{{AdminProductFormSection.attributeRequiredInput(textProductAttribute.attribute_code)}}" userInput="searchable" stepKey="fillTheAttributeRequiredInputField"/>
47+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
48+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
49+
<argument name="indices" value=""/>
50+
</actionGroup>
51+
</before>
52+
<after>
53+
<actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid">
54+
<argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/>
55+
</actionGroup>
56+
<actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode">
57+
<argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/>
58+
</actionGroup>
59+
<actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/>
60+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid"/>
61+
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
62+
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/>
63+
<actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProduct"/>
64+
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/>
65+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
66+
<argument name="indices" value=""/>
67+
</actionGroup>
68+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
69+
</after>
70+
71+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/>
72+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForFirstSearchTerm">
73+
<argument name="phrase" value="searchable"/>
74+
</actionGroup>
75+
<see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductName"/>
76+
<!--<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes1"/>-->
77+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid"/>
78+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{textProductAttribute.attribute_code}}" stepKey="fillAttrCodeField" />
79+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
80+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" />
81+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab"/>
82+
<waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitTabLoad"/>
83+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="No" stepKey="setSearchable"/>
84+
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
85+
<!--<actionGroup ref="AdminCreateNonSearchableProductAttributeActionGroup" stepKey="createAttribute1">
86+
<argument name="attribute" value="textProductAttribute"/>
87+
</actionGroup>-->
88+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
89+
<argument name="indices" value=""/>
90+
</actionGroup>
91+
<!--<magentoCLI stepKey="flushCache" command="cache:flush"/>-->
92+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage1"/>
93+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForFirstSearchTerm1">
94+
<argument name="phrase" value="searchable"/>
95+
</actionGroup>
96+
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="dontSeeProductName1"/>
97+
</test>
98+
</tests>

0 commit comments

Comments
 (0)