|
| 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="StorefrontGuestCheckoutForAvailableShippingRateChangeToInputDataTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Checkout"/> |
| 13 | + <stories value="Checkout via Guest Checkout"/> |
| 14 | + <title value="Guest Checkout - guest should be able to see the change in the shipping rate on fly."/> |
| 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="AVERAGE"/> |
| 17 | + <testCaseId value="AC-6139"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 21 | + <!-- Enabling Flat Rate --> |
| 22 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 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 | + <actionGroup ref="AdminFreeShippingActionGroup" stepKey="freeShippingConfig"> |
| 33 | + <argument name="enabled" value="Yes"/> |
| 34 | + <argument name="allowSpecificCountry" value="Specific Countries"/> |
| 35 | + <argument name="specificCountry" value="Afghanistan"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> |
| 38 | + <!-- DHL Shipping Configuration --> |
| 39 | + <actionGroup ref="AdminDHLConfigurationActionGroup" stepKey="dhlConfig"> |
| 40 | + <argument name="enabled" value="Yes"/> |
| 41 | + <argument name="config" value="dhlConfigData"/> |
| 42 | + <argument name="allowSpecificCountry" value="Specific Countries"/> |
| 43 | + <argument name="specificCountry" value="United Kingdom"/> |
| 44 | + <argument name="showMethod" value="Yes"/> |
| 45 | + <argument name="debug" value="Yes"/> |
| 46 | + <argument name="sandbox" value="Yes"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigurationForDHL"/> |
| 49 | + <!--Set Shipping settings origin data--> |
| 50 | + <actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData"> |
| 51 | + <argument name="country" value="United States"/> |
| 52 | + <argument name="state" value="California"/> |
| 53 | + <argument name="postcode" value="90034"/> |
| 54 | + </actionGroup> |
| 55 | + </before> |
| 56 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCachePostChangingConfigurationSettings"> |
| 57 | + <argument name="tags" value="config"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPostChangingConfigurationSettings"> |
| 60 | + <argument name="indices" value=""/> |
| 61 | + </actionGroup> |
| 62 | + <!-- Go to storefront page to add product --> |
| 63 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 64 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 65 | + <!-- Add Simple product in the cart --> |
| 66 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 67 | + <argument name="product" value="$createSimpleProduct$"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 70 | + <!-- Guest checkout --> |
| 71 | + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="goToShippingAndFillDetails"> |
| 72 | + <argument name="customerAddress" value="US_CA_Address"/> |
| 73 | + </actionGroup> |
| 74 | + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="fillStateField"/> |
| 75 | + <waitForPageLoad stepKey="waitForChangeAfterStateLoad"/> |
| 76 | + <actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" stepKey="verifyShippingMethod"/> |
| 77 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisible"/> |
| 78 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterStateChange"/> |
| 79 | + <!-- Change country value --> |
| 80 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/> |
| 81 | + <waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/> |
| 82 | + <actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" stepKey="verifyShippingMethodAfterCountryChange"/> |
| 83 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterCountryChange"/> |
| 84 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterCountryChange"/> |
| 85 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisibleAfterCountryChange"/> |
| 86 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterCountryChange"/> |
| 87 | + <!-- Fill New Data for checkout page --> |
| 88 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="United Kingdom" stepKey="fillCountry"/> |
| 89 | + <fillField selector="{{CheckoutShippingSection.city}}" userInput="London" stepKey="fillCity"/> |
| 90 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="N14 5JP" stepKey="fillPostcode"/> |
| 91 | + <actionGroup ref="VerifyShippingMethodIsVisibilityOrNotActionGroup" stepKey="verifyShippingMethodAfterNewData"/> |
| 92 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterNewFormData"/> |
| 93 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterNewFormData"/> |
| 94 | + <actionGroup ref="VerifyDHLShippingMethodIsVisibilityActionGroup" stepKey="dhlShippingVisibility"/> |
| 95 | + <after> |
| 96 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 97 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 98 | + <!-- Disable flat rate method --> |
| 99 | + <magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> |
| 100 | + <!-- Reset shipping origin --> |
| 101 | + <actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="ResetCaliforniaShippingOrigin"/> |
| 102 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="shippingMethodConfigPage"/> |
| 103 | + <!-- Reset free shipping origin --> |
| 104 | + <actionGroup ref="AdminDisableFreeShippingActionGroup" stepKey="resetFreeShippingConfig"/> |
| 105 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfiguration"/> |
| 106 | + <!-- Reset dhl configuration origin --> |
| 107 | + <actionGroup ref="AdminDHLConfigurationActionGroup" stepKey="resetDhlConfig"/> |
| 108 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfigurationForDHL"/> |
| 109 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 110 | + </after> |
| 111 | + </test> |
| 112 | +</tests> |
0 commit comments