Skip to content

Commit 26cbef3

Browse files
committed
MC-256: Tax for Simple Product Quote should be recalculated according to inputted data on Checkout flow for Logged in Customer
- Includes: MC-255, MC-258, MC-259, MC-295, MC-296, MC-297, MC-298
1 parent 82901ad commit 26cbef3

22 files changed

+1372
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!-- Action group to delete an item given that items name -->
12+
<!-- Must already be on the admin page containing the grid -->
13+
<actionGroup name="deleteEntitySecondaryGrid">
14+
<arguments>
15+
<argument name="name" type="string"/>
16+
<argument name="searchInput" type="string"/>
17+
</arguments>
18+
19+
<!-- search for the name -->
20+
<click stepKey="resetFilters" selector="{{AdminSecondaryGridSection.resetFilters}}"/>
21+
<fillField stepKey="fillIdentifier" selector="{{searchInput}}" userInput="{{name}}"/>
22+
<click stepKey="searchForName" selector="{{AdminSecondaryGridSection.searchButton}}"/>
23+
<click stepKey="clickResult" selector="{{AdminSecondaryGridSection.firstRow}}"/>
24+
<waitForPageLoad stepKey="waitForTaxRateLoad"/>
25+
26+
<!-- delete the rule -->
27+
<click stepKey="clickDelete" selector="{{AdminStoresMainActionsSection.deleteButton}}"/>
28+
<click stepKey="clickOk" selector="{{AdminConfirmationModalSection.ok}}"/>
29+
<see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="deleted"/>
30+
</actionGroup>
31+
</actionGroups>
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminSecondaryGridSection">
12+
<element name="resetFilters" type="button" selector="[title='Reset Filter']"/>
13+
<element name="taxIdentifierSearch" type="input" selector=".col-code .admin__control-text"/>
14+
<element name="searchButton" type="input" selector=".admin__filter-actions [title='Search']"/>
15+
<element name="firstRow" type="block" selector="tr[data-role='row']"/>
16+
</section>
17+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,24 @@
2525
<fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/>
2626
</actionGroup>
2727

