Skip to content

Commit 360f6f2

Browse files
committed
ACP2E-1580: Tax and Shipping Estimator in the Cart not reflecting default destination configuration
1 parent 1a250eb commit 360f6f2

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="AdminResetDefaultTaxDestinationActionGroup">
12+
<annotations>
13+
<description>Reset admin entries (country, state, postcode) for default tax destination calculation</description>
14+
</annotations>
15+
16+
<!-- navigate to the tax configuration page -->
17+
<amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPageForReset"/>
18+
<waitForPageLoad stepKey="waitForTaxConfigToReset"/>
19+
<!-- reset tax destination calculation settings -->
20+
<scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaultsForReset"/>
21+
<checkOption selector="{{AdminConfigureTaxSection.systemValueDefaultCountry}}" stepKey="clickToResetDefaultCountry"/>
22+
<checkOption selector="{{AdminConfigureTaxSection.systemValueDefaultState}}" stepKey="clickToResetDefaultState"/>
23+
<fillField selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="" stepKey="fillToResetDefaultPostCode"/>
24+
<scrollToTopOfPage stepKey="scrollToTop"/>
25+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveChangesToReset"/>
26+
<waitForText userInput='You saved the configuration.' stepKey="waitForTextAfterReset"/>
27+
</actionGroup>
28+
</actionGroups>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AdminSetDefaultTaxDestinationActionGroup">
12+
<annotations>
13+
<description>Set admin entries (country, state, postcode) for default tax destination calculation</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
17+
<argument name="state" type="string" defaultValue="*"/>
18+
<argument name="postcode" type="string" defaultValue=""/>
19+
</arguments>
20+
21+
<!-- navigate to the tax configuration page -->
22+
<amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/>
23+
<waitForPageLoad stepKey="waitForTaxConfigLoad"/>
24+
<!-- change the Default Tax Destination Calculation Configurations -->
25+
<scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/>
26+
27+
<!-- conditionalClick twice to fix some flaky behavior -->
28+
<conditionalClick selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false" stepKey="clickCalculationSettings"/>
29+
<uncheckOption selector="{{AdminConfigureTaxSection.systemValueDefaultCountry}}" stepKey="clickDefaultCountry"/>
30+
<selectOption selector="{{AdminConfigureTaxSection.dropdownDefaultCountry}}" userInput="{{country}}" stepKey="selectDefaultCountry"/>
31+
<uncheckOption selector="{{AdminConfigureTaxSection.systemValueDefaultState}}" stepKey="clickDefaultState"/>
32+
<selectOption selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="{{state}}" stepKey="selectDefaultState"/>
33+
<fillField selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="{{postcode}}" stepKey="fillDefaultPostCode"/>
34+
<!-- Save the settings -->
35+
<scrollToTopOfPage stepKey="scrollToTop"/>
36+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveChanges"/>
37+
<waitForText userInput='You saved the configuration.' stepKey="waitForText"/>
38+
</actionGroup>
39+
</actionGroups>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="StorefrontEstimateShippingTaxTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Estimate Shipping Tax"/>
15+
<title value="Tax and Shipping Estimator in the Cart not reflecting default destination configuration."/>
16+
<description value="Tax and Shipping Estimator in the Cart not reflecting default destination configuration."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value=""/>
19+
<useCaseId value="ACP2E-1580"/>
20+
<group value="checkout"/>
21+
</annotations>
22+
23+
<before>
24+
<!-- Create simple product -->
25+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
</before>
28+
29+
<after>
30+
<!-- Delete simple product -->
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<!--Reset default tax destination calculation-->
33+
<actionGroup ref="AdminResetDefaultTaxDestinationActionGroup" stepKey="resetDefaultTaxDestination"/>
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
35+
</after>
36+
37+
<actionGroup ref="AdminSetDefaultTaxDestinationActionGroup" stepKey="setDefaultTaxDestination">
38+
<argument name="country" value="{{US_Address_NY.country}}"/>
39+
<argument name="state" value="{{US_Address_NY.state}}"/>
40+
<argument name="postcode" value="{{US_Address_NY.postcode}}"/>
41+
</actionGroup>
42+
43+
<!-- Add simple product to cart as Guest -->
44+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
45+
<waitForPageLoad stepKey="waitForPageLoad"/>
46+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
47+
<argument name="product" value="$$createProduct$$"/>
48+
<argument name="productCount" value="1"/>
49+
</actionGroup>
50+
51+
<!-- Go to Checkout page -->
52+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
53+
<actionGroup ref="AssertStorefrontCheckoutCartEstimateShippingAndTaxAddressActionGroup" stepKey="checkAddress">
54+
<argument name="country" value="{{US_Address_NY.country}}"/>
55+
<argument name="state" value="{{US_Address_NY.state}}"/>
56+
<argument name="postcode" value="{{US_Address_NY.postcode}}"/>
57+
</actionGroup>
58+
</test>
59+
</tests>

0 commit comments

Comments
 (0)