Skip to content

Commit 89e17c7

Browse files
ENGCOM-8536: [MFTF] Refactoring of AdminUpdateSimpleProduct...Tests (asserting product details on Storefront) #31247
- Merge Pull Request #31247 from AnnaAPak/magento2:ref-assertion-product-details-storefront - Merged commits: 1. 701a96a 2. 40cf39e 3. ed00875 4. 8ae0c79 5. 791d006 6. 9366f35
2 parents 3fef6d1 + 9366f35 commit 89e17c7

6 files changed

+127
-91
lines changed

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

+22-16
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="fillSimpleProductWeight"/>
6969
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="selectProductWeight"/>
7070
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
71-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" />
71+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/>
7272
<waitForPageLoad stepKey="waitForCategory1"/>
7373
<click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/>
74-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" />
74+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
7575
<waitForPageLoad stepKey="waitForCategory2"/>
7676
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
7777
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
@@ -123,23 +123,29 @@
123123
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
124124

125125
<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
126-
<amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToProductPage"/>
127-
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
128-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
129-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductTierPrice300InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
126+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
127+
<argument name="productUrlKey" value="{{simpleProductTierPrice300InStock.urlKey}}"/>
128+
</actionGroup>
129+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>
130+
131+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
132+
<argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/>
133+
</actionGroup>
134+
135+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
136+
<argument name="productPrice" value="{{simpleProductTierPrice300InStock.price}}"/>
137+
</actionGroup>
138+
130139
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
131140
<argument name="productSku" value="{{simpleProductTierPrice300InStock.sku}}"/>
132141
</actionGroup>
133-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
134-
<assertEquals stepKey="assertStockAvailableOnProductPage">
135-
<expectedResult type="string">{{simpleProductTierPrice300InStock.storefrontStatus}}</expectedResult>
136-
<actualResult type="variable">productStockAvailableStatus</actualResult>
137-
</assertEquals>
138-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
139-
<assertEquals stepKey="assertOldPriceTextOnProductPage">
140-
<expectedResult type="string">${{simpleProductTierPrice300InStock.price}}</expectedResult>
141-
<actualResult type="variable">productPriceAmount</actualResult>
142-
</assertEquals>
142+
143+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
144+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
145+
<argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/>
146+
</actionGroup>
147+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
148+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>
143149

144150
<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
145151
<amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>

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

+22-16
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="selectStockStatusInStock"/>
5252
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="fillSimpleProductWeight"/>
5353
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
54-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" />
54+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/>
5555
<waitForPageLoad stepKey="waitForCategory1"/>
5656
<click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/>
57-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" />
57+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
5858
<waitForPageLoad stepKey="waitForCategory2"/>
5959
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
6060
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
@@ -103,23 +103,29 @@
103103
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
104104

105105
<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
106-
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToProductPage"/>
107-
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
108-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
109-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice245InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
106+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
107+
<argument name="productUrlKey" value="{{simpleProductRegularPrice245InStock.urlKey}}"/>
108+
</actionGroup>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>
110+
111+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
112+
<argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/>
113+
</actionGroup>
114+
115+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
116+
<argument name="productPrice" value="{{simpleProductRegularPrice245InStock.price}}"/>
117+
</actionGroup>
118+
110119
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage">
111120
<argument name="productSku" value="{{simpleProductRegularPrice245InStock.sku}}"/>
112121
</actionGroup>
113-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
114-
<assertEquals stepKey="assertStockAvailableOnProductPage">
115-
<expectedResult type="string">{{simpleProductRegularPrice245InStock.storefrontStatus}}</expectedResult>
116-
<actualResult type="variable">productStockAvailableStatus</actualResult>
117-
</assertEquals>
118-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
119-
<assertEquals stepKey="assertOldPriceTextOnProductPage">
120-
<expectedResult type="string">${{simpleProductRegularPrice245InStock.price}}</expectedResult>
121-
<actualResult type="variable">productPriceAmount</actualResult>
122-
</assertEquals>
122+
123+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
124+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
125+
<argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/>
126+
</actionGroup>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
128+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>
123129

124130
<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
125131
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>

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

+20-14
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,29 @@
103103
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
104104

105105
<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
106-
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToProductPage"/>
107-
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
108-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
109-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
106+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
107+
<argument name="productUrlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/>
108+
</actionGroup>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>
110+
111+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
112+
<argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/>
113+
</actionGroup>
114+
115+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
116+
<argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/>
117+
</actionGroup>
118+
110119
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
111120
<argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/>
112121
</actionGroup>
113-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
114-
<assertEquals stepKey="assertStockAvailableOnProductPage">
115-
<expectedResult type="string">{{simpleProductRegularPrice32501InStock.storefrontStatus}}</expectedResult>
116-
<actualResult type="variable">productStockAvailableStatus</actualResult>
117-
</assertEquals>
118-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
119-
<assertEquals stepKey="assertOldPriceTextOnProductPage">
120-
<expectedResult type="string">${{simpleProductRegularPrice32501InStock.price}}</expectedResult>
121-
<actualResult type="variable">productPriceAmount</actualResult>
122-
</assertEquals>
122+
123+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
124+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
125+
<argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/>
126+
</actionGroup>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
128+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>
123129

124130
<!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku -->
125131
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>

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

+22-16
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="selectStockStatusInStock"/>
5252
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="fillSimpleProductWeight"/>
5353
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
54-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" />
54+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/>
5555
<waitForPageLoad stepKey="waitForCategory1"/>
5656
<click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/>
57-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" />
57+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
5858
<waitForPageLoad stepKey="waitForCategory2"/>
5959
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
6060
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
@@ -101,23 +101,29 @@
101101
<dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/>
102102

103103
<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
104-
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToProductPage"/>
105-
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
106-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
107-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice325InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
104+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
105+
<argument name="productUrlKey" value="{{simpleProductRegularPrice325InStock.urlKey}}"/>
106+
</actionGroup>
107+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>
108+
109+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
110+
<argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/>
111+
</actionGroup>
112+
113+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
114+
<argument name="productPrice" value="{{simpleProductRegularPrice325InStock.price}}"/>
115+
</actionGroup>
116+
108117
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
109118
<argument name="productSku" value="{{simpleProductRegularPrice325InStock.sku}}"/>
110119
</actionGroup>
111-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
112-
<assertEquals stepKey="assertStockAvailableOnProductPage">
113-
<expectedResult type="string">{{simpleProductRegularPrice325InStock.storefrontStatus}}</expectedResult>
114-
<actualResult type="variable">productStockAvailableStatus</actualResult>
115-
</assertEquals>
116-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
117-
<assertEquals stepKey="assertOldPriceTextOnProductPage">
118-
<expectedResult type="string">${{simpleProductRegularPrice325InStock.price}}</expectedResult>
119-
<actualResult type="variable">productPriceAmount</actualResult>
120-
</assertEquals>
120+
121+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
122+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
123+
<argument name="productStockStatus" value="{{simpleProductRegularPrice325InStock.storefrontStatus}}"/>
124+
</actionGroup>
125+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
126+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>
121127

122128
<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
123129
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>

0 commit comments

Comments
 (0)