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