|
| 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="ClearShoppingCartEnableDisableConfigurationTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Checkout"/> |
| 13 | + <stories value="Shopping Cart"/> |
| 14 | + <title value="Enable and Disable Clear Shopping Cart Configuration"/> |
| 15 | + <description value="Verify that disabling the clear shopping cart store configuration will remove the clear shopping cart configuration button from the storefront's shopping cart page. Verify that enabling the configuration will add the button to the page and that the button functions as expected"/> |
| 16 | + <group value="shoppingCart"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <!-- Create simple products and category --> |
| 20 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 21 | + <createData entity="SimpleProduct" stepKey="createProduct1"> |
| 22 | + <requiredEntity createDataKey="createCategory"/> |
| 23 | + </createData> |
| 24 | + <createData entity="SimpleProduct" stepKey="createProduct2"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + </createData> |
| 27 | + |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 32 | + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> |
| 33 | + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> |
| 34 | + |
| 35 | + <!-- Disable clear shopping cart --> |
| 36 | + <magentoCLI command="config:set {{DisableClearShoppingCart.path}} {{DisableClearShoppingCart.value}}" stepKey="disableClearShoppingCart"/> |
| 37 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 38 | + </after> |
| 39 | + |
| 40 | + <!-- Navigate to sales checkout cart configuration --> |
| 41 | + <actionGroup ref="AdminOpenSalesCheckoutConfigPageActionGroup" stepKey="openSalesCheckoutCartConfig1"> |
| 42 | + <argument name="tabGroupAnchor" value="#checkout_cart-link"/> |
| 43 | + </actionGroup> |
| 44 | + |
| 45 | + <!-- Enable clear shopping cart button --> |
| 46 | + <actionGroup ref="AdminSelectClearShoppingCartConfigurationActionGroup" stepKey="enableClearShoppingCartButton"/> |
| 47 | + <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration1"/> |
| 48 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean1"> |
| 49 | + <argument name="tags" value=""/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Open product 1 and add to cart --> |
| 53 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page1"> |
| 54 | + <argument name="product" value="$$createProduct1$$"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product1AddToCart"/> |
| 57 | + |
| 58 | + <!-- Open product 2 and add to cart --> |
| 59 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct2Page"> |
| 60 | + <argument name="product" value="$$createProduct2$$"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product2AddToCart"/> |
| 63 | + |
| 64 | + <!-- Go to shopping cart page --> |
| 65 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage1"/> |
| 66 | + |
| 67 | + <!-- Clear shopping cart --> |
| 68 | + <actionGroup ref="StorefrontClearShoppingCartActionGroup" stepKey="clearShoppingCart"/> |
| 69 | + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartEmpty"/> |
| 70 | + |
| 71 | + <!-- Return to Admin to disable clear shopping cart --> |
| 72 | + <actionGroup ref="AdminOpenSalesCheckoutConfigPageActionGroup" stepKey="openSalesCheckoutCartConfig2"/> |
| 73 | + <actionGroup ref="AdminSelectClearShoppingCartConfigurationActionGroup" stepKey="disableClearShoppingCartButton"> |
| 74 | + <argument name="value" value="{{DisableClearShoppingCart.textValue}}"/> |
| 75 | + </actionGroup> |
| 76 | + <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration2"/> |
| 77 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean2"> |
| 78 | + <argument name="tags" value=""/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!-- Open product 1 page and add to cart --> |
| 82 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page2"> |
| 83 | + <argument name="product" value="$$createProduct1$$"/> |
| 84 | + </actionGroup> |
| 85 | + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product1AddToCart2"/> |
| 86 | + |
| 87 | + <!-- Go to shopping cart and assert clear shopping cart button is not rendered in UI --> |
| 88 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage2"/> |
| 89 | + <dontSeeElementInDOM selector="{{CheckoutCartProductSection.emptyCartButton}}" stepKey="dontSeeElementEmptyCartButton"/> |
| 90 | + </test> |
| 91 | +</tests> |
0 commit comments