Skip to content

Commit ad2d855

Browse files
glo74186Manjusha.S
authored andcommitted
AC-3895 : Verify Tax is calculated based on Tax Rule even if all Shipping methods are disabled
1 parent 6863f95 commit ad2d855

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminVerifyTaxIsCalculatedCorrectlyIfShippingMethodsAreDisabledTest">
11+
<annotations>
12+
<features value="Tax is calculated based on Tax Rule"/>
13+
<stories value="Verify Tax is calculated based on Tax Rule even if all Shipping methods are disabled"/>
14+
<title value="Verify Tax is calculated based on Tax Rule"/>
15+
<description value="Verify Tax is calculated based on Tax Rule even if all Shipping methods are disabled"/>
16+
<testCaseId value="AC-3895"/>
17+
<severity value="MAJOR"/>
18+
</annotations>
19+
<before>
20+
<!-- Create category -->
21+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
22+
<!--Create Product-->
23+
<createData entity="SimpleProduct2" stepKey="createProduct">
24+
<field key="price">100</field>
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<!-- Disable shipping method -->
28+
<createData entity="DisableFlatRateShippingMethodConfig" stepKey="disableFlatRate"/>
29+
<!-- reindex -->
30+
<magentoCLI command="cron:run --group=index" stepKey="runCronReindex"/>
31+
</before>
32+
<after>
33+
<!-- delete created product -->
34+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
35+
<!-- delete created category -->
36+
<deleteData createDataKey="createCategory" stepKey="deleteCategory1"/>
37+
<!-- delete created Tax Rate & Rule -->
38+
<!-- Go to the tax rule page and delete the row created-->
39+
<actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulesPage"/>
40+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule">
41+
<argument name="name" value="SampleRule"/>
42+
<argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/>
43+
</actionGroup>
44+
<!-- Go to the tax rate page -->
45+
<actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRatesPage"/>
46+
<!-- Delete the tax rate that was created -->
47+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteCARate">
48+
<argument name="name" value="{{SimpleTaxCA.state}}-{{SimpleTaxCA.rate}}"/>
49+
<argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/>
50+
</actionGroup>
51+
<!-- Revert back configuration -->
52+
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
53+
<!-- reindex and flush cache -->
54+
<magentoCron groups="index" stepKey="reindex"/>
55+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache">
56+
<argument name="tags" value="full_page"/>
57+
</actionGroup>
58+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
59+
</after>
60+
<!-- Login to backend -->
61+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
62+
<!-- Go to tax rule page -->
63+
<actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulePage"/>
64+
<click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/>
65+
<fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/>
66+
<!-- Add CA tax rule -->
67+
<actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate">
68+
<argument name="taxCode" value="SimpleTaxCA"/>
69+
</actionGroup>
70+
<click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/>
71+
<!-- reindex and flush cache -->
72+
<magentoCron groups="index" stepKey="reindexAgain"/>
73+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
74+
<argument name="tags" value="full_page"/>
75+
</actionGroup>
76+
<!-- Go to storefront product page -->
77+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage">
78+
<argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/>
79+
</actionGroup>
80+
<!--Add to cart -->
81+
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product2AddToCart"/>
82+
<!--Click on mini cart-->
83+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
84+
<!--Click on view and edit cart link-->
85+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMiniCart"/>
86+
<waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/>
87+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
88+
<!-- Fill shipping and tax details-->
89+
<actionGroup ref="StorefrontCheckoutCartFillEstimateShippingAndTaxActionGroup" stepKey="setEstimateShippingAndTaxAddressToUnitedStates">
90+
<argument name="country" value="United States"/>
91+
<argument name="state" value="California"/>
92+
<argument name="postcode" value="90310"/>
93+
</actionGroup>
94+
<!-- Assert tax and order amount -->
95+
<see selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="8.25" stepKey="assertTaxAmount"/>
96+
<actionGroup ref="AssertStorefrontShoppingCartSummaryItemsActionGroup" stepKey="assertCartTotals">
97+
<argument name="subtotal" value="$100.00"/>
98+
<argument name="total" value="$108.25"/>
99+
</actionGroup>
100+
101+
</test>
102+
</tests>
103+

0 commit comments

Comments
 (0)