Skip to content

Commit 7f9132e

Browse files
committed
Merge remote-tracking branch 'origin/MC-23788' into 2.4-develop-pr13
2 parents 5f64dce + 55ea628 commit 7f9132e

16 files changed

+293
-15
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutCartItemsActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
<argument name="subtotal" type="string"/>
2020
<argument name="qty" type="string"/>
2121
</arguments>
22-
22+
2323
<see selector="{{CheckoutCartProductSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInCheckoutSummary"/>
24-
<see selector="{{CheckoutCartProductSection.checkoutCartProductPrice}}" userInput="{{productPrice}}" stepKey="seeProductPriceInCart"/>
25-
<see selector="{{CheckoutCartProductSection.checkoutCartSubtotal}}" userInput="{{subtotal}}" stepKey="seeSubtotalPrice"/>
26-
<seeInField selector="{{CheckoutCartProductSection.qtyByContains(productSku)}}" userInput="{{qty}}" stepKey="seeProductQuantity"/>
24+
<see selector="{{CheckoutCartProductSection.ProductPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="seeProductPriceInCart"/>
25+
<see selector="{{CheckoutCartProductSection.productSubtotalByName(productName)}}" userInput="{{subtotal}}" stepKey="seeSubtotalPrice"/>
26+
<seeInField selector="{{CheckoutCartProductSection.ProductQuantityByName(productName)}}" userInput="{{qty}}" stepKey="seeProductQuantity"/>
2727
</actionGroup>
2828
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AssertStorefrontCartItemExcludingTaxActionGroup">
12+
<annotations>
13+
<description>Validates that the provided product price and subtotal excluding tax are present and correct in the Shopping Cart.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/>
17+
<argument name="productPriceExcludingTax" defaultValue="150" type="string"/>
18+
<argument name="productSubtotalExcludingTax" defaultValue="150" type="string"/>
19+
</arguments>
20+
21+
<see userInput="{{productPriceExcludingTax}}" selector="{{StorefrontCheckoutCartItemTaxSection.productPriceExcludingTaxByName(productName)}}" stepKey="assertProductPriceExcludingTax"/>
22+
<see userInput="{{productSubtotalExcludingTax}}" selector="{{StorefrontCheckoutCartItemTaxSection.productSubtotalExcludingTaxByName(productName)}}" stepKey="assertProductSubtotalExcludingTax"/>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="AssertStorefrontShoppingCartSummaryItemsExcludingAndIncludingTaxActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Subtotal/Total excluding and including tax are present and correct on shopping cart page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="subtotalExcludingTax" defaultValue="100" type="string"/>
17+
<argument name="subtotalIncludingTax" defaultValue="108.25" type="string"/>
18+
<argument name="tax" defaultValue="8.25" type="string"/>
19+
<argument name="total" defaultValue="113.25" type="string"/>
20+
</arguments>
21+
22+
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/>
23+
<waitForElementVisible selector="{{CheckoutCartSummarySection.subtotalExcludingTax}}" stepKey="waitForSubtotalVisible"/>
24+
<see selector="{{CheckoutCartSummarySection.subtotalExcludingTax}}" userInput="{{subtotalExcludingTax}}" stepKey="assertSubtotalExcludingTax"/>
25+
<see selector="{{CheckoutCartSummarySection.subtotalIncludingTax}}" userInput="{{subtotalIncludingTax}}" stepKey="assertSubtotalIncludingTax"/>
26+
<see selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="{{tax}}" stepKey="assertTaxAmount"/>
27+
<waitForElementVisible selector="{{CheckoutCartSummarySection.total}}" stepKey="waitForTotalVisible"/>
28+
<waitForElementVisible selector="{{CheckoutCartSummarySection.totalAmount(total)}}" stepKey="waitForTotalAmountVisible"/>
29+
<see selector="{{CheckoutCartSummarySection.total}}" userInput="{{total}}" stepKey="assertTotal"/>
30+
<seeElement selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="seeProceedToCheckoutButton"/>
31+
</actionGroup>
32+
</actionGroups>

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
<data key="value">*</data>
1717
</entity>
1818
<!-- Shopping Cart Display Settings -->
19+
<entity name="IncludeAndExcludeTaxInCartPrice" type="priceCart">
20+
<data key="value">3</data>
21+
</entity>
22+
<entity name="IncludeAndExcludeTaxInCartSubtotal" type="subtotalCart">
23+
<data key="value">3</data>
24+
</entity>
1925
<entity name="IncludeTaxInOrderTotalCart" type="grandtotalCart">
2026
<data key="value">1</data>
2127
</entity>
@@ -57,6 +63,22 @@
5763
<entity name="EmptyField" type="taxPostCodeEmpty">
5864
<data key="value"/>
5965
</entity>
66+
<entity name="TaxConfigExcludeAndIncludeTaxInCart" type="tax_config_state">
67+
<!-- Shopping Cart Display Settings -->
68+
<requiredEntity type="priceCart">IncludeAndExcludeTaxInCartPrice</requiredEntity>
69+
<requiredEntity type="subtotalCart">IncludeAndExcludeTaxInCartSubtotal</requiredEntity>
70+
</entity>
71+
<!-- Orders, Invoices, Credit Memos Display Settings-->
72+
<entity name="IncludeAndExcludeTaxInSalesPrice" type="priceSales">
73+
<data key="value">3</data>
74+
</entity>
75+
<entity name="IncludeAndExcludeTaxInSalesSubtotal" type="subtotalSales">
76+
<data key="value">3</data>
77+
</entity>
78+
<entity name="TaxConfigExcludeAndIncludeTaxInSales" type="tax_config_state">
79+
<requiredEntity type="priceSales">IncludeAndExcludeTaxInSalesPrice</requiredEntity>
80+
<requiredEntity type="subtotalSales">IncludeAndExcludeTaxInSalesSubtotal</requiredEntity>
81+
</entity>
6082
<entity name="DefaultProductTaxClass">
6183
<!-- Default value -->
6284
<data key="path">tax/classes/default_product_tax_class</data>

