Skip to content

Commit 897ef94

Browse files
committed
MC-5331: Update tax rate, any region
1 parent 447ad47 commit 897ef94

File tree

2 files changed

+64
-16
lines changed

2 files changed

+64
-16
lines changed

app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
<entity name="defaultTaxRateWithZipRange" type="taxRate">
3232
<data key="code" unique="suffix">Tax Rate </data>
3333
<data key="tax_country_id">US</data>
34+
<data key="tax_country">United States</data>
3435
<data key="tax_region_id">12</data>
36+
<data key="tax_region">California</data>
3537
<data key="zip_is_range">1</data>
3638
<data key="zip_from">90001</data>
3739
<data key="zip_to">96162</data>
@@ -40,32 +42,18 @@
4042
<entity name="defaultTaxRateWithLargeRate" type="taxRate">
4143
<data key="code" unique="suffix">TaxRate</data>
4244
<data key="tax_country_id">GB</data>
45+
<data key="tax_country">United Kingdom</data>
4346
<data key="tax_postcode">*</data>
4447
<data key="zip_is_range">0</data>
4548
<data key="rate">777</data>
4649
</entity>
4750
<entity name="taxRateCustomRateCanada" type="taxRate">
4851
<data key="code" unique="suffix">TaxRate</data>
4952
<data key="tax_country_id">CA</data>
53+
<data key="tax_country">Canada</data>
5054
<data key="tax_region_id">*</data>
5155
<data key="tax_postcode">180</data>
5256
<data key="zip_is_range">0</data>
5357
<data key="rate">25</data>
5458
</entity>
55-
<entity name="taxRateCustomRateUK" type="taxRate">
56-
<data key="code" unique="suffix">TaxRate</data>
57-
<data key="tax_country_id">GB</data>
58-
<data key="zip_is_range">1</data>
59-
<data key="zip_from">1</data>
60-
<data key="zip_to">7800935</data>
61-
<data key="rate">12.99</data>
62-
</entity>
63-
<entity name="taxRateCustomRateFrance" type="taxRate">
64-
<data key="code" unique="suffix">TaxRate</data>
65-
<data key="tax_country_id">FR</data>
66-
<data key="tax_region_id">277</data>
67-
<data key="tax_postcode">*</data>
68-
<data key="zip_is_range">0</data>
69-
<data key="rate">0.1</data>
70-
</entity>
7159
</entities>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="UpdateAnyRegionTaxRateEntityTest">
12+
<annotations>
13+
<stories value="Update Tax Rate"/>
14+
<title value="Update tax rate, any region"/>
15+
<description value="Test log in to Tax Rate and Update Any Region"/>
16+
<testCaseId value="MC-5331"/>
17+
<severity value="CRITICAL"/>
18+
<group value="tax"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<createData entity="defaultTaxRate" stepKey="initialTaxRate"/>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
</before>
25+
<after>
26+
<deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" />
27+
</after>
28+
29+
<!-- Search the tax rate on tax grid page -->
30+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/>
31+
<waitForPageLoad stepKey="waitForTaxRateIndex1"/>
32+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/>
33+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/>
34+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/>
35+
<click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/>
36+
37+
<!-- Update any region tax rate on the tax rate form page -->
38+
<fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField2"/>
39+
<selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateCanada.tax_country_id}}" stepKey="selectCountry1"/>
40+
<selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateCanada.tax_region_id}}" stepKey="selectState"/>
41+
<fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateCanada.tax_postcode}}" stepKey="fillPostCode"/>
42+
<fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateCanada.rate}}" stepKey="fillRate1"/>
43+
<click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/>
44+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/>
45+
46+
<!-- Verify we see updated any region tax rate(from the above step) on the tax rate grid page -->
47+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/>
48+
<waitForPageLoad stepKey="waitForTaxRateIndex2"/>
49+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/>
50+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField3"/>
51+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/>
52+
<click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/>
53+
<!-- Verify we see updated any region tax rate on the tax rate form page -->
54+
<seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="seeRTaxIdentifier"/>
55+
<seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateCanada.tax_country}}" stepKey="seeCountry2"/>
56+
<seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateCanada.tax_region_id}}" stepKey="seeState2"/>
57+
<seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateCanada.tax_postcode}}" stepKey="seeZipCode"/>
58+
<seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateCanada.rate}}" stepKey="seeRate2"/>
59+
</test>
60+
</tests>

0 commit comments

Comments
 (0)