|
| 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="StorefrontCheckoutForShowShippingMethodNoApplicableTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Checkout for not applicable shipping method"/> |
| 14 | + <title value="Storefront checkout for not applicable shipping method test"/> |
| 15 | + <description value="Checkout flow if shipping rates are not applicable"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <testCaseId value="MC-37420"/> |
| 18 | + <group value="checkout"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Create simple product --> |
| 22 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 23 | + <!-- Enable flat rate shipping to specific country - Afghanistan --> |
| 24 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 25 | + <magentoCLI command="config:set {{EnableFlatRateToSpecificCountriesConfigData.path}} {{EnableFlatRateToSpecificCountriesConfigData.value}}" stepKey="allowFlatRateSpecificCountries"/> |
| 26 | + <magentoCLI command="config:set {{EnableFlatRateToAfghanistanConfigData.path}} {{EnableFlatRateToAfghanistanConfigData.value}}" stepKey="enableFlatRateToAfghanistan"/> |
| 27 | + <!-- Enable Show Method if Not Applicable--> |
| 28 | + <magentoCLI command="config:set {{EnableFlatRateShowMethodNoApplicableConfigData.path}} {{EnableFlatRateShowMethodNoApplicableConfigData.value}}" stepKey="enableShowMethodNoApplicable"/> |
| 29 | + <!-- Create Customer with filled Shipping & Billing Address --> |
| 30 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/> |
| 34 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 35 | + <magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="allowFlatRateToAllCountries"/> |
| 36 | + <magentoCLI command="config:set {{EnableFlatRateShowMethodNoApplicableConfigData.path}} 0" stepKey="disableShowMethodNoApplicable"/> |
| 37 | + <!-- Delete product --> |
| 38 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 39 | + </after> |
| 40 | + <!-- Login with created Customer --> |
| 41 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 42 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 43 | + </actionGroup> |
| 44 | + <!-- Add product to cart --> |
| 45 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 46 | + <argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 49 | + <argument name="product" value="$$createProduct$$"/> |
| 50 | + <argument name="productCount" value="1"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Go to checkout page --> |
| 53 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/> |
| 54 | + <!-- Assert shipping price for US > California --> |
| 55 | + <dontSeeElement selector="{{CheckoutShippingMethodsSection.price}}" stepKey="dontSeePrice"/> |
| 56 | + <!-- Assert Next button is available --> |
| 57 | + <seeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="seeNextButton"/> |
| 58 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNextButton"/> |
| 59 | + <!-- Assert order cannot be placed and error message will shown. --> |
| 60 | + <waitForPageLoad stepKey="waitForError"/> |
| 61 | + <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> |
| 62 | + </test> |
| 63 | +</tests> |
0 commit comments