Skip to content

Commit 67f86d4

Browse files
committed
Merge branch 'MC-5319' into mtf-eol
2 parents ab3386f + 56be425 commit 67f86d4

7 files changed

+112
-8
lines changed

app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminTaxRateFormSection">
1212
<element name="taxIdentifier" type="input" selector="#code" />
13-
<element name="deleteRate" type="button" selector="#delete"/>
14-
<element name="ok" type="button" selector="button.action-primary.action-accept"/>
15-
<element name="save" type="button" selector="#save"/>
13+
<element name="deleteRate" type="button" selector="#delete" timeout="30"/>
14+
<element name="ok" type="button" selector="button.action-primary.action-accept" timeout="30"/>
15+
<element name="save" type="button" selector="#save" timeout="30"/>
1616
<element name="country" type="select" selector="#tax_country_id"/>
1717
<element name="state" type="select" selector="#tax_region_id"/>
1818
<element name="rate" type="text" selector="#rate"/>
19+
<element name="zipRange" type="checkbox" selector="#zip_is_range"/>
20+
<element name="rangeFrom" type="text" selector="#zip_from"/>
21+
<element name="rangeTo" type="text" selector="#zip_to"/>
22+
<element name="zipCode" type="input" selector="#tax_postcode"/>
1923
</section>
2024
</sections>

app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@
1616
<element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/>
1717
<element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/>
1818
<element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/>
19-
<element name="country" type="select" selector="#tax_country_id"/>
20-
<element name="zipCode" type="input" selector="#tax_postcode"/>
2119
</section>
2220
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminTaxRuleFormSection">
12+
<element name="taxIdentifier" type="input" selector="input.admin__control-text admin__action-multiselect-search"/>
13+
</section>
14+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminTaxRuleGridSection">
12+
<element name="add" type="button" selector="#add" timeout="30"/>
13+
</section>
14+
</sections>
15+
16+

app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<element name="zipIsRange" type="checkbox" selector="#zip_is_range"/>
1616
<element name="zipCode" type="input" selector="#tax_postcode"/>
1717
<element name="state" type="select" selector="#tax_region_id"/>
18+
<element name="country" type="select" selector="#tax_country_id"/>
1819
<element name="rate" type="input" selector="#rate"/>
1920
<element name="save" type="button" selector=".action-save" timeout="30"/>
2021
<element name="saveRule" type="button" selector="#save" timeout="30"/>

app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<!-- Create a tax rate with * for postcodes -->
3737
<click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/>
3838
<fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/>
39-
<fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="fillPostCode"/>
39+
<fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="fillPostCode"/>
4040
<selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="selectCountry1"/>
4141
<fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="fillRate"/>
4242
<click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/>
@@ -64,8 +64,8 @@
6464

6565
<!-- Verify we see expected values on the tax rate edit page -->
6666
<seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName2"/>
67-
<seeInField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="seeZipCode"/>
68-
<seeOptionIsSelected selector="{{AdminTaxRateGridSection.country}}" userInput="Australia" stepKey="seeCountry2"/>
67+
<seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="seeZipCode"/>
68+
<seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="seeCountry2"/>
6969
<seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="seeRate"/>
7070

7171
<!-- Go to the tax rule grid page and verify our tax rate can be used in the rule -->
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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="AdminCreateTaxRateZipCodeRange">
12+
<annotations>
13+
<stories value="Create Tax Rate"/>
14+
<title value="Create Tax Rate,zip code range"/>
15+
<description value="Test log in to Create Tax Rate and Create Zip Code Range"/>
16+
<testCaseId value="MC-5319"/>
17+
<severity value="CRITICAL"/>
18+
<group value="tax"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/>
26+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/>
27+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/>
28+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/>
29+
<click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/>
30+
<click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/>
31+
<click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/>
32+
</after>
33+
34+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/>
35+
<waitForPageLoad stepKey="waitForTaxRateIndex1"/>
36+
<!-- Create a tax rate with range from 90001-96162 for zipCodes -->
37+
<click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/>
38+
<fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/>
39+
<checkOption selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="checkZipRange" />
40+
<fillField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="90001" stepKey="fillZipFrom"/>
41+
<fillField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="96162" stepKey="fillZipTo"/>
42+
<selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="selectCountry1"/>
43+
<selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="selectState" />
44+
<fillField selector="{{AdminTaxRateFormSection.rate}}" userInput='15.5' stepKey="seeRate"/>
45+
<click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/>
46+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/>
47+
48+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/>
49+
<waitForPageLoad stepKey="waitForTaxRateIndex3"/>
50+
<!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page -->
51+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/>
52+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/>
53+
<selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United States" stepKey="selectCountry2" />
54+
<fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/>
55+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/>
56+
<click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow3"/>
57+
<!-- Verify we see expected values on the tax rate form page -->
58+
<seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxIdentifierField2"/>
59+
<seeCheckboxIsChecked selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="clickZipRange"/>
60+
<seeInField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="90001" stepKey="seeTaxPostCode2"/>
61+
<seeInField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="96162" stepKey="seeTaxPostCode3"/>
62+
<seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="seeState"/>
63+
<seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="seeCountry2"/>
64+
65+
<!-- Verify we see expected values on the tax rule form page -->
66+
<amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/>
67+
<waitForPageLoad stepKey="waitForTaxRateIndex4"/>
68+
<click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAdd"/>
69+
<see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/>
70+
</test>
71+
</tests>

0 commit comments

Comments
 (0)