|
| 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="AdminCheckConfigsChangesAreNotAffectedStartedCheckoutProcessTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <stories value="Changes in configs are not affecting checkout process"/> |
| 15 | + <title value="Admin check configs changes are not affected started checkout process test"/> |
| 16 | + <description value="Changes in admin for shipping rates are not affecting checkout process that has been started"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-12599"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create simple product --> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 24 | + |
| 25 | + <!-- Enable free shipping method --> |
| 26 | + <magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/> |
| 27 | + |
| 28 | + <!-- Disable flat rate method --> |
| 29 | + <magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> |
| 30 | + </before> |
| 31 | + <after> |
| 32 | + <!-- Roll back configuration --> |
| 33 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 34 | + <magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/> |
| 35 | + |
| 36 | + <!-- Delete simple product --> |
| 37 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 38 | + |
| 39 | + <!-- Log out --> |
| 40 | + <actionGroup ref="logout" stepKey="logout"/> |
| 41 | + </after> |
| 42 | + |
| 43 | + <!-- Add product to cart --> |
| 44 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 45 | + <argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 48 | + <argument name="product" value="$$createProduct$$"/> |
| 49 | + <argument name="productCount" value="1"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Proceed to Checkout from mini shopping cart --> |
| 53 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> |
| 54 | + |
| 55 | + <!-- Fill all required fields --> |
| 56 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress"> |
| 57 | + <argument name="customer" value="Simple_Customer_Without_Address" /> |
| 58 | + <argument name="address" value="US_Address_TX"/> |
| 59 | + </actionGroup> |
| 60 | + |
| 61 | + <!-- Assert Free Shipping checkbox --> |
| 62 | + <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> |
| 63 | + |
| 64 | + <!-- Click Next button --> |
| 65 | + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> |
| 66 | + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> |
| 67 | + |
| 68 | + <!-- Payment step is opened --> |
| 69 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> |
| 70 | + |
| 71 | + <!-- Order Summary block contains information about shipping --> |
| 72 | + <actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckShippingMethod"> |
| 73 | + <argument name="shippingMethod" value="freeTitleDefault.value"/> |
| 74 | + </actionGroup> |
| 75 | + |
| 76 | + <!-- Open new browser's window and login as Admin --> |
| 77 | + <openNewTab stepKey="openNewTab"/> |
| 78 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 79 | + |
| 80 | + <!-- Go to Store > Configuration > Sales > Shipping Methods --> |
| 81 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> |
| 82 | + |
| 83 | + <!-- Enable "Flat Rate" --> |
| 84 | + <actionGroup ref="AdminChangeFlatRateShippingMethodStatusActionGroup" stepKey="enableFlatRateShippingStatus"/> |
| 85 | + |
| 86 | + <!-- Flush cache --> |
| 87 | + <magentoCLI command="cache:flush" stepKey="cacheFlush"/> |
| 88 | + |
| 89 | + <!-- Back to the Checkout and refresh the page --> |
| 90 | + <switchToPreviousTab stepKey="switchToPreviousTab"/> |
| 91 | + <reloadPage stepKey="refreshPage"/> |
| 92 | + <waitForPageLoad stepKey="waitPageReload"/> |
| 93 | + |
| 94 | + <!-- Payment step is opened after refreshing --> |
| 95 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSection"/> |
| 96 | + |
| 97 | + <!-- Order Summary block contains information about free shipping --> |
| 98 | + <actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckFreeShippingMethod"> |
| 99 | + <argument name="shippingMethod" value="freeTitleDefault.value"/> |
| 100 | + </actionGroup> |
| 101 | + </test> |
| 102 | +</tests> |
0 commit comments