Skip to content

Commit 7dd7cbd

Browse files
[ACQE-7512] StorefrontAssertAvailableShippingRateIsChangedBasedOnInputedDataTest
added assertion for fedex methods name and price
1 parent 4e99810 commit 7dd7cbd

File tree

2 files changed

+51
-9
lines changed

2 files changed

+51
-9
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontVerifyFedexShippingMethodPricesActionGroup.xml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->
@@ -22,12 +22,47 @@
2222
<argument name="priorityOvernightPrice" type="string" defaultValue="$100.37"/>
2323
</arguments>
2424
<waitForPageLoad stepKey="waitForPageLoad2" />
25-
<waitForText selector="{{CheckoutShippingMethodsSection.smartPostFedexPrice}}" userInput="{{smartPostPrice}}" stepKey="waitForSmartPostPriceVisible"/>
26-
<waitForText selector="{{CheckoutShippingMethodsSection.groundFedexPrice}}" userInput="{{groundPrice}}" stepKey="waitForGroundPriceVisible"/>
27-
<waitForText selector="{{CheckoutShippingMethodsSection.expressSaverFedexPrice}}" userInput="{{expressSaverPrice}}" stepKey="waitForExpressPriceVisible"/>
28-
<waitForText selector="{{CheckoutShippingMethodsSection.twoDayFedexPrice}}" userInput="{{twoDayPrice}}" stepKey="waitForTwodayPriceVisible"/>
29-
<waitForText selector="{{CheckoutShippingMethodsSection.twoDayAMFedexPrice}}" userInput="{{twoDayAMPrice}}" stepKey="waitForTwodayAMPriceVisible"/>
30-
<waitForText selector="{{CheckoutShippingMethodsSection.standardOvernightFedexPrice}}" userInput="{{standardOvernightPrice}}" stepKey="waitForStandardPriceVisible"/>
31-
<waitForText selector="{{CheckoutShippingMethodsSection.priorityOvernightFedexPrice}}" userInput="{{priorityOvernightPrice}}" stepKey="waitForOvernightPriceVisible"/>
25+
<waitForElement selector="{{CheckoutShippingMethodsSection.smartPostFedexMethod}}" stepKey="waitForSmartPostFedexMethod"/>
26+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.smartPostFedexPrice}}" stepKey="smartPostPrice"/>
27+
<assertRegExp stepKey="waitForSmartPostPriceVisible">
28+
<actualResult type="variable">$smartPostPrice</actualResult>
29+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
30+
</assertRegExp>
31+
<waitForElement selector="{{CheckoutShippingMethodsSection.groundFedexMethod}}" stepKey="waitForGroundFedexMethod"/>
32+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.groundFedexPrice}}" stepKey="groundFedexPrice"/>
33+
<assertRegExp stepKey="waitForGroundPriceVisible">
34+
<actualResult type="variable">$groundFedexPrice</actualResult>
35+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
36+
</assertRegExp>
37+
<waitForElement selector="{{CheckoutShippingMethodsSection.expressSaverFedexPrice}}" stepKey="waitForExpressSaverFedexMethod"/>
38+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.expressSaverFedexPrice}}" stepKey="expressSaverFedexPrice"/>
39+
<assertRegExp stepKey="waitForExpressPriceVisible">
40+
<actualResult type="variable">$expressSaverFedexPrice</actualResult>
41+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
42+
</assertRegExp>
43+
<waitForElement selector="{{CheckoutShippingMethodsSection.twoDayFedexMethod}}" stepKey="waitForRwoDayFedexMethod"/>
44+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.twoDayFedexPrice}}" stepKey="twoDayFedexPrice"/>
45+
<assertRegExp stepKey="waitForTwodayPriceVisible">
46+
<actualResult type="variable">$twoDayFedexPrice</actualResult>
47+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
48+
</assertRegExp>
49+
<waitForElement selector="{{CheckoutShippingMethodsSection.twoDayAMFedexMethod}}" stepKey="waitForTwoDayAMFedexMethod"/>
50+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.twoDayAMFedexPrice}}" stepKey="twoDayAMFedexPrice"/>
51+
<assertRegExp stepKey="waitForTwodayAMPriceVisible">
52+
<actualResult type="variable">$twoDayAMFedexPrice</actualResult>
53+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
54+
</assertRegExp>
55+
<waitForElement selector="{{CheckoutShippingMethodsSection.standardOvernightFedexMethod}}" stepKey="waitForStandardOvernightFedexMethod"/>
56+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.standardOvernightFedexPrice}}" stepKey="standardOvernightFedexPrice"/>
57+
<assertRegExp stepKey="waitForStandardPriceVisible">
58+
<actualResult type="variable">$standardOvernightFedexPrice</actualResult>
59+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
60+
</assertRegExp>
61+
<waitForElement selector="{{CheckoutShippingMethodsSection.priorityOvernightFedexMethod}}" stepKey="waitForPriorityOvernightFedexMethod"/>
62+
<grabTextFrom selector="{{CheckoutShippingMethodsSection.priorityOvernightFedexPrice}}" stepKey="priorityOvernightFedexPrice"/>
63+
<assertRegExp stepKey="waitForOvernightPriceVisible">
64+
<actualResult type="variable">$priorityOvernightFedexPrice</actualResult>
65+
<expectedResult type="string">\$([0-9]+(\.[0-9]+)?)$</expectedResult>
66+
</assertRegExp>
3267
</actionGroup>
3368
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->
@@ -46,5 +46,12 @@
4646
<element name="twoDayAMFedexPrice" type="text" selector="//tr[td[@id='label_method_FEDEX_2_DAY_AM_fedex']]//td[contains(@class, 'col-price')]//span[contains(@class, 'price') and contains(@data-bind, 'price_excl_tax')]"/>
4747
<element name="standardOvernightFedexPrice" type="text" selector="//tr[td[@id='label_method_STANDARD_OVERNIGHT_fedex']]//td[contains(@class, 'col-price')]//span[contains(@class, 'price') and contains(@data-bind, 'price_excl_tax')]"/>
4848
<element name="priorityOvernightFedexPrice" type="text" selector="//tr[td[@id='label_method_PRIORITY_OVERNIGHT_fedex']]//td[contains(@class, 'col-price')]//span[contains(@class, 'price') and contains(@data-bind, 'price_excl_tax')]"/>
49+
<element name="smartPostFedexMethod" type="text" selector="//tr[td[@id='label_carrier_SMART_POST_fedex']]//td[contains(@class, 'col-method') and contains(text(), 'Smart Post')]"/>
50+
<element name="groundFedexMethod" type="text" selector="//tr[td[@id='label_method_FEDEX_GROUND_fedex']]//td[contains(@class, 'col-method') and contains(text(), 'Ground')]"/>
51+
<element name="expressSaverFedexMethod" type="text" selector="//tr[td[@id='label_method_FEDEX_EXPRESS_SAVER_fedex']]//td[contains(@class, 'col-method') and contains(text(), 'Express Saver')]"/>
52+
<element name="twoDayFedexMethod" type="text" selector="//tr[td[@id='label_method_FEDEX_2_DAY_fedex']]//td[contains(@class, 'col-method') and contains(text(), '2 Day')]"/>
53+
<element name="twoDayAMFedexMethod" type="text" selector="//tr[td[@id='label_method_FEDEX_2_DAY_AM_fedex']]//td[contains(@class, 'col-method') and contains(text(), '2 Day AM')]"/>
54+
<element name="standardOvernightFedexMethod" type="text" selector="//tr[td[@id='label_method_STANDARD_OVERNIGHT_fedex']]//td[contains(@class, 'col-method') and contains(text(), 'Standard Overnight')]"/>
55+
<element name="priorityOvernightFedexMethod" type="text" selector="//tr[td[@id='label_method_PRIORITY_OVERNIGHT_fedex']]//td[contains(@class, 'col-method') and contains(text(), 'Priority Overnight')]"/>
4956
</section>
5057
</sections>

0 commit comments

Comments
 (0)