Skip to content

Commit 076c7a8

Browse files
Merge branch 'ACQE-8929' into ACQE-functional-deployment-version19
2 parents d6c82d2 + 83a01e9 commit 076c7a8

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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 and 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+
<actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShippingMethod"/>
26+
<actionGroup ref="AdminEnableFreeShippingToSpecificCountriesActionGroup" stepKey="enableToSpecificCountries"/>
27+
<!-- Enable Flat Rate for Specific Countries = Afghanistan -->
28+
<actionGroup ref="AdminEnableFlatRateToSpecificCountriesActionGroup" stepKey="enableFlatRateToSpecificCountries"/>
29+
</before>
30+
<after>
31+
<!-- Revert Free Shipping and Flat Rate restrictions -->
32+
<actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/>
33+
<actionGroup ref="AdminEnableFreeShippingToAllCountriesActionGroup" stepKey="enableAllCountries"/>
34+
<actionGroup ref="AdminEnableFlatRateToAllCountriesActionGroup" stepKey="selectAllCountries"/>
35+
<!-- Delete product -->
36+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
37+
</after>
38+
<!-- Step 1: Go to Storefront as Guest -->
39+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
40+
<!-- Step 2: Add simple product to cart -->
41+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToProductPage">
42+
<argument name="product" value="$createSimpleProduct$"/>
43+
</actionGroup>
44+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
45+
<argument name="productName" value="$createSimpleProduct.name$"/>
46+
<argument name="productQty" value="1"/>
47+
</actionGroup>
48+
<!-- Step 3: Go to checkout -->
49+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShipping"/>
50+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuoteMessage"/>
51+
<!-- Assert Next button -->
52+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextBtn"/>
53+
<!-- Step 4: Fill form with valid data and set: -->
54+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillBaseShippingAddress"/>
55+
<!-- Assert no quotes message -->
56+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMessage"/>
57+
<!-- Assert Next button -->
58+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextButton"/>
59+
<!-- Step 5: Change values for: Afghanistan -->
60+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="selectCountryAfghanistan"/>
61+
<!-- Assert only Free Shipping and Flat Rate are available -->
62+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFlatRate"/>
63+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFreeShipping">
64+
<argument name="shippingMethodName" value="Free Shipping"/>
65+
</actionGroup>
66+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="seeNextButton"/>
67+
</test>
68+
</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)