diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Section/AdminCatalogSearchTermNewSection.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Section/AdminCatalogSearchTermNewSection.xml index a7d577a7508c0..a07e2a9b8a547 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Section/AdminCatalogSearchTermNewSection.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Section/AdminCatalogSearchTermNewSection.xml @@ -9,8 +9,10 @@
- - + + + + diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml new file mode 100644 index 0000000000000..3ebb09f3c9c26 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -0,0 +1,72 @@ + + + + + + + + + <description value="You should see the updated Search Term on the Storefront via the Admin."/> + <testCaseId value="MC-13987"/> + <severity value="CRITICAL"/> + <group value="search"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="_defaultCategory" stepKey="createCategory1"/> + <createData entity="SimpleProduct" stepKey="createProduct1"> + <requiredEntity createDataKey="createCategory1"/> + </createData> + + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage1"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logoutOfAdmin1"/> + + <deleteData createDataKey="createProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/> + </after> + + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName1"> + <argument name="phrase" value="$$createProduct1.name$$"/> + </actionGroup> + + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage1"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + + <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery1"> + <argument name="searchQuery" value="$$createProduct1.name$$"/> + </actionGroup> + + <click selector="{{AdminGridRow.editByValue($$createProduct1.name$$)}}" stepKey="clickOnSearchResult1"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + + <actionGroup ref="AdminFillAllSearchTermFieldsActionGroup" stepKey="searchForSearchTerm1"> + <argument name="searchTerm" value="UpdatedSearchTermData1"/> + </actionGroup> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage2"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + + <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery2"> + <argument name="searchQuery" value="{{UpdatedSearchTermData1.query_text}}"/> + </actionGroup> + + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage2"/> + <waitForPageLoad stepKey="waitForPageLoad4"/> + + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName2"> + <argument name="phrase" value="{{UpdatedSearchTermData1.query_text}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminEditSearchTermActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminEditSearchTermActionGroup.xml new file mode 100644 index 0000000000000..de330bb24a2e6 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminEditSearchTermActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillAllSearchTermFieldsActionGroup"> + <arguments> + <argument name="searchTerm" type="entity"/> + </arguments> + + <fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchTerm.query_text}}" stepKey="fillSearchQuery1"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{searchTerm.store_id}}" stepKey="selectStore1"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.numberOfResults}}" userInput="{{searchTerm.number_of_results}}" stepKey="fillNumberOfResults1"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.numberOfUses}}" userInput="{{searchTerm.number_of_uses}}" stepKey="fillNumberOfUses1"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{searchTerm.display_in_suggested_term}}" stepKey="selectDisplayInSuggestedTerms1"/> + + <click selector="{{AdminConfigSection.saveButton}}" stepKey="clickOnSaveButton1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/Data/SearchTermData.xml b/app/code/Magento/Search/Test/Mftf/Data/SearchTermData.xml index 1518adad01347..8263ff996318e 100644 --- a/app/code/Magento/Search/Test/Mftf/Data/SearchTermData.xml +++ b/app/code/Magento/Search/Test/Mftf/Data/SearchTermData.xml @@ -14,4 +14,12 @@ <data key="redirect" unique="suffix">http://example.com/</data> <data key="display_in_terms">0</data> </entity> + <entity name="UpdatedSearchTermData1" type="searchTerm"> + <data key="query_text" unique="suffix">UpdatedSearchTerm</data> + <data key="store_id">Default Store View</data> + <data key="number_of_results">1</data> + <data key="number_of_uses">20</data> + <data key="redirect_url">http://example.com</data> + <data key="display_in_suggested_term">No</data> + </entity> </entities> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml index 922973dbf316a..2ce4bbaa8a6d2 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml @@ -14,6 +14,7 @@ <data name="searchTerm/data/popularity" xsi:type="string">20</data> <data name="searchTerm/data/redirect" xsi:type="string">http://example.com/</data> <data name="searchTerm/data/display_in_terms" xsi:type="string">No</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessSaveMessage" /> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermForm" /> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermInGrid" />