|
| 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="AdminValidateCouponCodeLengthWithQuantityTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Generate coupon codes ignores Code Length"/> |
| 13 | + <title value="Admin to validate coupon code length with quantity in cart price rule."/> |
| 14 | + <description value="Admin to validate coupon code length with quantity in cart price rule."/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <useCaseId value="ACP2E-1053"/> |
| 17 | + <testCaseId value="AC-6642"/> |
| 18 | + <group value="SalesRule"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Login to backend--> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> |
| 26 | + <argument name="ruleName" value="ApiSalesRule"/> |
| 27 | + </actionGroup> |
| 28 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 29 | + </after> |
| 30 | + <actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="amOnCartPriceList"/> |
| 31 | + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> |
| 32 | + <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/> |
| 33 | + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/> |
| 34 | + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" parameterArray="[{{'NOT LOGGED IN','General','Wholesale','Retailer'}}]" stepKey="selectSpecifiedCustomerGroups"/> |
| 35 | + <!-- Choose coupon type specific coupon and tick auto generation checkbox --> |
| 36 | + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> |
| 37 | + <checkOption selector="{{AdminCartPriceRulesFormSection.useAutoGeneration}}" stepKey="tickAutoGeneration"/> |
| 38 | + <!-- Navigate to action tab section to fill the apply and discount amount --> |
| 39 | + <conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsTab}}" |
| 40 | + dependentSelector="{{AdminCartPriceRulesFormSection.actionsTab}}" visible="true" |
| 41 | + stepKey="clickActionsTab"/> |
| 42 | + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> |
| 43 | + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> |
| 44 | + <click selector="{{AdminCartPriceRulesFormSection.saveAndContinue}}" stepKey="ClickSaveAndContinue"/> |
| 45 | + <waitForPageLoad stepKey="WaitForRuleSaved"/> |
| 46 | + <see userInput="You saved the rule." stepKey="verifyRuleSaved"/> |
| 47 | + <!-- Navigate to Manage Coupon Codes section to validate coupon code length and quantity --> |
| 48 | + <conditionalClick selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" |
| 49 | + dependentSelector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" visible="true" |
| 50 | + stepKey="clickManageCouponCodes"/> |
| 51 | + <fillField selector="{{AdminCartPriceRulesFormSection.couponQty}}" userInput="2501" stepKey="fillFieldCouponQty"/> |
| 52 | + <fillField selector="{{AdminCartPriceRulesFormSection.couponLength}}" userInput="4" stepKey="fillFieldCouponLength"/> |
| 53 | + <selectOption selector="{{AdminCartPriceRulesFormSection.couponFormat}}" userInput="Numeric" stepKey="selectCouponFormat"/> |
| 54 | + <click selector="{{AdminCartPriceRulesFormSection.generateCouponsButton}}" stepKey="clickGenerateCoupon"/> |
| 55 | + <see selector="{{AdminCartPriceRulesFormSection.errorMessage}}" userInput="When coupon quantity exceeds 2501, the coupon code length must be minimum 5" stepKey="seeGenerationValidationError"/> |
| 56 | + </test> |
| 57 | +</tests> |
0 commit comments