|
| 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="AdminSetQuantityLimitationForProductsBoughtUsingMultishippingTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Shipping"/> |
| 14 | + <stories value="Multishipping limited quantity of products"/> |
| 15 | + <title value="Admin can set quantity limitation for products that can be bought using Multishipping"/> |
| 16 | + <description value="Verification for Maximum Qty Allowed for Shipping to Multiple Addresses configuration setting"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4309"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Login as admin--> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + <!--Create simple product with quantity > 15--> |
| 24 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 25 | + <field key="quantity">16</field> |
| 26 | + </createData> |
| 27 | + <!--Enable Flat Rate shipping method--> |
| 28 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 29 | + <!--Create customer--> |
| 30 | + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> |
| 31 | + <!--Set maximum quantity allowed for shipping to multiple addresses as 10--> |
| 32 | + <magentoCLI command="config:set {{MaximumQtyAllowed10ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed10ForShippingToMultipleAddressesConfigData.value}}" stepKey="setMaximumQuantityAllowedForShippingTo10"/> |
| 33 | + <!--Flush cache--> |
| 34 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 35 | + <argument name="tags" value="config full_page"/> |
| 36 | + </actionGroup> |
| 37 | + </before> |
| 38 | + <after> |
| 39 | + <!--Set maximum quantity allowed for shipping to multiple addresses as default--> |
| 40 | + <magentoCLI command="config:set {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.value}}" stepKey="setMaximumQuantityAllowedForShippingToDefault"/> |
| 41 | + <!--Delete product--> |
| 42 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 43 | + <!--Delete customer--> |
| 44 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 45 | + <!--Logout from admin--> |
| 46 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 47 | + </after> |
| 48 | + <!--Login as customer from storefront--> |
| 49 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 50 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 51 | + </actionGroup> |
| 52 | + <!--Open product page--> |
| 53 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage"> |
| 54 | + <argument name="product" value="$$createProduct$$"/> |
| 55 | + </actionGroup> |
| 56 | + <!--Add product to cart--> |
| 57 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 58 | + <argument name="product" value="$$createProduct$$"/> |
| 59 | + <argument name="productCount" value="1"/> |
| 60 | + </actionGroup> |
| 61 | + <!--Open cart page--> |
| 62 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCartPage"/> |
| 63 | + <!--Update product quantity to 11 (10>MaximumQtyAllowedForShippingToMultipleAddresses)--> |
| 64 | + <actionGroup ref="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup" stepKey="updateMaximumQtyAllowedForShippingTo11"> |
| 65 | + <argument name="product" value="$createProduct.name$"/> |
| 66 | + <argument name="qty" value="11"/> |
| 67 | + </actionGroup> |
| 68 | + <!--"Check Out with Multiple Addresses" link is not present--> |
| 69 | + <actionGroup ref="AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup" stepKey="MultipleAddressCheckoutIsNotPresent"/> |
| 70 | + <!--Update product quantity to 10 (10=MaximumQtyAllowedForShippingToMultipleAddresses)--> |
| 71 | + <actionGroup ref="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup" stepKey="updateMaximumQtyAllowedForShippingTo10"> |
| 72 | + <argument name="product" value="$createProduct.name$"/> |
| 73 | + <argument name="qty" value="10"/> |
| 74 | + </actionGroup> |
| 75 | + <!--"Check Out with Multiple Addresses" link is present--> |
| 76 | + <actionGroup ref="AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup" stepKey="assertMultiCheckoutAvailable"/> |
| 77 | + <!--Checkout with multiple addresses--> |
| 78 | + <actionGroup ref="StorefrontGoCheckoutWithMultipleAddressesActionGroup" stepKey="goCheckoutWithMultipleAddresses"/> |
| 79 | + <!--Assert "Ship to Multiple Addresses" page is open--> |
| 80 | + <seeInCurrentUrl url="{{MultishippingCheckoutAddressesPage.url}}" stepKey="seeShiptoMultipleAddressesPageIsOpened"/> |
| 81 | + <!--Assert product name & quantity on record 10--> |
| 82 | + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="assertProductOn10thRecord"> |
| 83 | + <argument name="sequenceNumber" value="10"/> |
| 84 | + <argument name="productName" value="$createProduct.name$"/> |
| 85 | + <argument name="quantity" value="1"/> |
| 86 | + </actionGroup> |
| 87 | + <!--Change any product quantity to 2--> |
| 88 | + <actionGroup ref="StorefrontChangeMultishippingItemQtyActionGroup" stepKey="changeProductQuantityOn10thRecord"> |
| 89 | + <argument name="sequenceNumber" value="10"/> |
| 90 | + <argument name="quantity" value="2"/> |
| 91 | + </actionGroup> |
| 92 | + <!--Click on "Update Qty & Addresses"--> |
| 93 | + <actionGroup ref="StorefrontUpdateMultishippingItemsQuantityAndAddressesActionGroup" stepKey="clickOnUpdateQtyAndAddress"/> |
| 94 | + <!--Assert error message--> |
| 95 | + <waitForText selector="{{MultishippingSection.attentionMessage}}" userInput="Maximum qty allowed for Shipping to multiple addresses is 10" stepKey="assertErrorMessage"/> |
| 96 | + <!--Accept alert--> |
| 97 | + <waitForElementClickable selector="{{MultishippingSection.acceptAttention}}" stepKey="waitToAcceptAttention"/> |
| 98 | + <click selector="{{MultishippingSection.acceptAttention}}" stepKey="acceptAttention"/> |
| 99 | + <!--Assert product quantity is NOT changed--> |
| 100 | + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="againAssertProductQuantityOn10thRecord"> |
| 101 | + <argument name="sequenceNumber" value="10"/> |
| 102 | + <argument name="productName" value="$createProduct.name$"/> |
| 103 | + <argument name="quantity" value="1"/> |
| 104 | + </actionGroup> |
| 105 | + </test> |
| 106 | +</tests> |
0 commit comments