|
| 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> |
0 commit comments