Skip to content

Commit 8874953

Browse files
MAGETWO-91521: Reports / Sales / Tax report show incorrect amount
- Update automated test
1 parent 060cbba commit 8874953

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
<data key="rate">0</data>
2828
</entity>
2929
<entity name="SimpleTaxWithZipCode" type="tax">
30-
<data key="state">California</data>
30+
<data key="state">Texas</data>
3131
<data key="country">United States</data>
3232
<data key="zip">78729</data>
3333
<data key="rate">7.25</data>
3434
</entity>
3535
<entity name="SimpleSecondTaxWithZipCode" type="tax">
36-
<data key="state">California</data>
36+
<data key="state">Texas</data>
3737
<data key="country">United States</data>
3838
<data key="zip">78729</data>
3939
<data key="rate">0.125</data>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<element name="country" type="select" selector="#tax_country_id"/>
2020
<element name="rate" type="input" selector="#rate"/>
2121
<element name="save" type="button" selector=".action-save" timeout="30"/>
22+
<element name="saveRule" type="button" selector="#save" timeout="30"/>
2223
<element name="additionalSettings" type="button" selector="#details-summarybase_fieldset"/>
2324
<element name="productAddNewTaxClass" type="button" selector="//*[@id='tax_product_class']/following-sibling::section//*[contains(text(),'Add New Tax Class')]"/>
2425
<element name="fieldProdNewTaxClass" type="input" selector="//*[@id='tax_product_class']/following-sibling::section//input[@class='mselect-input']"/>

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
</actionGroup>
3636

3737
<click stepKey="disableDefaultProdTaxClass" selector="{{AdminTaxRulesSection.defaultTaxClass}}"/>
38-
39-
<click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/>
38+
<waitForPageLoad stepKey="waitForTaxRulePage"/>
39+
<click stepKey="clickSave" selector="{{AdminTaxRulesSection.saveRule}}"/>
4040
<waitForPageLoad stepKey="waitForNewTaxRuleCreated"/>
4141

4242
<!-- Go to tax rule page to create second Tax Rule-->
@@ -52,7 +52,8 @@
5252
</actionGroup>
5353

5454
<click stepKey="disableSecondProdTaxClass" selector="{{AdminTaxRulesSection.defaultTaxClass}}"/>
55-
<click stepKey="clickSaveBtn" selector="{{AdminStoresMainActionsSection.saveButton}}"/>
55+
<waitForPageLoad stepKey="waitForTaxRulePage2"/>
56+
<click stepKey="clickSaveBtn" selector="{{AdminTaxRulesSection.saveRule}}"/>
5657
<waitForPageLoad stepKey="waitForSecondTaxRuleCreated"/>
5758

5859
<createData entity="_defaultCategory" stepKey="createCategory"/>
@@ -97,7 +98,7 @@
9798
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
9899
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
99100
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
100-
101+
<waitForPageLoad stepKey="waitForPage" time="60"/>
101102
<!--Check if order can be submitted without the required fields including email address-->
102103
<scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seeNewOrderPageTitle"/>
103104
<actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage">
@@ -145,31 +146,31 @@
145146

146147
<!--click "here" to refresh last day's statistics -->
147148
<click stepKey="clickRefrashStatisticsHere" selector="{{AdminTaxReportsSection.refreshStatistics}}"/>
148-
<waitForPageLoad stepKey="waitForRefrash"/>
149+
<waitForPageLoad stepKey="waitForRefresh"/>
149150

150151
<!--Select Dates-->
151152
<fillField selector="{{AdminTaxReportsSection.fromDate}}" userInput="05/16/2018" stepKey="fillDateFrom"/>
152153
<click selector="{{AdminTaxReportsSection.toDate}}" stepKey="clickDateTo"/>
153154
<click selector="{{AdminTaxReportsSection.goTodayButton}}" stepKey="clickGoTodayDate"/>
154155
<!--Click "Show report" in the upper right corner.-->
155156
<click selector="{{AdminTaxReportsSection.showReportButton}}" stepKey="clickShowReportButton"/>
156-
157+
<waitForPageLoad time="60" stepKey="waitForReload"/>
157158
<!--Tax Report Grid displays Tax amount in rows. "Total" and "Subtotal" is a sum of all tax amounts-->
158-
<grabTextFrom selector="{{AdminTaxReportsSection.taxRuleAmount('TaxRate1')}}" stepKey="amountOfFirstTaxRate"/>
159-
<grabTextFrom selector="{{AdminTaxReportsSection.taxRuleAmount('TaxRate2')}}" stepKey="amountOfSecondTaxRate"/>
159+
<grabTextFrom selector="{{AdminTaxReportsSection.taxRuleAmount('Texas-0.125')}}" stepKey="amountOfFirstTaxRate"/>
160+
<grabTextFrom selector="{{AdminTaxReportsSection.taxRuleAmount('Texas-7.25')}}" stepKey="amountOfSecondTaxRate"/>
160161
<grabTextFrom selector="{{AdminTaxReportsSection.taxRuleAmount('Subtotal')}}" stepKey="amountOfSubtotalTaxRate"/>
161162
<assertEquals stepKey="assertSubtotalFirstField">
162-
<expectedResult type="string">$0.87</expectedResult>
163+
<expectedResult type="string">$0.15</expectedResult>
163164
<actualResult type="variable">amountOfFirstTaxRate</actualResult>
164165
</assertEquals>
165166

166167
<assertEquals stepKey="assertSubtotalSecondField">
167-
<expectedResult type="string">$0.02</expectedResult>
168+
<expectedResult type="string">$8.92</expectedResult>
168169
<actualResult type="variable">amountOfSecondTaxRate</actualResult>
169170
</assertEquals>
170171

171172
<assertEquals stepKey="assertSubtotalField">
172-
<expectedResult type="string">$0.89</expectedResult>
173+
<expectedResult type="string">$9.07</expectedResult>
173174
<actualResult type="variable">amountOfSubtotalTaxRate</actualResult>
174175
</assertEquals>
175176

0 commit comments

Comments
 (0)