Skip to content

Commit 0438d7b

Browse files
committed
ACQE-8929: Checkout flow if shipping rates are not available
- New automation test file has been added
1 parent 297b774 commit 0438d7b

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontGuestCheckoutFlatAndFreeShippingForAfghanistanTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Checkout for Afghanistan Countries"/>
15+
<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"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-7617"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Precondition Step 1: Create simple product -->
23+
<createData entity="_defaultProduct" stepKey="createSimpleProduct"/>
24+
<!-- 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"/>
28+
<!-- 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"/>
37+
</before>
38+
<after>
39+
<!-- 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"/>
44+
<!-- Delete product -->
45+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
46+
</after>
47+
<!-- Step 1: Go to Storefront as Guest -->
48+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
49+
<!-- Step 2: Add simple product to cart -->
50+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToSimple2ProductPage">
51+
<argument name="product" value="$createSimpleProduct$"/>
52+
</actionGroup>
53+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addSimple2ToCart">
54+
<argument name="productName" value="$createSimpleProduct.name$"/>
55+
<argument name="productQty" value="1"/>
56+
</actionGroup>
57+
<!-- Step 3: Go to checkout -->
58+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShipping"/>
59+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuoteMessage"/>
60+
<!-- Assert Next button -->
61+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextBtn"/>
62+
<!-- Step 4: Fill form with valid data and set: -->
63+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillBaseShippingAddress"/>
64+
<!-- Assert no quotes message -->
65+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMessage"/>
66+
<!-- Assert Next button -->
67+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextButton"/>
68+
<!-- Step 5: Change values for: Afghanistan -->
69+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="selectCountryAfghanistan"/>
70+
<!-- Assert only Free Shipping and Flat Rate are available -->
71+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFlatRate"/>
72+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFreeShipping">
73+
<argument name="shippingMethodName" value="Free Shipping"/>
74+
</actionGroup>
75+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="sSeeNextButton"/>
76+
</test>
77+
</tests>

0 commit comments

Comments
 (0)