Skip to content

Commit 83a01e9

Browse files
committed
ACQE-8929: Checkout flow if shipping rates are not available
- Corrected stepkey in test file
1 parent 0438d7b commit 83a01e9

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutFlatAndFreeShippingForAfghanistanTest.xml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<features value="Checkout"/>
1414
<stories value="Checkout for Afghanistan Countries"/>
1515
<title value="Storefront guest checkout for Afghanistan countries with flat rate and free shipping"/>
16-
<description value="Checkout flow if flat rate anf free shipping method are disabled for all countries except Afghanistan"/>
16+
<description value="Checkout flow if flat rate and free shipping method are disabled for all countries except Afghanistan"/>
1717
<severity value="AVERAGE"/>
1818
<testCaseId value="AC-7617"/>
1919
<group value="checkout"/>
@@ -22,35 +22,26 @@
2222
<!-- Precondition Step 1: Create simple product -->
2323
<createData entity="_defaultProduct" stepKey="createSimpleProduct"/>
2424
<!-- Precondition Step 2: Enable Free Shipping for Specific Countries = Afghanistan -->
25-
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
26-
<magentoCLI command="config:set {{EnableFreeShippingToSpecificCountriesConfigData.path}} {{EnableFreeShippingToSpecificCountriesConfigData.value}}" stepKey="limitFreeShippingToSpecificCountries"/>
27-
<magentoCLI command="config:set {{EnableFreeShippingToAfghanistanConfigData.path}} {{EnableFreeShippingToAfghanistanConfigData.value}}" stepKey="setFreeShippingSpecificCountryAF"/>
25+
<actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShippingMethod"/>
26+
<actionGroup ref="AdminEnableFreeShippingToSpecificCountriesActionGroup" stepKey="enableToSpecificCountries"/>
2827
<!-- Enable Flat Rate for Specific Countries = Afghanistan -->
29-
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
30-
<magentoCLI command="config:set {{EnableFlatRateToSpecificCountriesConfigData.path}} {{EnableFlatRateToSpecificCountriesConfigData.value}}" stepKey="limitFlatRateToSpecificCountries"/>
31-
<magentoCLI command="config:set {{EnableFlatRateToAfghanistanConfigData.path}} {{EnableFlatRateToAfghanistanConfigData.value}}" stepKey="setFlatRateSpecificCountryAF"/>
32-
<!-- Precondition Step 3: Disable all other carriers -->
33-
<magentoCLI command="config:set {{AdminDisableUPSConfigData.path}} {{AdminDisableUPSConfigData.value}}" stepKey="disableUPSCarrier"/>
34-
<magentoCLI command="config:set {{AdminDisableUSPSConfigData.path}} {{AdminDisableUSPSConfigData.value}}" stepKey="disableUSPSCarrier"/>
35-
<magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableFedExCarrier"/>
36-
<magentoCLI command="config:set {{AdminDHLDisableConfigData.path}} {{AdminDHLDisableConfigData.value}}" stepKey="disableDHLCarrier"/>
28+
<actionGroup ref="AdminEnableFlatRateToSpecificCountriesActionGroup" stepKey="enableFlatRateToSpecificCountries"/>
3729
</before>
3830
<after>
3931
<!-- Revert Free Shipping and Flat Rate restrictions -->
40-
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
41-
<magentoCLI command="config:set {{EnableFreeShippingToAllAllowedCountriesConfigData.path}} {{EnableFreeShippingToAllAllowedCountriesConfigData.value}}" stepKey="freeShippingAllCountries"/>
42-
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
43-
<magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="flatRateAllCountries"/>
32+
<actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/>
33+
<actionGroup ref="AdminEnableFreeShippingToAllCountriesActionGroup" stepKey="enableAllCountries"/>
34+
<actionGroup ref="AdminEnableFlatRateToAllCountriesActionGroup" stepKey="selectAllCountries"/>
4435
<!-- Delete product -->
4536
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
4637
</after>
4738
<!-- Step 1: Go to Storefront as Guest -->
4839
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
4940
<!-- Step 2: Add simple product to cart -->
50-
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToSimple2ProductPage">
41+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToProductPage">
5142
<argument name="product" value="$createSimpleProduct$"/>
5243
</actionGroup>
53-
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addSimple2ToCart">
44+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
5445
<argument name="productName" value="$createSimpleProduct.name$"/>
5546
<argument name="productQty" value="1"/>
5647
</actionGroup>
@@ -72,6 +63,6 @@
7263
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFreeShipping">
7364
<argument name="shippingMethodName" value="Free Shipping"/>
7465
</actionGroup>
75-
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="sSeeNextButton"/>
66+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="seeNextButton"/>
7667
</test>
7768
</tests>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEnableFlatRateToAllCountriesActionGroup">
12+
<annotations>
13+
<description>Admin Enable Flat Rate To All Countries on configuration papge.</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="flatRateAllCountries"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEnableFlatRateToSpecificCountriesActionGroup">
12+
<annotations>
13+
<description>Admin Enable Flat rate To Specific Countries on configuration papge.</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
16+
<magentoCLI command="config:set {{EnableFlatRateToSpecificCountriesConfigData.path}} {{EnableFlatRateToSpecificCountriesConfigData.value}}" stepKey="limitFlatRateToSpecificCountries"/>
17+
<magentoCLI command="config:set {{EnableFlatRateToAfghanistanConfigData.path}} {{EnableFlatRateToAfghanistanConfigData.value}}" stepKey="setFlatRateSpecificCountryAF"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)