-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.5-develop' into api-interfaces-mark-issue-32037
- Loading branch information
Showing
567 changed files
with
91,986 additions
and
31,150 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminAwsS3ExportTaxRatesTest" extends="AdminExportTaxRatesTest"> | ||
<annotations> | ||
<features value="AwsS3"/> | ||
<stories value="Export Tax"/> | ||
<title value="S3 - Export Tax Rates"/> | ||
<description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from | ||
the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml. | ||
Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and | ||
have access to the file that is downloaded in the browser due to the test not having access to the server | ||
that is running the test browser. Therefore, this test verifies that the Export button can be successfully | ||
clicked, grabs the request URL from the Export button's form, executes the request on the magento machine | ||
via a curl request, and verifies the contents of the exported file. Uses S3 for the file system."/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-38621"/> | ||
<group value="importExport"/> | ||
<group value="tax"/> | ||
</annotations> | ||
|
||
<before> | ||
<!-- Enable AWS S3 Remote Storage --> | ||
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> | ||
</before> | ||
|
||
<after> | ||
<!-- Disable AWS S3 Remote Storage --> | ||
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> | ||
</after> | ||
</test> | ||
</tests> |
35 changes: 35 additions & 0 deletions
35
app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminAwsS3ImportTaxRatesTest" extends="AdminImportTaxRatesTest"> | ||
<annotations> | ||
<features value="AwsS3"/> | ||
<stories value="Import Tax"/> | ||
<title value="S3 - Import and Update Tax Rates"/> | ||
<description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and | ||
from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax | ||
Rates grid page. Uses S3 for the file system."/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-38621"/> | ||
<group value="importExport"/> | ||
<group value="tax"/> | ||
</annotations> | ||
|
||
<before> | ||
<!-- Enable AWS S3 Remote Storage --> | ||
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> | ||
</before> | ||
|
||
<after> | ||
<!-- Disable AWS S3 Remote Storage --> | ||
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> | ||
</after> | ||
</test> | ||
</tests> |
24 changes: 24 additions & 0 deletions
24
...to/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertAdminDashboardDisplayedWithNoErrorsActionGroup"> | ||
<annotations> | ||
<description>Checks if Dashboard is displayed properly</description> | ||
</annotations> | ||
|
||
<seeElement selector="{{AdminDashboardSection.dashboardDiagramOrderContentTab}}" stepKey="seeOrderContentTab"/> | ||
<seeElement selector="{{AdminDashboardSection.dashboardDiagramContent}}" stepKey="seeDiagramContent"/> | ||
<click selector="{{AdminDashboardSection.dashboardDiagramAmounts}}" stepKey="clickDashboardAmount"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForDashboardAmountLoading"/> | ||
<seeElement selector="{{AdminDashboardSection.dashboardDiagramAmountsContentTab}}" stepKey="seeDiagramAmountContent"/> | ||
<seeElement selector="{{AdminDashboardSection.dashboardDiagramTotals}}" stepKey="seeAmountTotals"/> | ||
<dontSeeJsError stepKey="dontSeeJsError"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Backend\Test\Mftf\Helper; | ||
|
||
use Magento\FunctionalTestingFramework\Helper\Helper; | ||
|
||
/** | ||
* Class for MFTF helpers for curl requests. | ||
*/ | ||
class CurlHelpers extends Helper | ||
{ | ||
/** | ||
* Assert a that a curl request's response contains an expected string | ||
* | ||
* @param string $url | ||
* @param string $expectedString | ||
* @param string $postBody | ||
* @param string $cookieName | ||
* @return void | ||
* | ||
*/ | ||
public function assertCurlResponseContainsString($url, $expectedString, $postBody = null, $cookieName = 'admin'): void | ||
{ | ||
$cookie = $this->getCookie($cookieName); | ||
$curlResponse = $this->getCurlResponse($url, $cookie, $postBody); | ||
$this->assertStringContainsString($expectedString, $curlResponse); | ||
} | ||
|
||
/** | ||
* Sends a curl request with the provided URL & cookie. Returns the response | ||
* | ||
* @param string $url | ||
* @param string $cookie | ||
* @param string $postBody | ||
* @return string | ||
* | ||
*/ | ||
private function getCurlResponse($url, $cookie = null, $postBody = null): string | ||
{ | ||
// Start Session | ||
$session = curl_init($url); | ||
|
||
// Set Options | ||
if ($postBody) { | ||
$data = json_decode($postBody, true); | ||
curl_setopt($session, CURLOPT_POST, true); | ||
curl_setopt($session, CURLOPT_POSTFIELDS, $data); | ||
} | ||
curl_setopt($session, CURLOPT_COOKIE, $cookie); | ||
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); | ||
|
||
// Execute | ||
$response = curl_exec($session); | ||
curl_close($session); | ||
|
||
return $response; | ||
} | ||
|
||
/** | ||
* Gets the value of the specified cookie and returns the key value pair of the cookie | ||
* | ||
* @param string $cookieName | ||
* @return string | ||
* | ||
*/ | ||
private function getCookie($cookieName = 'admin'): string | ||
{ | ||
try { | ||
$webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); | ||
$cookieValue = $webDriver->grabCookie($cookieName); | ||
|
||
return $cookieName . '=' . $cookieValue; | ||
} catch (\Exception $exception) { | ||
$this->fail($exception->getMessage()); | ||
return ''; | ||
} | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminCheckDashboardWithChartsTest"> | ||
<annotations> | ||
<features value="Backend"/> | ||
<stories value="Google Charts on Magento dashboard"/> | ||
<title value="Admin should see Google chart on Magento dashboard"/> | ||
<description value="Google chart on Magento dashboard page is displaying properly"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MAGETWO-98934"/> | ||
<useCaseId value="MAGETWO-98584"/> | ||
<group value="backend"/> | ||
</annotations> | ||
<before> | ||
<magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/> | ||
<createData entity="SimpleProduct2" stepKey="createProduct"> | ||
<field key="price">150</field> | ||
</createData> | ||
<createData entity="Simple_US_Customer" stepKey="createCustomer"> | ||
<field key="firstname">John1</field> | ||
<field key="lastname">Doe1</field> | ||
</createData> | ||
<createData entity="CustomerCart" stepKey="createCustomerCart"> | ||
<requiredEntity createDataKey="createCustomer"/> | ||
</createData> | ||
<createData entity="CustomerCartItem" stepKey="addCartItem"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
<requiredEntity createDataKey="createProduct"/> | ||
</createData> | ||
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</createData> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
|
||
<grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityBefore"/> | ||
|
||
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</updateData> | ||
<createData entity="Invoice" stepKey="invoiceOrder"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</createData> | ||
<createData entity="Shipment" stepKey="shipOrder"> | ||
<requiredEntity createDataKey="createCustomerCart"/> | ||
</createData> | ||
|
||
<reloadPage stepKey="refreshPage"/> | ||
<actionGroup ref="AssertAdminDashboardDisplayedWithNoErrorsActionGroup" stepKey="assertAdminDashboardNotBroken"/> | ||
<grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityAfter"/> | ||
<assertGreaterThan stepKey="checkQuantityWasChanged"> | ||
<actualResult type="const">$grabQuantityAfter</actualResult> | ||
<expectedResult type="const">$grabQuantityBefore</expectedResult> | ||
</assertGreaterThan> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.