Skip to content

Commit 3788230

Browse files
ENGCOM-8536: [MFTF] Refactoring of AdminUpdateSimpleProduct...Tests (asserting product details on Storefront) #31247
2 parents 310a6ab + 89e17c7 commit 3788230

6 files changed

+127
-91
lines changed

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

Lines changed: 22 additions & 16 deletions
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"/>
@@ -122,23 +122,29 @@
122122
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
123123

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

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

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

Lines changed: 22 additions & 16 deletions
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"/>
@@ -102,23 +102,29 @@
102102
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
103103

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

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

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,29 @@
102102
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
103103

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

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

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

Lines changed: 22 additions & 16 deletions
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"/>
@@ -100,23 +100,29 @@
100100
<dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/>
101101

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

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

0 commit comments

Comments
 (0)