Skip to content

MFTF: Extract Action Groups to separate files - magento/module-catalog-search #25842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,84 +53,84 @@
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic">
<argument name="phrase" value="Dynamic"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDynamic">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="assertFixedBundleInSearchResultByDynamic">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription">
<argument name="phrase" value="Dynamicscription"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDescription">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByDescription">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription">
<argument name="phrase" value="Dynamictest"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByShortDescription">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByShortDescription">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<!-- 3. Fill quick search bar with test values mutual for both products and click search -->
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123">
<argument name="phrase" value="Test 123"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTest123">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTest123">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321">
<argument name="phrase" value="Testing 321"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTesting321">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTesting321">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555">
<argument name="phrase" value="Short 555"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByShort555">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShort555">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search -->
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed">
<argument name="phrase" value="Fixed"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed">
<argument name="phrase" value="Fixedscription"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByDescriptionForFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicProductByDescriptionForFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed">
<argument name="phrase" value="Fixedtest"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed">
<actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShortDescriptionForFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed">
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
</test>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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="AssertSearchTermNotInGridActionGroup">
<annotations>
<description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
</arguments>

<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/>
<waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/>
<click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
<click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForSearchResultToLoad"/>
<see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Verify AssertSearchTermNotOnFrontend-->
<actionGroup name="AssertSearchTermNotOnFrontend">
<actionGroup name="AssertSearchTermNotOnFrontendActionGroup">
<annotations>
<description>Goes to the Storefront. Fills the Search field with the provided Search Query. Clicks on Search. Validates that there are no results.</description>
</annotations>
Expand All @@ -26,20 +26,4 @@
<waitForPageLoad stepKey="waitForSearch"/>
<see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="Your search returned no results." stepKey="seeAssertSearchTermNotOnFrontendNoticeMessage"/>
</actionGroup>

<actionGroup name="AssertSearchTermOnFrontend">
<annotations>
<description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
<argument name="redirectUrl" type="string"/>
</arguments>

<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
<waitForPageLoad stepKey="waitForFillField"/>
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
<waitForPageLoad stepKey="waitForSearch"/>
<seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="AssertSearchTermOnFrontendActionGroup">
<annotations>
<description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
<argument name="redirectUrl" type="string"/>
</arguments>

<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
<waitForPageLoad stepKey="waitForFillField"/>
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
<waitForPageLoad stepKey="waitForSearch"/>
<seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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="AssertSearchTermSaveSuccessMessageActionGroup">
<annotations>
<description>Goes to the Catalog Search Term grid page. Adds the provided Search Term. Validates that the Success Message is present and correct.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
<argument name="storeValue" type="string"/>
<argument name="redirectUrl" type="string"/>
<argument name="displayInSuggestedTerm" type="string"/>
</arguments>

<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/>
<waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/>
<click selector="{{AdminCatalogSearchTermIndexSection.addNewSearchTermButton}}" stepKey="clickAddNewSearchTermButton"/>
<waitForPageLoad stepKey="waitForAdminCatalogSearchTermNewPageLoad"/>
<fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQueryTextBox"/>
<selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreValue"/>
<fillField selector="{{AdminCatalogSearchTermNewSection.redirectUrl}}" userInput="{{redirectUrl}}" stepKey="fillRedirectUrl"/>
<selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{displayInSuggestedTerm}}" stepKey="selectDisplayInSuggestedTerm"/>
<click selector="{{AdminCatalogSearchTermNewSection.saveSearchButton}}" stepKey="clickSaveSearchButton"/>
<see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="You saved the search term." stepKey="seeSaveSuccessMessage"/>
</actionGroup>
</actionGroups>
Loading