Skip to content

Commit 6345bcf

Browse files
committed
B2B-1704: Add MFTF test for MC-38621
- Adding import checks
1 parent dc20d4e commit 6345bcf

File tree

4 files changed

+69
-17
lines changed

4 files changed

+69
-17
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
<features value="AwsS3"/>
1414
<stories value="Export Tax"/>
1515
<title value="S3 - Export Tax Rates"/>
16-
<description value="Sets S3 for file system. Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page and
17-
validates contents in downloaded file. Note that MFTF cannot simply click export and have access to the file
18-
that is downloaded in the browser due to the test not having access to the server that is running the test
19-
browser. Therefore, this test verifies that the Export button can be successfully clicked, grabs the request
20-
URL from the Export button's form, executes the request on the magento machine via a curl request, and
21-
verifies the contents of the exported file."/>
16+
<description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from
17+
the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml.
18+
Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and
19+
have access to the file that is downloaded in the browser due to the test not having access to the server
20+
that is running the test browser. Therefore, this test verifies that the Export button can be successfully
21+
clicked, grabs the request URL from the Export button's form, executes the request on the magento machine
22+
via a curl request, and verifies the contents of the exported file. Uses S3 for the file system."/>
2223
<severity value="MAJOR"/>
2324
<testCaseId value="MC-38621"/>
2425
<group value="importExport"/>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<features value="AwsS3"/>
1414
<stories value="Import Tax"/>
1515
<title value="S3 - Import and Update Tax Rates"/>
16-
<description value="Imports tax rates to create new tax rates and update existing tax rates. Verifies
17-
results on tax rates grid page. Sets S3 for file system."/>
16+
<description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and
17+
from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax
18+
Rates grid page. Uses S3 for the file system."/>
1819
<severity value="MAJOR"/>
1920
<testCaseId value="MC-38621"/>
2021
<group value="importExport"/>

app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
<features value="TaxImportExport"/>
1414
<stories value="Export"/>
1515
<title value="Export Tax Rates"/>
16-
<description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page and
17-
validates contents in downloaded file. Note that MFTF cannot simply click export and have access to the file
18-
that is downloaded in the browser due to the test not having access to the server that is running the test
19-
browser. Therefore, this test verifies that the Export button can be successfully clicked, grabs the request
20-
URL from the Export button's form, executes the request on the magento machine via a curl request, and
21-
verifies the contents of the exported file."/>
16+
<description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from
17+
the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml.
18+
Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and
19+
have access to the file that is downloaded in the browser due to the test not having access to the server
20+
that is running the test browser. Therefore, this test verifies that the Export button can be successfully
21+
clicked, grabs the request URL from the Export button's form, executes the request on the magento machine
22+
via a curl request, and verifies the contents of the exported file."/>
2223
<severity value="MAJOR"/>
2324
<testCaseId value="MC-38621"/>
2425
<group value="importExport"/>

app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<features value="TaxImportExport"/>
1414
<stories value="Import"/>
1515
<title value="Import and Update Tax Rates"/>
16-
<description value="Imports tax rates to create new tax rates and update existing tax rates. Verifies
17-
results on tax rates grid page."/>
16+
<description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and
17+
from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax
18+
Rates grid page."/>
1819
<severity value="MAJOR"/>
1920
<testCaseId value="MC-38621"/>
2021
<group value="importExport"/>
@@ -39,7 +40,7 @@
3940
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
4041
</after>
4142

42-
<!-- Import Tax Rates -->
43+
<!-- Import Tax Rates from System > Data Transfer -->
4344
<actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/>
4445
<actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates">
4546
<argument name="file" value="{{import_tax_rates.filename}}"/>
@@ -80,5 +81,53 @@
8081
<argument name="zip" value="{{import_rate_2.tax_postcode}}"/>
8182
<argument name="rate" value="{{import_rate_2.rate}}"/>
8283
</actionGroup>
84+
85+
<!-- Delete/Revert Data -->
86+
<actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage2"/>
87+
<createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/>
88+
<createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/>
89+
<actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/>
90+
91+
<!-- Import Tax Rates from Tax Rule Page -->
92+
<actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="navigateToTaxRulePage"/>
93+
<actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates2">
94+
<argument name="file" value="{{import_tax_rates.filename}}"/>
95+
</actionGroup>
96+
97+
<!-- Verify Imported Tax Rates -->
98+
<actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage3"/>
99+
<actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridCA2">
100+
<argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/>
101+
<argument name="value" value="{{US_CA_Rate_1.code}}"/>
102+
</actionGroup>
103+
<actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowCA2">
104+
<argument name="taxIdentifier" value="{{US_CA_Rate_1.code}}"/>
105+
<argument name="country" value="{{US_CA_Rate_1.tax_country}}"/>
106+
<argument name="region" value="{{US_CA_Rate_1.tax_region}}"/>
107+
<argument name="zip" value="{{US_CA_Rate_1.tax_postcode}}"/>
108+
<argument name="rate" value="10.25"/>
109+
</actionGroup>
110+
<actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport3">
111+
<argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/>
112+
<argument name="value" value="{{import_rate_1.code}}"/>
113+
</actionGroup>
114+
<actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport3">
115+
<argument name="taxIdentifier" value="{{import_rate_1.code}}"/>
116+
<argument name="country" value="{{import_rate_1.tax_country}}"/>
117+
<argument name="region" value="{{import_rate_1.tax_region}}"/>
118+
<argument name="zip" value="{{import_rate_1.tax_postcode}}"/>
119+
<argument name="rate" value="{{import_rate_1.rate}}"/>
120+
</actionGroup>
121+
<actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport4">
122+
<argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/>
123+
<argument name="value" value="{{import_rate_2.code}}"/>
124+
</actionGroup>
125+
<actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport4">
126+
<argument name="taxIdentifier" value="{{import_rate_2.code}}"/>
127+
<argument name="country" value="{{import_rate_2.tax_country}}"/>
128+
<argument name="region" value="{{import_rate_2.tax_region}}"/>
129+
<argument name="zip" value="{{import_rate_2.tax_postcode}}"/>
130+
<argument name="rate" value="{{import_rate_2.rate}}"/>
131+
</actionGroup>
83132
</test>
84133
</tests>

0 commit comments

Comments
 (0)