|
| 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="AdminUpdateDefaultTaxRuleTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Update tax rule"/> |
| 14 | + <title value="Update tax rule, tax rule default"/> |
| 15 | + <description value="Test log in to Update tax rule and Update default tax rule"/> |
| 16 | + <testCaseId value="MC-5819"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="tax"/> |
| 19 | + <group value="mtf_migrated"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="defaultTaxRule" stepKey="initialTaxRule"/> |
| 23 | + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> |
| 24 | + <createData entity="customerTaxClass" stepKey="createCustomerTaxClass"/> |
| 25 | + <createData entity="productTaxClass" stepKey="createProductTaxClass"/> |
| 26 | + <getData entity="customerTaxClass" stepKey="customerTaxClass"> |
| 27 | + <requiredEntity createDataKey="createCustomerTaxClass"/> |
| 28 | + </getData> |
| 29 | + <getData entity="productTaxClass" stepKey="productTaxClass"> |
| 30 | + <requiredEntity createDataKey="createProductTaxClass"/> |
| 31 | + </getData> |
| 32 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 33 | + </before> |
| 34 | + <after> |
| 35 | + <deleteData stepKey="deleteTaxRule" createDataKey="initialTaxRule" /> |
| 36 | + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> |
| 37 | + <deleteData stepKey="deleteCustomerTaxClass" createDataKey="createCustomerTaxClass"/> |
| 38 | + <deleteData stepKey="deleteProductTaxClass" createDataKey="createProductTaxClass"/> |
| 39 | + </after> |
| 40 | + |
| 41 | + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> |
| 42 | + <waitForPageLoad stepKey="waitForTaxRuleIndex1"/> |
| 43 | + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> |
| 44 | + <fillField selector="{{AdminTaxRuleGridSection.code}}" userInput="$$initialTaxRule.code$$" stepKey="fillTaxCodeSearch"/> |
| 45 | + <click selector="{{AdminTaxRuleGridSection.search}}" stepKey="clickSearch1"/> |
| 46 | + <click selector="{{AdminTaxRuleGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> |
| 47 | + |
| 48 | + <!-- Update tax rule with default --> |
| 49 | + <fillField selector="{{AdminTaxRuleFormSection.code}}" userInput="{{SimpleTaxRule.code}}" stepKey="fillTaxRuleCode1"/> |
| 50 | + <fillField selector="{{AdminTaxRuleFormSection.taxRateSearch}}" userInput="$$initialTaxRate.code$$" stepKey="fillTaxRateSearch"/> |
| 51 | + <wait stepKey="waitForSearch" time="5" /> |
| 52 | + <click selector="{{AdminTaxRuleFormSection.taxRateOption($$initialTaxRate.code$$)}}" stepKey="clickSelectNeededItem"/> |
| 53 | + <click selector="{{AdminTaxRuleFormSection.additionalSettings}}" stepKey="clickAdditionalSettings"/> |
| 54 | + <scrollTo selector="{{AdminTaxRuleFormSection.additionalSettings}}" x="0" y="-80" stepKey="scrollToAdvancedSettings"/> |
| 55 | + <wait stepKey="waitForAdditionalSettings" time="5" /> |
| 56 | + <conditionalClick selector="{{AdminTaxRuleFormSection.customerTaxClassOption(retailCustomerTaxClass.class_name)}}" dependentSelector="{{AdminTaxRuleFormSection.customerTaxClassSelected(retailCustomerTaxClass.class_name)}}" visible="false" stepKey="checkRetailCustomerTaxClass" /> |
| 57 | + <conditionalClick selector="{{AdminTaxRuleFormSection.productTaxClassOption(taxableGoodsTaxClass.class_name)}}" dependentSelector="{{AdminTaxRuleFormSection.productTaxClassSelected(taxableGoodsTaxClass.class_name)}}" visible="false" stepKey="checkTaxableGoodsTaxClass" /> |
| 58 | + <click selector="{{AdminTaxRuleFormSection.customerTaxClassOption($$customerTaxClass.class_name$$)}}" stepKey="clickSelectCustomerTaxClass"/> |
| 59 | + <click selector="{{AdminTaxRuleFormSection.productTaxClassOption($$productTaxClass.class_name$$)}}" stepKey="clickSelectProductTaxClass"/> |
| 60 | + <fillField selector="{{AdminTaxRuleFormSection.priority}}" userInput="{{taxRuleWithUpdatePriorityPosition.priority}}" stepKey="fillPriority"/> |
| 61 | + <fillField selector="{{AdminTaxRuleFormSection.sortOrder}}" userInput="{{taxRuleWithUpdatePriorityPosition.position}}" stepKey="fillPosition"/> |
| 62 | + <click selector="{{AdminTaxRuleFormSection.save}}" stepKey="clickSaveTaxRule"/> |
| 63 | + <waitForPageLoad stepKey="waitForTaxRuleSaved" /> |
| 64 | + <!-- Verify we see success message --> |
| 65 | + <see selector="{{AdminTaxRuleGridSection.successMessage}}" userInput="You saved the tax rule." stepKey="seeAssertTaxRuleSuccessMessage"/> |
| 66 | + |
| 67 | + <!-- Verify we see updated tax rule with default(from the above step) on the tax rule grid page --> |
| 68 | + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> |
| 69 | + <fillField selector="{{AdminTaxRuleGridSection.code}}" userInput="{{SimpleTaxRule.code}}" stepKey="fillTaxRuleCode2"/> |
| 70 | + <click selector="{{AdminTaxRuleGridSection.search}}" stepKey="clickSearch2"/> |
| 71 | + <waitForPageLoad stepKey="waitForTaxRuleSearch"/> |
| 72 | + <click selector="{{AdminTaxRuleGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> |
| 73 | + |
| 74 | + <!-- Verify we see updated tax rule with default on the tax rule form page --> |
| 75 | + <seeInField selector="{{AdminTaxRuleFormSection.code}}" userInput="{{SimpleTaxRule.code}}" stepKey="seeInTaxRuleCode"/> |
| 76 | + <seeElement selector="{{AdminTaxRuleFormSection.taxRateSelected($$initialTaxRate.code$$)}}" stepKey="seeTaxRateSelected"/> |
| 77 | + <click selector="{{AdminTaxRuleFormSection.additionalSettings}}" stepKey="clickAdditionalSettings1"/> |
| 78 | + <scrollTo selector="{{AdminTaxRuleFormSection.additionalSettings}}" x="0" y="-80" stepKey="scrollToAdvancedSettings1"/> |
| 79 | + <seeElement selector="{{AdminTaxRuleFormSection.customerTaxClassSelected($$customerTaxClass.class_name$$)}}" stepKey="seeCustomerTaxClass"/> |
| 80 | + <seeElement selector="{{AdminTaxRuleFormSection.productTaxClassSelected($$productTaxClass.class_name$$)}}" stepKey="seeProductTaxClass"/> |
| 81 | + <seeInField selector="{{AdminTaxRuleFormSection.priority}}" userInput="{{taxRuleWithUpdatePriorityPosition.priority}}" stepKey="seePriority"/> |
| 82 | + <seeInField selector="{{AdminTaxRuleFormSection.sortOrder}}" userInput="{{taxRuleWithUpdatePriorityPosition.position}}" stepKey="seePosition"/> |
| 83 | + </test> |
| 84 | +</tests> |
0 commit comments