|
| 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="StorefrontMultishippingWithCartPriceRuleMatchingTotalItemsQtyTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Multi shipping and Cart Price Rule"/> |
| 14 | + <stories value="Checking cart price rule matching total items qty with multiple shipping addresses on storefront and place order"/> |
| 15 | + <title value="Checking cart price rule matching total items qty with multiple shipping addressecreateCategorys on storefront and place order"/> |
| 16 | + <description value="Cart Price Rules matching total items quantity not working and missing shipping method"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-2106"/> |
| 19 | + <group value="Multishipment"/> |
| 20 | + <group value="SalesRule"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Login as Admin --> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 25 | + <!-- Create simple products --> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + <createData entity="SimpleProduct" stepKey="firstProduct"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <createData entity="SimpleProduct" stepKey="secondProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + </createData> |
| 33 | + <createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <!-- Delete created data --> |
| 37 | + <deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/> |
| 38 | + <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> |
| 39 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 40 | + <deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> |
| 41 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule"> |
| 42 | + <argument name="ruleName" value="{{CartPriceRuleConditionNotApplied.name}}"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 45 | + </after> |
| 46 | + |
| 47 | + <!-- Create a cart price rule --> |
| 48 | + <actionGroup ref="AdminOpenNewCartPriceRuleFormPageActionGroup" stepKey="createCartPriceRule"/> |
| 49 | + <actionGroup ref="AdminCartPriceRuleFillMainInfoActionGroup" stepKey="selectCustomCustomerGroup"> |
| 50 | + <argument name="name" value="{{CartPriceRuleConditionNotApplied.name}}"/> |
| 51 | + <argument name="description" value="{{CartPriceRuleConditionNotApplied.description}}"/> |
| 52 | + </actionGroup> |
| 53 | + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="{{CartPriceRuleConditionNotApplied.coupon_type}}" stepKey="selectCouponType"/> |
| 54 | + <scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToConditionsHeader"/> |
| 55 | + <!-- Fill condition 1: Total Items Quantity --> |
| 56 | + <conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" visible="true" stepKey="expandConditions"/> |
| 57 | + <click selector="{{AdminCartPriceRulesFormSection.newCondition}}" stepKey="clickNewCondition"/> |
| 58 | + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="Total Items Quantity" stepKey="selectCondition"/> |
| 59 | + <waitForPageLoad stepKey="waitForConditionLoad"/> |
| 60 | + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" stepKey="clickEllipsis"/> |
| 61 | + <fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="2" stepKey="fillTotalItemQuantity"/> |
| 62 | + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="createActiveCartPriceRuleActionsSection"> |
| 63 | + <argument name="rule" value="CartPriceRuleConditionNotApplied"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="seeAssertCartPriceRuleSuccessSaveMessage"/> |
| 66 | + |
| 67 | + <!-- Login to the Storefront as created customer --> |
| 68 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 69 | + <argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> |
| 70 | + </actionGroup> |
| 71 | + <!-- Open the first product page --> |
| 72 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToFirstProductPage"> |
| 73 | + <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> |
| 74 | + </actionGroup> |
| 75 | + <!-- Add the first product to the Shopping Cart --> |
| 76 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> |
| 77 | + <argument name="productName" value="$$firstProduct.name$$"/> |
| 78 | + <argument name="productQty" value="2"/> |
| 79 | + </actionGroup> |
| 80 | + <!--Go to Cart --> |
| 81 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> |
| 82 | + <!--Check Out with Multiple Addresses --> |
| 83 | + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> |
| 84 | + <!-- Select different addresses and click 'Go to Shipping Information' --> |
| 85 | + <actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectFirstAddress"> |
| 86 | + <argument name="sequenceNumber" value="1"/> |
| 87 | + <argument name="option" value="John Doe, 368 Broadway St. 113, New York, New York 10001, United States"/> |
| 88 | + </actionGroup> |
| 89 | + <actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectSecondAddress"> |
| 90 | + <argument name="sequenceNumber" value="2"/> |
| 91 | + <argument name="option" value="John Doe, Augsburger Strabe 41, Berlin, 10789, Germany"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="StorefrontSaveAddressActionGroup" stepKey="saveAddresses"/> |
| 94 | + <!-- Use Default Shipping Method --> |
| 95 | + <actionGroup ref="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup" stepKey="useDefaultShippingMethod"/> |
| 96 | + <!-- Click 'Go to Review Your Order' --> |
| 97 | + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="useDefaultBillingMethod"/> |
| 98 | + <!-- Click 'Place Order' --> |
| 99 | + <actionGroup ref="PlaceOrderActionGroup" stepKey="placeOrder"/> |
| 100 | + </test> |
| 101 | +</tests> |
0 commit comments