|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StoreFrontValidateDynamicChangeOfShippingRateForGuestUserTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Checkout"/> |
| 13 | + <stories value="Shipping rate in Guest Checkout"/> |
| 14 | + <title value="Available shipping rate is changed on fly according to inputed data"/> |
| 15 | + <description value="Should be able to change the shipping rate while changing the input data based on the specific country and zipcode."/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-6139"/> |
| 18 | + <group value="pr_exclude"/> |
| 19 | + <group value="3rd_party_integration"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 23 | + <!-- Creating subcategory --> |
| 24 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 25 | + <!-- Creating Simple Product --> |
| 26 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <!-- Go to Store > Configuration > Sales > Shipping Methods --> |
| 30 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> |
| 31 | + <!-- Free Shipping Configuration --> |
| 32 | + <magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/> |
| 33 | + <magentoCLI command="config:set {{EnableFreeShippingToSpecificCountriesConfigData.path}} {{EnableFreeShippingToSpecificCountriesConfigData.value}}" stepKey="selectSpecificCountries"/> |
| 34 | + <magentoCLI command="config:set {{EnableFreeShippingToAfghanistanConfigData.path}} {{EnableFreeShippingToAfghanistanConfigData.value}}" stepKey="selectCountry"/> |
| 35 | + <!-- DHL Shipping Configuration --> |
| 36 | + <actionGroup ref="AdminEnableDHLConfigurationActionGroup" stepKey="dhlConfig"/> |
| 37 | + <!--Set Shipping settings origin data--> |
| 38 | + <actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData"> |
| 39 | + <argument name="country" value="United States"/> |
| 40 | + <argument name="state" value="California"/> |
| 41 | + <argument name="postcode" value="90230"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCachePostChangingConfigurationSettings"> |
| 44 | + <argument name="tags" value="config"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPostChangingConfigurationSettings"> |
| 47 | + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> |
| 48 | + </actionGroup> |
| 49 | + </before> |
| 50 | + <!-- Go to storefront page to add product --> |
| 51 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 52 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 53 | + <!-- Add Simple product in the cart --> |
| 54 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 55 | + <argument name="product" value="$createSimpleProduct$"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToShippingPage"/> |
| 58 | + <!-- Guest checkout --> |
| 59 | + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="goToShippingAndFillDetails"> |
| 60 | + <argument name="customerAddress" value="US_CA_Address"/> |
| 61 | + </actionGroup> |
| 62 | + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="fillStateField"/> |
| 63 | + <waitForPageLoad stepKey="waitForChangeAfterStateLoad"/> |
| 64 | + <actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethod"/> |
| 65 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisible"/> |
| 66 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterStateChange"/> |
| 67 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingNotVisible"/> |
| 68 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelNotVisible"/> |
| 69 | + <!-- Change country value --> |
| 70 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/> |
| 71 | + <waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/> |
| 72 | + <actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterCountryChange"/> |
| 73 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterCountryChange"/> |
| 74 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterCountryChange"/> |
| 75 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisibleAfterCountryChange"/> |
| 76 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterCountryChange"/> |
| 77 | + <waitForText selector="{{CheckoutShippingMethodsSection.shippingDHLErrorMessage}}" userInput="This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us." stepKey="seeDhlErrorMessage"/> |
| 78 | + <!-- Fill New Data for checkout page --> |
| 79 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="United Kingdom" stepKey="fillCountry"/> |
| 80 | + <fillField selector="{{CheckoutShippingSection.city}}" userInput="London" stepKey="fillCity"/> |
| 81 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="N14 5JP" stepKey="fillPostcode"/> |
| 82 | + <actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterNewData"/> |
| 83 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterNewFormData"/> |
| 84 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterNewFormData"/> |
| 85 | + <actionGroup ref="VerifyDHLShippingMethodIsVisibilityActionGroup" stepKey="dhlShippingVisibility"/> |
| 86 | + <after> |
| 87 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 88 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 89 | + <!-- Reset shipping origin --> |
| 90 | + <actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="ResetCaliforniaShippingOrigin"/> |
| 91 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="shippingMethodConfigPage"/> |
| 92 | + <!-- Reset free shipping origin --> |
| 93 | + <magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/> |
| 94 | + <magentoCLI command="config:set {{EnableFreeShippingToAllAllowedCountriesConfigData.path}} {{EnableFreeShippingToAllAllowedCountriesConfigData.value}}" stepKey="selectAllCountries"/> |
| 95 | + <!-- Reset dhl configuration origin --> |
| 96 | + <actionGroup ref="AdminDisableDHLConfigurationActionGroup" stepKey="resetDhlConfig"/> |
| 97 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfigurationForDHL"/> |
| 98 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 99 | + </after> |
| 100 | + </test> |
| 101 | +</tests> |
0 commit comments