Skip to content

Commit ddf6b0c

Browse files
committed
Merge remote-tracking branch 'github-magento2ce/MAGETWO-91521' into EPAM-PR-12
2 parents a9d79d5 + 8874953 commit ddf6b0c

File tree

8 files changed

+311
-5
lines changed

8 files changed

+311
-5
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
2424
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
2525
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
26+
<element name="productTaxClass" type="select" selector="//*[@name='product[tax_class_id]']"/>
2627
<element name="productTaxClassUseDefault" type="checkbox" selector="input[name='use_default[tax_class_id]']"/>
2728
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']"/>
2829
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>

app/code/Magento/Reports/Block/Adminhtml/Sales/Tax/Grid.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public function __construct(
5353
}
5454

5555
/**
56-
* {@inheritdoc}
56+
* @inheritdoc
57+
*
5758
* @codeCoverageIgnore
5859
*/
5960
protected function _construct()
@@ -64,7 +65,7 @@ protected function _construct()
6465
}
6566

6667
/**
67-
* {@inheritdoc}
68+
* @inheritdoc
6869
*/
6970
public function getResourceCollectionName()
7071
{
@@ -74,7 +75,7 @@ public function getResourceCollectionName()
7475
}
7576

7677
/**
77-
* {@inheritdoc}
78+
* @inheritdoc
7879
*/
7980
protected function _prepareColumns()
8081
{
@@ -123,7 +124,6 @@ protected function _prepareColumns()
123124
[
124125
'header' => __('Orders'),
125126
'index' => 'orders_count',
126-
'total' => 'sum',
127127
'type' => 'number',
128128
'sortable' => false,
129129
'header_css_class' => 'col-qty',

app/code/Magento/Tax/Model/ResourceModel/Report/Tax/Createdat.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Tax\Model\ResourceModel\Report\Tax;
1313

14+
/**
15+
* Class for tax report resource model with aggregation by created at
16+
*/
1417
class Createdat extends \Magento\Reports\Model\ResourceModel\Report\AbstractReport
1518
{
1619
/**
@@ -84,7 +87,7 @@ protected function _aggregateByOrder($aggregationField, $from, $to)
8487
'order_status' => 'e.status',
8588
'percent' => 'MAX(tax.' . $connection->quoteIdentifier('percent') . ')',
8689
'orders_count' => 'COUNT(DISTINCT e.entity_id)',
87-
'tax_base_amount_sum' => 'SUM(tax.base_amount * e.base_to_global_rate)',
90+
'tax_base_amount_sum' => 'SUM(tax.base_real_amount * e.base_to_global_rate)',
8891
];
8992

9093
$select = $connection->select()->from(

app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,44 @@
115115
<!-- Save the tax rate -->
116116
<click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/>
117117
</actionGroup>
118+
119+
<!--Add Product Tax Class-->
120+
<actionGroup name="addProductTaxClass">
121+
<arguments>
122+
<argument name="prodTaxClassName" type="string"/>
123+
</arguments>
124+
<!--Click Additional Settings-->
125+
<click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/>
126+
<!--Click Product Add New Tax Class Button-->
127+
<click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/>
128+
<!--Fill field-->
129+
<fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/>
130+
<!-- Save Product tax rate -->
131+
<click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/>
132+
</actionGroup>
133+
134+
<!--Add New Tax Rule -->
135+
<actionGroup name="addNewTaxRuleActionGroup">
136+
<!-- Go to tax rule page -->
137+
<amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/>
138+
<waitForPageLoad stepKey="waitForTaxRatePage"/>
139+
<click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/>
140+
</actionGroup>
141+
142+
<!--Delete Product Tax Class-->
143+
<actionGroup name="deleteProductTaxClass">
144+
<arguments>
145+
<argument name="taxClassName" type="string"/>
146+
</arguments>
147+
<!-- Go to tax rule page -->
148+
<amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/>
149+
<waitForPageLoad stepKey="waitForTaxRatePage"/>
150+
<click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/>
151+
<scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/>
152+
<moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/>
153+
<click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/>
154+
<waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/>
155+
<click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/>
156+
<waitForPageLoad stepKey="waitForProductTaxClassDeleted"/>
157+
</actionGroup>
118158
</actionGroups>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,16 @@
2626
<data key="zip">*</data>
2727
<data key="rate">0</data>
2828
</entity>
29+
<entity name="SimpleTaxWithZipCode" type="tax">
30+
<data key="state">Texas</data>
31+
<data key="country">United States</data>
32+
<data key="zip">78729</data>
33+
<data key="rate">7.25</data>
34+
</entity>
35+
<entity name="SimpleSecondTaxWithZipCode" type="tax">
36+
<data key="state">Texas</data>
37+
<data key="country">United States</data>
38+
<data key="zip">78729</data>
39+
<data key="rate">0.125</data>
40+
</entity>
2941
</entities>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminTaxReportsSection">
12+
<element name="refreshStatistics" type="button" selector="//a[contains(text(),'here')]"/>
13+
<element name="fromDate" type="input" selector="#sales_report_from"/>
14+
<element name="toDate" type="input" selector="//*[@id='sales_report_to']/following-sibling::button"/>
15+
<element name="goTodayButton" type="input" selector="//button[contains(text(),'Go Today')]"/>
16+
<element name="showReportButton" type="button" selector="#filter_form_submit"/>
17+
<element name="taxRuleAmount" type="textarea" selector="//*[contains(text(),'{{var1}}')]/following-sibling::td[contains(@class, 'col-tax-amount')]" parameterized="true"/>
18+
</section>
19+
</sections>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@
1919
<element name="country" type="select" selector="#tax_country_id"/>
2020
<element name="rate" type="input" selector="#rate"/>
2121
<element name="save" type="button" selector=".action-save" timeout="30"/>
22+
<element name="saveRule" type="button" selector="#save" timeout="30"/>
23+
<element name="additionalSettings" type="button" selector="#details-summarybase_fieldset"/>
24+
<element name="productAddNewTaxClass" type="button" selector="//*[@id='tax_product_class']/following-sibling::section//*[contains(text(),'Add New Tax Class')]"/>
25+
<element name="fieldProdNewTaxClass" type="input" selector="//*[@id='tax_product_class']/following-sibling::section//input[@class='mselect-input']"/>
26+
<element name="saveProdNewTaxClass" type="button" selector="//*[@id='tax_product_class']/following-sibling::section//span[@class='mselect-save']"/>
27+
<element name="defaultTaxClass" type="button" selector="//*[@id='tax_product_class']/following-sibling::section//div[@class='mselect-items-wrapper']/div[1]"/>
28+
<element name="deleteTaxClassName" type="button" selector="//span[contains(text(),'{{var1}}')]" parameterized="true"/>
29+
<element name="deleteTaxClass" type="button" selector="//span[contains(text(),'{{var1}}')]/../..//*[@class='mselect-delete']" parameterized="true"/>
30+
<element name="popUpDialogOK" type="button" selector="//*[@class='modal-footer']//*[contains(text(),'OK')]"/>
2231
</section>
2332
</sections>

0 commit comments

Comments
 (0)