|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests |
| 10 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 11 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 12 | + <test name="StorefrontVerifyUPSWithUnsupportedWeightUnitForUSTest"> |
| 13 | + <annotations> |
| 14 | + <features value="Shipping"/> |
| 15 | + <stories value="Weight unit kgs is not authorised for US origin"/> |
| 16 | + <title value="Unsupported weight unit"/> |
| 17 | + <description value="This test case verifies weight unit kgs is not authorised for US origin"/> |
| 18 | + <severity value="MAJOR"/> |
| 19 | + <testCaseId value="AC-11910"/> |
| 20 | + <group value="shipping"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Login as Admin--> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <!-- Create product --> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 27 | + <field key="price">100.00</field> |
| 28 | + </createData> |
| 29 | + <!--Create customer--> |
| 30 | + <createData entity="Simple_US_Utah_Customer" stepKey="createCustomer"/> |
| 31 | + <!--Step 1:Set Shipping settings origin data to US--> |
| 32 | + <actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData"> |
| 33 | + <argument name="country" value="United States"/> |
| 34 | + <argument name="state" value="California"/> |
| 35 | + <argument name="postcode" value="90034"/> |
| 36 | + </actionGroup> |
| 37 | + <!--Navigate to shipping method configuration for enabling UPS--> |
| 38 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPageForEnablingUPS"/> |
| 39 | + <!--Step 2: Configure UPS shipping method with ups type:rest, weight unit:kgs--> |
| 40 | + <actionGroup ref="AdminEnableUpsWithWeightUnitActionGroup" stepKey="enableUPSShippingMethod"> |
| 41 | + <argument name="weight" value="KGS"/> |
| 42 | + </actionGroup> |
| 43 | + <!--Cache flush--> |
| 44 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> |
| 45 | + <argument name="tags" value="full_page"/> |
| 46 | + </actionGroup> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <!--Reset shipping origin--> |
| 50 | + <actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/> |
| 51 | + <!--Navigate to shipping method configuration--> |
| 52 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPageForDisablingUPS"/> |
| 53 | + <!--Configure UPS shipping method with enable for checkout = No--> |
| 54 | + <actionGroup ref="AdminDisableUPSActionGroup" stepKey="disableUPSShippingMethod"/> |
| 55 | + <!--delete product, customer--> |
| 56 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 57 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 58 | + <!--Logout Admin--> |
| 59 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 60 | + </after> |
| 61 | + <!--Add simple product to cart--> |
| 62 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 63 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 64 | + </actionGroup> |
| 65 | + <!--Proceed to checkout--> |
| 66 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="proceedToCheckout"/> |
| 67 | + <!--Enter shipping address & method--> |
| 68 | + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/> |
| 69 | + <waitForPageLoad stepKey="waitForShippingPageToLoad"/> |
| 70 | + <!--Step 3 Assertion: Verify ups shipping methods on front end and verify ups shipping methods should not be displayed to the user--> |
| 71 | + <waitForElementVisible selector="{{StorefrontOrderShipmentSection.upsShippingMethodIsNotAvailable}}" stepKey="verifyUPSShippingMethodIsNotAvailable"/> |
| 72 | + <!--In admin navigate to create new order with existing customer--> |
| 73 | + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> |
| 74 | + <argument name="customer" value="$$createCustomer$$"/> |
| 75 | + </actionGroup> |
| 76 | + <!--Admin add simple product to order--> |
| 77 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> |
| 78 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 79 | + </actionGroup> |
| 80 | + <!--Admin add new address while creating order--> |
| 81 | + <selectOption userInput="Add New Address" selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" stepKey="addAddress" /> |
| 82 | + <actionGroup ref="AdminFillAddressInformationInOrderActionGroup" stepKey="FillOrderNewShippingAddress"> |
| 83 | + <argument name="customer" value="$$createCustomer$$"/> |
| 84 | + <argument name="address" value="US_Address_NY_Not_Default_Address"/> |
| 85 | + </actionGroup> |
| 86 | + <!--Scroll to element & click to reflect details as per defined address & customer--> |
| 87 | + <scrollTo selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="scrollToElementInteractable"/> |
| 88 | + <click selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" stepKey="clickToReflectDetailsAccordingToInputData"/> |
| 89 | + <!--Checkout select Check/Money Order payment--> |
| 90 | + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 91 | + <!--click on get shipping methods link--> |
| 92 | + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> |
| 93 | + <waitForLoadingMaskToDisappear stepKey="waitForJavascriptToFinish"/> |
| 94 | + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> |
| 95 | + <!--Step 3 Assertion: Verify ups shipping method in admin and verify ups shipping methods is not available--> |
| 96 | + <waitForElementVisible selector="{{AdminShippingMethodUPSSection.upsShippingNotAvailableAlertInAdmin}}" stepKey="waitForUpsShippingNotAvailable"/> |
| 97 | + </test> |
| 98 | +</tests> |
0 commit comments