|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 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="StorefrontGuestCheckoutForSpecificCountriesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="One Page Checkout"/> |
| 14 | + <stories value="Checkout for Specific Countries"/> |
| 15 | + <title value="Storefront guest checkout for specific countries test"/> |
| 16 | + <description value="Checkout flow if shipping rates are not available"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-13414"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create simple product --> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 24 | + |
| 25 | + <!-- Enable free shipping to specific country - Afghanistan --> |
| 26 | + <magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/> |
| 27 | + <magentoCLI command="config:set {{EnableFreeShippingToSpecificCountriesConfigData.path}} {{EnableFreeShippingToSpecificCountriesConfigData.value}}" stepKey="allowFreeShippingSpecificCountries"/> |
| 28 | + <magentoCLI command="config:set {{EnableFreeShippingToAfghanistanConfigData.path}} {{EnableFreeShippingToAfghanistanConfigData.value}}" stepKey="enableFreeShippingToAfghanistan"/> |
| 29 | + |
| 30 | + <!-- Enable flat rate shipping to specific country - Afghanistan --> |
| 31 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 32 | + <magentoCLI command="config:set {{EnableFlatRateToSpecificCountriesConfigData.path}} {{EnableFlatRateToSpecificCountriesConfigData.value}}" stepKey="allowFlatRateSpecificCountries"/> |
| 33 | + <magentoCLI command="config:set {{EnableFlatRateToAfghanistanConfigData.path}} {{EnableFlatRateToAfghanistanConfigData.value}}" stepKey="enableFlatRateToAfghanistan"/> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <!-- Rollback all configurations --> |
| 37 | + <magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/> |
| 38 | + <magentoCLI command="config:set {{EnableFreeShippingToAllAllowedCountriesConfigData.path}} {{EnableFreeShippingToAllAllowedCountriesConfigData.value}}" stepKey="allowFreeShippingToAllCountries"/> |
| 39 | + <magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="allowFlatRateToAllCountries"/> |
| 40 | + |
| 41 | + <!-- Delete product --> |
| 42 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 43 | + </after> |
| 44 | + |
| 45 | + <!-- Add product to cart --> |
| 46 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 47 | + <argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 48 | + </actionGroup> |
| 49 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 50 | + <argument name="product" value="$$createProduct$$"/> |
| 51 | + <argument name="productCount" value="1"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <!-- Go to checkout page --> |
| 55 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/> |
| 56 | + |
| 57 | + <!-- Assert shipping methods are unavailable --> |
| 58 | + <actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontSeeFlatRateShippingMethod"> |
| 59 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontFreeShippingMethod"/> |
| 62 | + |
| 63 | + <!-- Assert no quotes message --> |
| 64 | + <actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMessage"/> |
| 65 | + |
| 66 | + <!-- Assert Next button --> |
| 67 | + <dontSeeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextButton"/> |
| 68 | + |
| 69 | + <!-- Fill form with valid data for US > California --> |
| 70 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{US_Address_CA.country}}" stepKey="selectCountry"/> |
| 71 | + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{US_Address_CA.state}}" stepKey="selectState"/> |
| 72 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{US_Address_CA.postcode}}" stepKey="fillPostcode"/> |
| 73 | + |
| 74 | + <!-- Assert shipping methods are unavailable for US > California --> |
| 75 | + <actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontSeeFlatRateShippingMtd"> |
| 76 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontFreeShippingMtd"/> |
| 79 | + |
| 80 | + <!-- Assert no quotes message for US > California --> |
| 81 | + <actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMsg"/> |
| 82 | + |
| 83 | + <!-- Assert Next button for US > California --> |
| 84 | + <dontSeeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextBtn"/> |
| 85 | + |
| 86 | + <!-- Fill form for specific country - Afghanistan --> |
| 87 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="selectSpecificCountry"/> |
| 88 | + |
| 89 | + <!-- Assert shipping methods are available --> |
| 90 | + <actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFlatRateShippingMethod"/> |
| 91 | + <actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFreeShippingMethod"> |
| 92 | + <argument name="shippingMethodName" value="Free Shipping"/> |
| 93 | + </actionGroup> |
| 94 | + |
| 95 | + <!-- Assert Next button is available --> |
| 96 | + <seeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="seeNextButton"/> |
| 97 | + </test> |
| 98 | +</tests> |
0 commit comments