app/code/Magento/Tax/Test/Mftf/Metadata/tax_config-meta.xml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@
2424
</object>
2525
<object key="cart_display" dataType="tax_config_state">
2626
<object key="fields" dataType="tax_config_state">
27-
<object key="grandtotal" dataType="grandtotalCart">
28-
<field key="value">string</field>
29-
</object>
27+
<object key="price" dataType="priceCart">
28+
<field key="value">string</field>
29+
</object>
30+
<object key="subtotal" dataType="subtotalCart">
31+
<field key="value">string</field>
32+
</object>
33+
<object key="grandtotal" dataType="grandtotalCart">
34+
<field key="value">string</field>
35+
</object>
3036
<object key="full_summary" dataType="full_summaryCart">
3137
<field key="value">string</field>
3238
</object>
@@ -35,6 +41,16 @@
3541
</object>
3642
</object>
3743
</object>
44+
<object key="sales_display" dataType="tax_config_state">
45+
<object key="fields" dataType="tax_config_state">
46+
<object key="price" dataType="priceSales">
47+
<field key="value">string</field>
48+
</object>
49+
<object key="subtotal" dataType="subtotalSales">
50+
<field key="value">string</field>
51+
</object>
52+
</object>
53+
</object>
3854
</object>
3955
</operation>
4056
<operation name="TaxConfigDefaultsTaxDestination" dataType="tax_config_default" type="create" auth="adminFormKey" url="/admin/system_config/save/section/tax/" method="POST">
@@ -115,11 +131,15 @@
115131
<field key="value">integer</field>
116132
</object>
117133
</object>
118-
<object key="gift_wrapping" dataType="taxTotalFlagZero">
119-
<field key="value">integer</field>
134+
<object key="gift_wrapping" dataType="tax_config_default">
135+
<object key="inherit" dataType="taxTotalFlagZero">
136+
<field key="value">integer</field>
137+
</object>
120138
</object>
121-
<object key="printed_card" dataType="taxTotalFlagZero">
122-
<field key="value">integer</field>
139+
<object key="printed_card" dataType="tax_config_default">
140+
<object key="inherit" dataType="taxTotalFlagZero">
141+
<field key="value">integer</field>
142+
</object>
123143
</object>
124144
<object key="grandtotal" dataType="tax_config_default">
125145
<object key="inherit" dataType="taxTotalFlagZero">
@@ -155,11 +175,15 @@
155175
<field key="value">integer</field>
156176
</object>
157177
</object>
158-
<object key="gift_wrapping" dataType="taxTotalFlagZero">
159-
<field key="value">integer</field>
178+
<object key="gift_wrapping" dataType="tax_config_default">
179+
<object key="inherit" dataType="taxTotalFlagZero">
180+
<field key="value">integer</field>
181+
</object>
160182
</object>
161-
<object key="printed_card" dataType="taxTotalFlagZero">
162-
<field key="value">integer</field>
183+
<object key="printed_card" dataType="tax_config_default">
184+
<object key="inherit" dataType="taxTotalFlagZero">
185+
<field key="value">integer</field>
186+
</object>
163187
</object>
164188
<object key="grandtotal" dataType="tax_config_default">
165189
<object key="inherit" dataType="taxTotalFlagZero">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="CheckoutCartPage" url="/checkout/cart" module="Magento_Checkout" area="storefront">
12+
<section name="StorefrontCheckoutCartItemTaxSection"/>
13+
</page>
14+
</pages>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<element name="taxAmount" type="text" selector="[data-th='Tax']>span"/>
1313
<element name="taxSummary" type="text" selector=".totals-tax-summary"/>
1414
<element name="rate" type="text" selector=" tr.totals-tax-details.shown th.mark"/>
15+
<element name="subtotalExcludingTax" type="text" selector="#cart-totals .totals.sub.excl span.price"/>
16+
<element name="subtotalIncludingTax" type="text" selector="#cart-totals .totals.sub.incl span.price"/>
1517
</section>
1618
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="StorefrontCheckoutCartItemTaxSection">
12+
<element name="productPriceExcludingTaxByName" type="text" selector="//a[contains(text(),'{{productName}}')]/ancestor::tr//td[contains(@class, 'price')]//span[contains(@class,'price-excluding-tax')]//span[contains(@class,'cart-tax-total')]" parameterized="true"/>
13+
<element name="productSubtotalExcludingTaxByName" type="text" selector="//a[contains(text(),'{{productName}}')]/ancestor::tr//td[contains(@class, 'subtotal')]//span[contains(@class,'price-excluding-tax')]//span[contains(@class,'cart-tax-total')]" parameterized="true"/>
14+
</section>
15+
</sections>
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="AssertStorefrontCartItemExcludingTaxWithWeeeAttributeActionGroup" extends="AssertStorefrontCartItemExcludingTaxActionGroup">
12+
<annotations>
13+
<description>Validates that the provided product price, subtotal, weee attribute value excluding tax are present and correct in the Shopping Cart.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="weeePrice" defaultValue="50" type="string"/>
17+
<argument name="weeeSubtotal" defaultValue="50" type="string"/>
18+
</arguments>
19+
20+
<click selector="{{StorefrontCheckoutCartItemTaxSection.productPriceExcludingTaxByName(productName)}}" after="assertProductSubtotalExcludingTax" stepKey="clickOnItemPriceExcludingTax"/>
21+
<see userInput="{{weeePrice}}" selector="{{StorefrontCheckoutCartItemWeeeSection.productWeeePriceExcludingTaxByName(productName)}}" after="clickOnItemPriceExcludingTax" stepKey="assertProductWeeeExcludingTax"/>
22+
<click selector="{{StorefrontCheckoutCartItemTaxSection.productSubtotalExcludingTaxByName(productName)}}" after="assertProductWeeeExcludingTax" stepKey="clickOnItemSubtotalExcludingTax"/>
23+
<see userInput="{{weeeSubtotal}}" selector="{{StorefrontCheckoutCartItemWeeeSection.productWeeeSubtotalExcludingTaxByName(productName)}}" after="clickOnItemSubtotalExcludingTax" stepKey="assertProductWeeeSubtotalExcludingTax"/>
24+
</actionGroup>
25+
</actionGroups>
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="AssertStorefrontCartItemWithWeeeAttributeActionGroup" extends="AssertStorefrontCheckoutCartItemsActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Product details (Name and Price), Product Quantity, Weee Attribute data are present and correct in the Shopping Cart.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="weeePrice" defaultValue="50" type="string"/>
17+
<argument name="weeeSubtotal" defaultValue="50" type="string"/>
18+
</arguments>
19+
20+
<click selector="{{CheckoutCartProductSection.ProductPriceByName(productName)}}" after="seeProductQuantity" stepKey="clickOnItemPrice"/>
21+
<see userInput="{{weeePrice}}" selector="{{StorefrontCheckoutCartItemWeeeSection.productWeeePriceByName(productName)}}" after="clickOnItemPrice" stepKey="assertProductWeee"/>
22+
<click selector="{{CheckoutCartProductSection.productSubtotalByName(productName)}}" after="assertProductWeee" stepKey="clickOnItemSubtotal"/>
23+
<see userInput="{{weeeSubtotal}}" selector="{{StorefrontCheckoutCartItemWeeeSection.productWeeeSubtotalByName(productName)}}" after="clickOnItemSubtotal" stepKey="assertProductWeeeSubtotal"/>
24+
</actionGroup>
25+
</actionGroups>

0 commit comments

Comments
 (0)