Skip to content

Commit baf5935

Browse files
committed
AC-3201:Display zero tax configuration does not work in case of multiple shipping methods
1 parent 2854866 commit baf5935

File tree

4 files changed

+86
-1
lines changed

4 files changed

+86
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="ZeroTaxSubtotalActionGroup">
12+
<annotations>
13+
<description>Zero tax subtotal should not be displayed on frontend after admin config setting</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionValue" type="string" defaultValue="{{DefaultTotalFlagZero.value}}"/>
17+
</arguments>
18+
<amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="navigateToAdminStoreTaxConfiguration"/>
19+
<scrollTo selector="{{AdminZeroTaxFormSection.label}}" stepKey="scrollToDropdownSelection" />
20+
<uncheckOption selector="{{AdminZeroTaxFormSection.systemValueCheckbox}}" stepKey="uncheckCheckBox" />
21+
<selectOption selector="{{AdminZeroTaxFormSection.optionvalue}}" userInput="{{optionValue}}" stepKey="setSelectorValue"/>
22+
<waitForElementVisible selector="{{AdminZeroTaxFormSection.label}}" stepKey="waitForElement"/>
23+
<click selector="{{AdminZeroTaxFormSection.saveConfig}}" stepKey="clickSave"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminZeroTaxFormSection">
12+
<element name="systemValueCheckbox" type="button" selector="#tax_cart_display_zero_tax_inherit"/>
13+
<element name="optionvalue" type="select" selector="select#tax_cart_display_zero_tax"/>
14+
<element name="saveConfig" type="button" selector="#save" timeout="30"/>
15+
<element name="label" type="input" selector="#row_tax_cart_display_zero_tax"/>
16+
</section>
17+
</sections>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="StoreFrontZeroTaxSettingCheckOnCartPage">
12+
<annotations>
13+
<stories value="Storefront cart page"/>
14+
<title value="Zero tax configuration for multiple shipping methods on Cart page"/>
15+
<description value="Zero tax configuration for multiple shipping methods on Cart page"/>
16+
<severity value="MINOR"/>
17+
<testCaseId value="AC-3201"/>
18+
<group value="Tax"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
22+
<actionGroup ref="ZeroTaxSubtotalActionGroup" stepKey="zerosubtotal"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct" stepKey="createProduct01">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
</before>
28+
<after>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
31+
<deleteData createDataKey="createProduct01" stepKey="deleteProduct1"/>
32+
</after>
33+
34+
<amOnPage url="$$createProduct01.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/>
35+
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
36+
<waitForElementClickable selector="{{StorefrontProductActionSection.addToCart}}" stepKey="waitForAddToCartButton"/>
37+
<click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/>
38+
<waitForPageLoad stepKey="waitForProductAdded"/>
39+
<see stepKey="seeSuccess" selector="{{StorefrontMessagesSection.success}}" userInput="You added"/>
40+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage" />
41+
<dontSeeElement selector="//*[@id='cart-totals']/div/table/tbody/tr[2]/th[contains(text(),'Tax')]" stepKey="checkZerotaxVisible"/>
42+
</test>
43+
</tests>

app/code/Magento/Tax/view/frontend/web/js/view/checkout/cart/totals/tax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ define([
2121
* @override
2222
*/
2323
ifShowValue: function () {
24-
if (this.getPureValue() === 0) {
24+
if (parseInt(this.getPureValue()) === 0) {
2525
return isZeroTaxDisplayed;
2626
}
2727

0 commit comments

Comments
 (0)