Skip to content

Commit edab7db

Browse files
committed
Refactored Search Actions
1 parent 479f304 commit edab7db

File tree

22 files changed

+243
-117
lines changed

22 files changed

+243
-117
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup">
11+
<annotations>
12+
<description>Validates that the provided Product Name is NOT present on a Storefront page.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productName" type="string"/>
16+
</arguments>
17+
18+
<waitForPageLoad stepKey="waitForTheProductPageToLoad"/>
19+
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{productName}}" stepKey="dontSeeProductName"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,14 @@
129129
<!--Verify Product Attribute present in search page -->
130130
<amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/>
131131
<waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/>
132-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/>
133-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
134-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
135-
<waitForPageLoad stepKey="waitForSearch"/>
136-
<see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/>
132+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute">
133+
<argument name="phrase" value="{{ProductAttributeOption8.value}}"/>
134+
</actionGroup>
135+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
136+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
137+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchResultToLoad"/>
138+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage">
139+
<argument name="productName" value="{{SimpleProduct.name}}"/>
140+
</actionGroup>
137141
</test>
138142
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,15 @@
127127
<!-- Verify customer see created virtual product with custom options suite and import options(from above step) on storefront page and is searchable by sku -->
128128
<amOnPage url="{{StorefrontProductPage.url(virtualProductCustomImportOptions.urlKey)}}" stepKey="goToProductPage"/>
129129
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
130-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductCustomImportOptions.sku}}" stepKey="fillVirtualProductName"/>
131-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
132-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
133-
<waitForPageLoad stepKey="waitForSearch"/>
134-
<see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductCustomImportOptions.name}}" stepKey="seeVirtualProductName"/>
130+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName">
131+
<argument name="phrase" value="{{virtualProductCustomImportOptions.sku}}"/>
132+
</actionGroup>
133+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
134+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
135+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
136+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName">
137+
<argument name="productName" value="{{virtualProductCustomImportOptions.name}}"/>
138+
</actionGroup>
135139
<click selector="{{StorefrontQuickSearchResultsSection.productLink}}" stepKey="openSearchedProduct"/>
136140

137141
<!-- Verify we see created virtual product with custom options suite and import options on the storefront page -->

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,16 @@
105105

106106
<!-- Verify customer see created virtual product with tier price(from above step) on storefront page and is searchable by sku -->
107107
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/>
108-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductBigQty.sku}}" stepKey="fillVirtualProductName"/>
109-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
110-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
111-
<waitForPageLoad stepKey="waitForSearch"/>
112-
<see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductName"/>
108+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName">
109+
<argument name="phrase" value="{{virtualProductBigQty.sku}}"/>
110+
</actionGroup>
111+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
112+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
113+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
114+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName">
115+
<argument name="productName" value="{{virtualProductBigQty.name}}"/>
116+
</actionGroup>
117+
113118
<grabTextFrom selector="{{StorefrontQuickSearchResultsSection.asLowAsLabel}}" stepKey="tierPriceTextOnStorefrontPage"/>
114119
<assertEquals stepKey="assertTierPriceTextOnCategoryPage">
115120
<expectedResult type="string">As low as ${{tierPriceOnVirtualProduct.price}}</expectedResult>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,31 @@
7171
<!--Verify customer see default simple product name on magento storefront page -->
7272
<amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/>
7373
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
74-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/>
75-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
76-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
77-
<waitForPageLoad stepKey="waitForSearch"/>
78-
<see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="$$initialSimpleProduct.name$$" stepKey="seeDefaultProductName"/>
74+
75+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox">
76+
<argument name="phrase" value="$$initialSimpleProduct.sku$$"/>
77+
</actionGroup>
78+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
79+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
80+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
81+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeDefaultProductName">
82+
<argument name="productName" value="$$initialSimpleProduct.name$$"/>
83+
</actionGroup>
7984

8085
<!--Verify customer see simple product with updated name on magento storefront page under store view section -->
8186
<click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/>
8287
<waitForPageLoad stepKey="waitForStoreSwitcherLoad"/>
8388
<click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/>
84-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/>
85-
<waitForPageLoad stepKey="waitForSearchTextBoxLoad"/>
86-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/>
87-
<waitForPageLoad stepKey="waitForTextSearchLoad"/>
88-
<see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDataOverriding.name}}" stepKey="seeUpdatedSimpleProductName"/>
89+
90+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch">
91+
<argument name="phrase" value="$$initialSimpleProduct.sku$$"/>
92+
</actionGroup>
93+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/>
94+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/>
95+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/>
96+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeUpdatedSimpleProductName">
97+
<argument name="productName" value="{{simpleProductDataOverriding.name}}"/>
98+
</actionGroup>
99+
89100
</test>
90101
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,24 @@
6969
<!-- Verify customer see simple product with updated price on magento storefront page -->
7070
<amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/>
7171
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
72-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/>
73-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
74-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
75-
<waitForPageLoad stepKey="waitForSearch"/>
72+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox">
73+
<argument name="phrase" value="$$initialSimpleProduct.sku$$"/>
74+
</actionGroup>
75+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
77+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
7678
<see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPage"/>
7779

7880
<!-- Verify customer see simple product with updated price on magento storefront page under store view section -->
7981
<click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/>
8082
<waitForPageLoad stepKey="waitForStoreSwitcherLoad"/>
8183
<click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/>
82-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/>
83-
<waitForPageLoad stepKey="waitForSearchTextBoxLoad"/>
84-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/>
85-
<waitForPageLoad stepKey="waitForTextSearchLoad"/>
84+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch">
85+
<argument name="phrase" value="$$initialSimpleProduct.sku$$"/>
86+
</actionGroup>
87+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/>
8690
<see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPageUnderStoreViewSection"/>
8791
</test>
8892
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/>
113113
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/>
114114
<see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories"/>
115+
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelectToApplyChanges"/>
115116
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
116117
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
117118
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/>
@@ -143,10 +144,15 @@
143144
<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
144145
<amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
145146
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
146-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductTierPrice300InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/>
147-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
148-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
149-
<waitForPageLoad stepKey="waitForSearch"/>
150-
<see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeProductName"/>
147+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
148+
<argument name="phrase" value="{{simpleProductTierPrice300InStock.sku}}"/>
149+
</actionGroup>
150+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
151+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
152+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
153+
<actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName">
154+
<argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/>
155+
</actionGroup>
156+
151157
</test>
152158
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@
8181
<!--Verify customer don't see updated simple product link on magento storefront page -->
8282
<amOnPage url="{{StorefrontProductPage.url(simpleProductDisabled.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
8383
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
84-
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/>
85-
<waitForPageLoad stepKey="waitForSearchTextBox"/>
86-
<click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
87-
<waitForPageLoad stepKey="waitForSearch"/>
88-
<dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDisabled.name}}" stepKey="dontSeeProductNameOnStorefrontPage"/>
84+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
85+
<argument name="phrase" value="{{simpleProductDisabled.sku}}"/>
86+
</actionGroup>
87+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
90+
<actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage">
91+
<argument name="productName" value="{{simpleProductDisabled.name}}"/>
92+
</actionGroup>
8993
</test>
9094
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest">
11+
<test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead">
1212
<annotations>
1313
<stories value="Update Simple Product"/>
14-
<title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
14+
<title value="DEPRECACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
1515
<description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
1616
<testCaseId value="MC-10818"/>
1717
<severity value="CRITICAL"/>
1818
<group value="catalog"/>
1919
<group value="mtf_migrated"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

0 commit comments

Comments
 (0)