28+
<actionGroup name="LoggedInCheckoutFillNewBillingAddressActionGroup">
29+
<arguments>
30+
<argument name="Address"/>
31+
<!-- the classPrefix argument is to specifically select the inputs of the correct form
32+
this is to prevent having 3 action groups doing essentially the same thing -->
33+
<argument name="classPrefix" type="string" defaultValue=""/>
34+
</arguments>
35+
<fillField stepKey="fillFirstName" selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" userInput="{{Address.firstname}}"/>
36+
<fillField stepKey="fillLastName" selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" userInput="{{Address.lastname}}"/>
37+
<fillField stepKey="fillCompany" selector="{{classPrefix}} {{CheckoutShippingSection.company}}" userInput="{{Address.company}}"/>
38+
<fillField stepKey="fillPhoneNumber" selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" userInput="{{Address.telephone}}"/>
39+
<fillField stepKey="fillStreetAddress1" selector="{{classPrefix}} {{CheckoutShippingSection.street}}" userInput="{{Address.street[0]}}"/>
40+
<fillField stepKey="fillStreetAddress2" selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" userInput="{{Address.street[1]}}"/>
41+
<fillField stepKey="fillCityName" selector="{{classPrefix}} {{CheckoutShippingSection.city}}" userInput="{{Address.city}}"/>
42+
<selectOption stepKey="selectState" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/>
43+
<fillField stepKey="fillZip" selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" userInput="{{Address.postcode}}"/>
44+
<selectOption stepKey="selectCounty" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/>
45+
<waitForPageLoad stepKey="waitForFormUpdate2"/>
46+
</actionGroup>
47+
2848
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,15 @@
7777
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart" />
7878
<click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="clickCart" />
7979
</actionGroup>
80+
81+
<actionGroup name="changeSummaryQuoteAddress">
82+
<arguments>
83+
<argument name="taxCode"/>
84+
</arguments>
85+
<conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/>
86+
<selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/>
87+
<selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/>
88+
<fillField stepKey="fillZip" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{taxCode.zip}}"/>
89+
<waitForPageLoad stepKey="waitForFormUpdate"/>
90+
</actionGroup>
8091
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutPaymentSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,10 @@
4141
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
4242
<element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{var1}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/>
4343
<element name="productOptionsActiveByProductItemPrice" type="text" selector="//div[@class='subtotal']//span[@class='price'][contains(.,'{{var1}}')]//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true"/>
44+
45+
<element name="tax" type="text" selector="[data-th='Tax'] span" timeout="30"/>
46+
<element name="taxPercentage" type="text" selector=".totals-tax-details .mark"/>
47+
<element name="orderSummaryTotalIncluding" type="text" selector="//tr[@class='grand totals incl']//span[@class='price']" />
48+
<element name="orderSummaryTotalExcluding" type="text" selector="//tr[@class='grand totals excl']//span[@class='price']" />
4449
</section>
4550
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutShippingSection.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,26 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="CheckoutShippingSection">
1212
<element name="isShippingStep" type="text" selector="//*[@class='opc-progress-bar']/li[contains(@class, '_active') and span[contains(.,'Shipping')]]"/>
13+
<element name="shippingTab" type="text" selector="//li[contains(@class,'opc-progress-bar-item')]//*[text()='Shipping']" timeout="30"/>
1314
<element name="selectedShippingAddress" type="text" selector=".shipping-address-item.selected-item"/>
14-
<element name="newAddressButton" type="button" selector="#checkout-step-shipping button"/>
15+
<element name="editAddressButton" type="button" selector=".action-edit-address" timeout="30"/>
16+
<element name="addressDropdown" type="select" selector="[name=billing_address_id]"/>
17+
<element name="newAddressButton" type="button" selector=".action-show-popup" timeout="30"/>
1518
<element name="email" type="input" selector="#customer-email"/>
1619
<element name="firstName" type="input" selector="input[name=firstname]"/>
1720
<element name="lastName" type="input" selector="input[name=lastname]"/>
21+
<element name="company" type="input" selector="input[name=company]"/>
1822
<element name="street" type="input" selector="input[name='street[0]']"/>
23+
<element name="street2" type="input" selector="input[name='street[1]']"/>
1924
<element name="city" type="input" selector="input[name=city]"/>
2025
<element name="region" type="select" selector="select[name=region_id]"/>
2126
<element name="postcode" type="input" selector="input[name=postcode]"/>
27+
<element name="country" type="select" selector="select[name=country_id]"/>
2228
<element name="telephone" type="input" selector="input[name=telephone]"/>
23-
<element name="next" type="button" selector="button.button.action.continue.primary"/>
29+
<element name="saveAddress" type="button" selector=".action-save-address"/>
30+
<element name="updateAddress" type="button" selector=".action-update"/>
31+
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
2432
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
33+
<element name="defaultShipping" type="button" selector=".billing-address-details"/>
2534
</section>
2635
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,25 @@
2424
<see stepKey="seeLastName" userInput="{{Customer.lastname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
2525
<see stepKey="seeEmail" userInput="{{Customer.email}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
2626
</actionGroup>
27+
28+
<actionGroup name="EnterCustomerAddressInfo">
29+
<arguments>
30+
<argument name="Address"/>
31+
</arguments>
32+
33+
<amOnPage url="customer/address/new/" stepKey="goToAddressPage"/>
34+
<waitForPageLoad stepKey="waitForAddressPage"/>
35+
<fillField stepKey="fillFirstName" selector="{{StorefrontCustomerAddressSection.firstName}}" userInput="{{Address.firstname}}"/>
36+
<fillField stepKey="fillLastName" selector="{{StorefrontCustomerAddressSection.lastName}}" userInput="{{Address.lastname}}"/>
37+
<fillField stepKey="fillCompany" selector="{{StorefrontCustomerAddressSection.company}}" userInput="{{Address.company}}"/>
38+
<fillField stepKey="fillPhoneNumber" selector="{{StorefrontCustomerAddressSection.phoneNumber}}" userInput="{{Address.telephone}}"/>
39+
<fillField stepKey="fillStreetAddress1" selector="{{StorefrontCustomerAddressSection.streetAddress1}}" userInput="{{Address.street[0]}}"/>
40+
<fillField stepKey="fillStreetAddress2" selector="{{StorefrontCustomerAddressSection.streetAddress2}}" userInput="{{Address.street[1]}}"/>
41+
<fillField stepKey="fillCityName" selector="{{StorefrontCustomerAddressSection.city}}" userInput="{{Address.city}}"/>
42+
<selectOption stepKey="selectState" selector="{{StorefrontCustomerAddressSection.stateProvince}}" userInput="{{Address.state}}"/>
43+
<fillField stepKey="fillZip" selector="{{StorefrontCustomerAddressSection.zip}}" userInput="{{Address.postcode}}"/>
44+
<selectOption stepKey="selectCounty" selector="{{StorefrontCustomerAddressSection.country}}" userInput="{{Address.country_id}}"/>
45+
46+
<click stepKey="saveAddress" selector="{{StorefrontCustomerAddressSection.saveAddress}}"/>
47+
</actionGroup>
2748
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Data/AddressData.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,38 @@
4949
<data key="default_shipping">Yes</data>
5050
<requiredEntity type="region">RegionTX</requiredEntity>
5151
</entity>
52+
<entity name="US_Address_NY" type="address">
53+
<data key="firstname">John</data>
54+
<data key="lastname">Doe</data>
55+
<data key="company">368</data>
56+
<array key="street">
57+
<item>368 Broadway St.</item>
58+
<item>113</item>
59+
</array>
60+
<data key="city">New York</data>
61+
<data key="state">New York</data>
62+
<data key="country_id">US</data>
63+
<data key="postcode">10001</data>
64+
<data key="telephone">512-345-6789</data>
65+
<data key="default_billing">Yes</data>
66+
<data key="default_shipping">Yes</data>
67+
<requiredEntity type="region">RegionNY</requiredEntity>
68+
</entity>
69+
<entity name="US_Address_CA" type="address">
70+
<data key="firstname">John</data>
71+
<data key="lastname">Doe</data>
72+
<data key="company">Magento</data>
73+
<array key="street">
74+
<item>7700 West Parmer Lane</item>
75+
<item>113</item>
76+
</array>
77+
<data key="city">Los Angeles</data>
78+
<data key="state">California</data>
79+
<data key="country_id">US</data>
80+
<data key="postcode">90001</data>
81+
<data key="telephone">512-345-6789</data>
82+
<data key="default_billing">Yes</data>
83+
<data key="default_shipping">Yes</data>
84+
<requiredEntity type="region">RegionCA</requiredEntity>
85+
</entity>
5286
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Data/CustomerData.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,32 @@
4545
<data key="website_id">0</data>
4646
<requiredEntity type="address">US_Address_TX</requiredEntity>
4747
</entity>
48+
<entity name="Simple_US_Customer_NY" type="customer">
49+
<data key="group_id">0</data>
50+
<data key="default_billing">true</data>
51+
<data key="default_shipping">true</data>
52+
<data key="email" unique="prefix">John.Doe@example.com</data>
53+
<data key="firstname">John</data>
54+
<data key="lastname">Doe</data>
55+
<data key="fullname">John Doe</data>
56+
<data key="password">pwdTest123!</data>
57+
<data key="store_id">0</data>
58+
<data key="website_id">0</data>
59+
<requiredEntity type="address">US_Address_NY</requiredEntity>
60+
</entity>
61+
<entity name="Simple_US_Customer_CA" type="customer">
62+
<data key="group_id">0</data>
63+
<data key="default_billing">true</data>
64+
<data key="default_shipping">true</data>
65+
<data key="email" unique="prefix">John.Doe@example.com</data>
66+
<data key="firstname">John</data>
67+
<data key="lastname">Doe</data>
68+
<data key="fullname">John Doe</data>
69+
<data key="password">pwdTest123!</data>
70+
<data key="store_id">0</data>
71+
<data key="website_id">0</data>
72+
<requiredEntity type="address">US_Address_CA</requiredEntity>
73+
</entity>
4874
<entity name="Simple_US_Customer_For_Update" type="customer">
4975
<var key="id" entityKey="id" entityType="customer"/>
5076
<data key="firstname">Jane</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Data/RegionData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
<data key="region_code">TX</data>
1818
<data key="region_id">1</data>
1919
</entity>
20+
<entity name="RegionCA" type="region">
21+
<data key="region">California</data>
22+
<data key="region_code">CA</data>
23+
<data key="region_id">2</data>
24+
</entity>
25+
<entity name="RegionNY" type="region">
26+
<data key="region">New York</data>
27+
<data key="region_code">NY</data>
28+
<data key="region_id">3</data>
29+
</entity>
2030
</entities>

0 commit comments

Comments
 (0)