|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 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="StorefrontAssertAvailableShippingRateIsChangedBasedOnInputedDataTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Fedex"/> |
| 14 | + <stories value="Shipping Rates"/> |
| 15 | + <title value="Storefront available shipping rate is changed on shipping page"/> |
| 16 | + <description value="Testcase verifies On storefront Available shipping rate is changed on fly according to inputed data"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-9283"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 22 | + <field key="price">10</field> |
| 23 | + </createData> |
| 24 | + <actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShippingMethod"/> |
| 25 | + <actionGroup ref="AdminEnableFreeShippingToSpecificCountriesActionGroup" stepKey="enableToSpecificCountrie"/> |
| 26 | + <actionGroup ref="AdminEnableFedExConfigurationActionGroup" stepKey="enableFedEx"/> |
| 27 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 28 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 29 | + <argument name="indices" value=""/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 32 | + <argument name="tags" value="config full_page"/> |
| 33 | + </actionGroup> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 37 | + <actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/> |
| 38 | + <actionGroup ref="AdminEnableFreeShippingToAllCountriesActionGroup" stepKey="enableAllCountries"/> |
| 39 | + <actionGroup ref="AdminDisableFedexConfigurationActionGroup" stepKey="disableFedEx"/> |
| 40 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 41 | + </after> |
| 42 | + <!-- Add product to cart --> |
| 43 | + <actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart"> |
| 44 | + <argument name="product" value="$$createProduct$$"/> |
| 45 | + <argument name="quantity" value="1"/> |
| 46 | + </actionGroup> |
| 47 | + <!-- Go to checkout page --> |
| 48 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/> |
| 49 | + <!-- Assert Shipping Page --> |
| 50 | + <actionGroup ref="StorefrontAssertShippingAddressPageDisplayActionGroup" stepKey="assertShippingPageDisplay"/> |
| 51 | + <waitForElement selector="{{CheckoutShippingSection.emailAddress}}" stepKey="waitForEmailField" /> |
| 52 | + <actionGroup ref="StorefrontCheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyFlatRateShippingMethod"/> |
| 53 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelNotVisible"/> |
| 54 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFedexLabel}}" stepKey="waitForFedexNullLabelVisible"/> |
| 55 | + <!-- Change country value --> |
| 56 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/> |
| 57 | + <waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/> |
| 58 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="1001" stepKey="enterPostcode"/> |
| 59 | + <actionGroup ref="StorefrontCheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterCountryChange"/> |
| 60 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterCountryChange"/> |
| 61 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterCountryChange"/> |
| 62 | + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFedexLabel}}" stepKey="waitForFedexNullLabelVisibleAfterCountryChange"/> |
| 63 | + <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="seeFedexErrorMessage"/> |
| 64 | + <!-- Fill customer new shipping address --> |
| 65 | + <actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> |
| 66 | + <argument name="address" value="US_Address_TX"/> |
| 67 | + </actionGroup> |
| 68 | + <waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="againWaitForFreeShippingLabelNotVisible"/> |
| 69 | + <actionGroup ref="StorefrontCheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyFlatRateShippingMethodAfterCOuntryChangeToUS"/> |
| 70 | + <actionGroup ref="StorefrontVerifyFedexShippingMethodPricesActionGroup" stepKey="verifyFedexShippingMethodPrices"/> |
| 71 | + </test> |
| 72 | +</tests> |
0 commit comments