Skip to content

Commit 79481f5

Browse files
committed
Replace repetitive actions with Action groups
1 parent 32fda1c commit 79481f5

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,32 @@
4646
</after>
4747

4848
<!-- Verify price is not discounted on category page -->
49-
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openCategoryPageOnFrontend"/>
50-
<waitForPageLoad stepKey="waitForCategoryPageLoaded"/>
51-
<see selector="{{StorefrontCategoryProductSection.ProductPriceByNumber('1')}}" userInput="$$createProduct.price$$" stepKey="seeProductPriceOnCategoryPage"/>
49+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPageOnFrontend">
50+
<argument name="category" value="$$createCategory$$"/>
51+
</actionGroup>
52+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoaded"/>
53+
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProductPriceOnCategoryPage">
54+
<argument name="productName" value="$$createProduct.name$$"/>
55+
<argument name="productPrice" value="$$createProduct.price$$"/>
56+
</actionGroup>
5257

5358
<!-- Verify price is not discounted on the product page -->
54-
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openProductPageOnFrontend"/>
55-
<waitForPageLoad stepKey="waitForProductPageLoaded"/>
56-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$createProduct.price$" stepKey="seePriceOnProductPage"/>
59+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPageOnFrontend">
60+
<argument name="product" value="$createProduct$"/>
61+
</actionGroup>
62+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductPageLoaded"/>
63+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seePriceOnProductPage">
64+
<argument name="productPrice" value="$createProduct.price$"/>
65+
</actionGroup>
5766

5867
<!-- Verify price is not discounted in the cart -->
5968
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
6069
<argument name="productName" value="$createProduct.name$"/>
6170
</actionGroup>
6271
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCartPage" />
6372
<waitForElementVisible selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="waitForSubtotalAppears"/>
64-
<see selector="{{CheckoutCartSummarySection.subtotal}}" userInput="$createProduct.price$" stepKey="seeProductPriceOnCartPage"/>
73+
<actionGroup ref="AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup" stepKey="seeProductPriceOnCartPage">
74+
<argument name="orderSubtotal" value="$createProduct.price$"/>
75+
</actionGroup>
6576
</test>
6677
</tests>

0 commit comments

Comments
 (0)