Skip to content

Commit a514953

Browse files
committed
Merge branch 'MC-5318' into mtf-eol
2 parents 1a805d0 + 6585267 commit a514953

File tree

5 files changed

+133
-2
lines changed

5 files changed

+133
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="SimpleTaxRate" type="taxRate">
11+
<data key="code" unique="suffix">TaxRate</data>
12+
</entity>
13+
</entities>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminTaxRateFormSection">
12+
<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"/>
16+
<element name="country" type="select" selector="#tax_country_id"/>
17+
<element name="state" type="select" selector="#tax_region_id"/>
18+
<element name="rate" type="text" selector="#rate"/>
19+
</section>
20+
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminTaxRateGridSection">
12+
<element name="grid" type="block" selector="#tax_rate_grid"/>
13+
<element name="add" type="button" selector="#add" timeout="30"/>
14+
<element name="search" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/>
15+
<element name="filterByTaxIdentifier" type="input" selector="#tax_rate_grid_filter_code"/>
16+
<element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/>
17+
<element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/>
18+
<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"/>
21+
</section>
22+
</sections>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminTaxRulesSection">
12-
<!-- on page /admin/tax/rule/new/ -->
1312
<element name="ruleName" type="input" selector="#anchor-content #code"/>
1413
<element name="addNewTaxRate" type="block" selector="//*[text()='Add New Tax Rate']" timeout="30"/>
1514
<element name="taxIdentifier" type="input" selector="aside #code"/>
1615
<element name="zipIsRange" type="checkbox" selector="#zip_is_range"/>
1716
<element name="zipCode" type="input" selector="#tax_postcode"/>
1817
<element name="state" type="select" selector="#tax_region_id"/>
19-
<element name="country" type="select" selector="#tax_country_id"/>
2018
<element name="rate" type="input" selector="#rate"/>
2119
<element name="save" type="button" selector=".action-save" timeout="30"/>
2220
<element name="saveRule" type="button" selector="#save" timeout="30"/>
@@ -28,5 +26,6 @@
2826
<element name="deleteTaxClassName" type="button" selector="//span[contains(text(),'{{var1}}')]" parameterized="true"/>
2927
<element name="deleteTaxClass" type="button" selector="//span[contains(text(),'{{var1}}')]/../..//*[@class='mselect-delete']" parameterized="true"/>
3028
<element name="popUpDialogOK" type="button" selector="//*[@class='modal-footer']//*[contains(text(),'OK')]"/>
29+
<element name="taxRateMultiSelectItems" type="block" selector=".mselect-list-item"/>
3130
</section>
3231
</sections>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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="AdminCreateTaxRateAllPostCodesTest">
12+
<annotations>
13+
<stories value="Create tax rate"/>
14+
<title value="Create tax rate, all postcodes"/>
15+
<description value="Tests log into Create tax rate and create all postcodes"/>
16+
<testCaseId value="MC-5318"/>
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="clickFirstRow"/>
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 * for postcodes -->
37+
<click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/>
38+
<fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/>
39+
<fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="fillPostCode"/>
40+
<selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="selectCountry1"/>
41+
<fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="fillRate"/>
42+
<click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/>
43+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/>
44+
45+
<!-- Verify the tax rate grid page shows the tax rate we just created -->
46+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/>
47+
<waitForPageLoad stepKey="waitForTaxRateIndex2"/>
48+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/>
49+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/>
50+
<selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Australia" stepKey="fillCountryFilter"/>
51+
<fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="fillPostCodeFilter"/>
52+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/>
53+
<see selector="{{AdminTaxRateGridSection.grid}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName"/>
54+
<see selector="{{AdminTaxRateGridSection.grid}}" userInput="Australia" stepKey="seeCountry"/>
55+
<see selector="{{AdminTaxRateGridSection.grid}}" userInput="*" stepKey="seePostCode"/>
56+
57+
<!-- Go to the tax rate edit page for our new tax rate -->
58+
<amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex3"/>
59+
<waitForPageLoad stepKey="waitForTaxRateIndex3"/>
60+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/>
61+
<fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter2"/>
62+
<click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/>
63+
<click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
64+
65+
<!-- Verify we see expected values on the tax rate edit page -->
66+
<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"/>
69+
<seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="seeRate"/>
70+
71+
<!-- Go to the tax rule grid page and verify our tax rate can be used in the rule -->
72+
<amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/>
73+
<waitForPageLoad stepKey="waitForTaxRuleIndex"/>
74+
<click selector="{{AdminGridMainControls.add}}" stepKey="clickAddNewTaxRule"/>
75+
<see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/>
76+
</test>
77+
</tests>

0 commit comments

Comments
 (0)