|
14 | 14 | <stories value="Export"/>
|
15 | 15 | <title value="Export Tax Rates"/>
|
16 | 16 | <description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page and
|
17 |
| - validates contents in downloaded file."/> |
| 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 clicks the Export button, grabs the request URI from the browser, and executes |
| 20 | + the same request on the magento machine via a curl request to download the same file there so that the test |
| 21 | + has access to the exported file."/> |
18 | 22 | <severity value="MAJOR"/>
|
19 | 23 | <testCaseId value="MC-38949"/>
|
20 | 24 | <group value="importExport"/>
|
|
31 | 35 | </before>
|
32 | 36 |
|
33 | 37 | <after>
|
34 |
| - <!-- Delete Data & Logout --> |
35 |
| -<!-- <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteExportFile">--> |
36 |
| -<!-- <argument name="filePath">/var/tmp/tax_rates.csv</argument>--> |
37 |
| -<!-- </helper>--> |
38 |
| - <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteExportFile"> |
39 |
| - <argument name="filePath">/home/centos/Downloads/tax_rates.csv</argument> |
40 |
| - </helper> |
| 38 | + <!-- Logout --> |
41 | 39 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
|
42 | 40 | </after>
|
43 | 41 |
|
44 | 42 | <!-- Export Tax Rates & Validate Export -->
|
45 | 43 | <actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/>
|
46 | 44 | <actionGroup ref="AdminExportTaxRatesActionGroup" stepKey="exportTaxRates"/>
|
47 | 45 | <executeJS function="return window.performance.getEntriesByName('mousedown')[0].target.baseURI" stepKey="exportURI"/>
|
48 |
| - |
49 |
| - <comment userInput="{$exportURI}" stepKey="commentTest"/> |
50 |
| -<!-- <assertEquals stepKey="test">--> |
51 |
| -<!-- <actualResult type="variable">exportURI</actualResult>--> |
52 |
| -<!-- <expectedResult type="string">http://git24develop3.test/admin/tax/rate/importExport/</expectedResult>--> |
53 |
| -<!-- </assertEquals>--> |
54 |
| - |
55 |
| - <!-- todo: curl command to go to URI to download file --> |
56 |
| - |
57 |
| - <assertFileExists stepKey="assertExportFileExists"> |
58 |
| - <actualResult type="string">/home/centos/Downloads/tax_rates.csv</actualResult> |
59 |
| - </assertFileExists> |
60 |
| - <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportedFileContainsCATaxRate"> |
61 |
| - <argument name="filePath">/home/centos/Downloads/tax_rates.csv</argument> |
62 |
| - <argument name="text">{{US_CA_Rate_1.code}}</argument> |
| 46 | + <comment userInput="{$exportURI}" stepKey="commentExportURI"/> |
| 47 | + <executeJS function="return window.location.origin" stepKey="baseUrl"/> |
| 48 | + <helper class="\Magento\TaxImportExport\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate"> |
| 49 | + <argument name="uri">{$baseUrl}/admin/tax/rate/exportPost/</argument> |
| 50 | + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> |
63 | 51 | </helper>
|
64 |
| - <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportedFileContainsNYTaxRate"> |
65 |
| - <argument name="filePath">/home/centos/Downloads/tax_rates.csv</argument> |
66 |
| - <argument name="text">{{US_NY_Rate_1.code}}</argument> |
| 52 | + <helper class="\Magento\TaxImportExport\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate"> |
| 53 | + <argument name="uri">{$baseUrl}/admin/tax/rate/exportPost/</argument> |
| 54 | + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> |
67 | 55 | </helper>
|
68 |
| -<!-- <assertFileExists stepKey="assertExportFileExists">--> |
69 |
| -<!-- <actualResult type="string">/var/tmp/tax_rates.csv</actualResult>--> |
70 |
| -<!-- </assertFileExists>--> |
71 |
| -<!-- <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportedFileContainsCATaxRate">--> |
72 |
| -<!-- <argument name="filePath">/var/tmp/tax_rates.csv</argument>--> |
73 |
| -<!-- <argument name="text">{{US_CA_Rate_1.code}}</argument>--> |
74 |
| -<!-- </helper>--> |
75 |
| -<!-- <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportedFileContainsNYTaxRate">--> |
76 |
| -<!-- <argument name="filePath">/var/tmp/tax_rates.csv</argument>--> |
77 |
| -<!-- <argument name="text">{{US_NY_Rate_1.code}}</argument>--> |
78 |
| -<!-- </helper>--> |
79 | 56 | </test>
|
80 | 57 | </tests>
|
0 commit comments