Skip to content

Commit 793ccbf

Browse files
ACQE-5756: shipping address changes will changes the tax rate
1 parent 97e33f5 commit 793ccbf

12 files changed

+298
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AddCostPriceToProductActionGroup">
12+
<annotations>
13+
<description>Sets the provided Cost Price on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="price" type="string" defaultValue="10"/>
17+
</arguments>
18+
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
21+
<waitForPageLoad stepKey="waitForAdvancedPricingModal"/>
22+
<waitForElementVisible selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="waitCostPrice"/>
23+
<fillField userInput="{{price}}" selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="fillCostPrice"/>
24+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
25+
<waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,4 +1488,35 @@
14881488
<data key="name">Simple Product with special characters in SKU</data>
14891489
<data key="sku">s000&amp;01</data>
14901490
</entity>
1491+
<entity name="simpleProductwithTaxNone" type="product">
1492+
<data key="name" unique="suffix">Product1</data>
1493+
<data key="sku" unique="suffix">product-1</data>
1494+
<data key="urlKey" unique="suffix">product1</data>
1495+
<data key="price">200.00</data>
1496+
<data key="quantity">100</data>
1497+
<data key="status">1</data>
1498+
<data key="cost">150.00</data>
1499+
<data key="productTaxClass">None</data>
1500+
<data key="type_id">simple</data>
1501+
<data key="attribute_set_id">4</data>
1502+
<data key="weight">1</data>
1503+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1504+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1505+
</entity>
1506+
<entity name="simpleProductwithTaxGoods" type="product">
1507+
<data key="urlKey" unique="suffix">product2</data>
1508+
<data key="name" unique="suffix">Product2</data>
1509+
<data key="sku" unique="suffix">product-2</data>
1510+
<data key="price">300.00</data>
1511+
<data key="quantity">300</data>
1512+
<data key="status">1</data>
1513+
<data key="storefrontStatus">IN STOCK</data>
1514+
<data key="cost">250.00</data>
1515+
<data key="productTaxClass">Taxable Goods</data>
1516+
<data key="type_id">simple</data>
1517+
<data key="attribute_set_id">4</data>
1518+
<data key="weight">1</data>
1519+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1520+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1521+
</entity>
14911522
</entities>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminProductFormCostPricingSection">
11+
<element name="costPrice" type="input" selector="input[name='product[cost]']"/>
12+
<element name="doneButton" type="button" selector=".product_form_product_form_advanced_pricing_modal button.action-primary" timeout="30"/>
13+
</section>
14+
</sections>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="ResetCalculationClassForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Tax Calculation Method Based On'. Sets 'Unit Price' to 'Total'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="taxCalculationMethod" type="string" defaultValue="Total"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxConfigPagetoReset"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
<click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="openTaxCalculationSettingsSection"/>
22+
<waitForElementVisible selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="seeShippingTaxClass"/>
23+
<checkOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="uncheckUseSystemValue"/>
24+
<selectOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
25+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
26+
<waitForPageLoad stepKey="waitForConfigSaved"/>
27+
<click selector="{{AdminConfigureTaxSection.taxCalculationSettingsOpened}}" stepKey="closeTaxCalcSettingsSection"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="ResetIncludeTaxInTotalForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Orders, Invoices, Credit Memos Display Settings'. Sets 'Yes' to 'No'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="showOrderTotalWithoutTax" type="string" defaultValue="No"/>
17+
<argument name="displayFullTax" type="string" defaultValue="No"/>
18+
<argument name="displayZeroTax" type="string" defaultValue="No"/>
19+
</arguments>
20+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
21+
<waitForPageLoad stepKey="waitForPageLoad"/>
22+
<click selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" stepKey="openOrdersInvoicesCreditSales"/>
23+
<waitForElementVisible selector="{{AdminConfigureTaxSection.taxSalesDisplaySubtotal}}" stepKey="taxSalesDisplaySubtotal"/>
24+
<checkOption selector="{{AdminConfigureTaxSection.taxSalesDisplaySubtotal}}" stepKey="displaySubtotalUncheckUseSystemValue"/>
25+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayGrandTotal}}" userInput="{{showOrderTotalWithoutTax}}" stepKey="setTaxSalesDisplayGrandTotal"/>
26+
<checkOption selector="{{AdminConfigureTaxSection.taxSalesDisplayFullSummaryInherit}}" stepKey="displayFullSummaryuncheckUseSystemValue"/>
27+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayFullSummary}}" userInput="{{displayFullTax}}" stepKey="setTaxSalesDisplayFullSummary"/>
28+
<checkOption selector="{{AdminConfigureTaxSection.taxSalesDisplayZeroTaxInherit}}" stepKey="zeroTaxUncheckUseSystemValue"/>
29+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayZeroTax}}" userInput="{{displayZeroTax}}" stepKey="settaxSalesDisplayZeroTax"/>
30+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
31+
<waitForPageLoad stepKey="waitForConfigSaved"/>
32+
<click selector="{{AdminConfigureTaxSection.taxSalesDisplayHeadOpen}}" stepKey="taxSalesDisplayHeadClosed"/>
33+
</actionGroup>
34+
</actionGroups>
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="ResetOrderInvoiceSettingsForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Orders, Invoices, Credit Memos Display Settings'. Sets 'Display Subtotal' to 'Excluding Tax'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="taxCalculationMethod" type="string" defaultValue="Including and Excluding Tax"/>
17+
</arguments>
18+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<click selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" stepKey="openOrdersInvoicesCreditSales"/>
21+
<waitForElementVisible selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="seeShippingTaxClass"/>
22+
<checkOption selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="uncheckUseSystemValue"/>
23+
<selectOption selector="{{AdminConfigureTaxSection.orderInvoiceDisplaySubtotal}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
24+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
25+
<waitForPageLoad stepKey="waitForConfigSaved"/>
26+
<click selector="{{AdminConfigureTaxSection.taxSalesDisplayHeadOpen}}" stepKey="taxSalesDisplayHeadClosed"/>
27+
</actionGroup>
28+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="SetCalculationClassForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Calculation Method Based On' to 'Unit Price'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="taxCalculationMethod" type="string" defaultValue="Unit Price"/>
17+
</arguments>
18+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="openTaxCalculationSettingsSection"/>
21+
<scrollTo selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" x="0" y="-80" stepKey="goToCheckbox"/>
22+
<waitForElementVisible selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="seeShippingTaxClass"/>
23+
<uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="uncheckUseSystemValue"/>
24+
<selectOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
25+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
26+
<waitForPageLoad stepKey="waitForConfigSaved"/>
27+
<click selector="{{AdminConfigureTaxSection.taxCalculationSettingsOpened}}" stepKey="closeTaxCalcSettingsSection"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="SetIncludeTaxInTotalForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Orders, Invoices, Credit Memos Display Settings'. Sets 'No' to 'Yes'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="showOrderTotalWithoutTax" type="string" defaultValue="Yes"/>
17+
<argument name="displayFullTax" type="string" defaultValue="Yes"/>
18+
<argument name="displayZeroTax" type="string" defaultValue="Yes"/>
19+
</arguments>
20+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
21+
<waitForPageLoad stepKey="waitForPageLoad"/>
22+
<click selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" stepKey="openOrdersInvoicesCreditSales"/>
23+
<waitForElementVisible selector="{{AdminConfigureTaxSection.taxSalesDisplaySubtotal}}" stepKey="taxSalesDisplaySubtotal"/>
24+
<uncheckOption selector="{{AdminConfigureTaxSection.taxSalesDisplaySubtotal}}" stepKey="displaySubtotalUncheckUseSystemValue"/>
25+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayGrandTotal}}" userInput="{{showOrderTotalWithoutTax}}" stepKey="setTaxSalesDisplayGrandTotal"/>
26+
27+
<uncheckOption selector="{{AdminConfigureTaxSection.taxSalesDisplayFullSummaryInherit}}" stepKey="displayFullSummaryuncheckUseSystemValue"/>
28+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayFullSummary}}" userInput="{{displayFullTax}}" stepKey="setTaxSalesDisplayFullSummary"/>
29+
30+
<uncheckOption selector="{{AdminConfigureTaxSection.taxSalesDisplayZeroTaxInherit}}" stepKey="zeroTaxUncheckUseSystemValue"/>
31+
<selectOption selector="{{AdminConfigureTaxSection.taxSalesDisplayZeroTax}}" userInput="{{displayZeroTax}}" stepKey="settaxSalesDisplayZeroTax"/>
32+
33+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
34+
<waitForPageLoad stepKey="waitForConfigSaved"/>
35+
<click selector="{{AdminConfigureTaxSection.taxSalesDisplayHeadOpen}}" stepKey="taxSalesDisplayHeadClosed"/>
36+
</actionGroup>
37+
</actionGroups>
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="SetOrderInvoiceSettingsForShippingActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Orders, Invoices, Credit Memos Display Settings'. Sets 'Display Subtotal' to 'Include and Excluded tax'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="taxCalculationMethod" type="string" defaultValue="Including and Excluding Tax"/>
17+
</arguments>
18+
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<click selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" stepKey="openOrdersInvoicesCreditSales"/>
21+
<waitForElementVisible selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="seeShippingTaxClass"/>
22+
<uncheckOption selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="uncheckUseSystemValue"/>
23+
<selectOption selector="{{AdminConfigureTaxSection.orderInvoiceDisplaySubtotal}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
24+
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
25+
<waitForPageLoad stepKey="waitForConfigSaved"/>
26+
<click selector="{{AdminConfigureTaxSection.taxSalesDisplayHeadOpen}}" stepKey="taxSalesDisplayHeadClosed"/>
27+
</actionGroup>
28+
</actionGroups>

app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
<annotations>
1313
<description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'Taxable Goods'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
1414
</annotations>
15-
15+
<arguments>
16+
<argument name="shippingTaxClass" type="string" defaultValue="Taxable Goods"/>
17+
</arguments>
1618
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
1719
<waitForPageLoad stepKey="waitForPageLoad"/>
1820
<conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="expandTaxClassesTab"/>
1921
<waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass"/>
2022
<uncheckOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="uncheckUseSystemValue"/>
21-
<selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="Taxable Goods" stepKey="setShippingTaxClass"/>
23+
<selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="{{shippingTaxClass}}" stepKey="setShippingTaxClass"/>
2224
<click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/>
2325
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/>
2426
</actionGroup>

0 commit comments

Comments
 (0)