Skip to content

Commit

Permalink
Merge branch '2.4-develop' into issue-27051
Browse files Browse the repository at this point in the history
  • Loading branch information
jiten-patel authored May 7, 2020
2 parents c1a01fc + 6b6f428 commit eeb7433
Show file tree
Hide file tree
Showing 971 changed files with 24,506 additions and 5,179 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="AdminFillSearchTermActionGroup">
<annotations>
<description>Fills the search terms form with sample data.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
<argument name="store" type="string"/>
<argument name="redirectUrl" type="string"/>
<argument name="suggestedTerms" type="string"/>
</arguments>
<!-- Fill form fields -->
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.query_text}}" userInput="{{searchQuery}}" stepKey="fillFieldSearchQuery"/>
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.store_id}}" userInput="{{store}}" stepKey="selectStoreView"/>
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.redirect}}" userInput="{{redirectUrl}}" stepKey="fillFieldRedirectUrl"/>
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.display_in_terms}}" userInput="{{suggestedTerms}}" stepKey="selectSuggestedTerms" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminOpenNewSearchTermsPageActionGroup">
<annotations>
<description>Navigate to search terms form page.</description>
</annotations>
<amOnPage url="{{AdminSearchTermsFormPage.url}}" stepKey="amOnSearchTermsForm"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminSaveSearchTermActionGroup">
<annotations>
<description>Save a new search term from Magento admin.</description>
</annotations>
<!-- Click save action and verify success message -->
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/>
</actionGroup>
</actionGroups>
17 changes: 17 additions & 0 deletions app/code/Magento/AdvancedSearch/Test/Mftf/Data/SearchTermsData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="SearchTerms">
<data key="searchQuery" unique="suffix">books</data>
<data key="store">Default Store View</data>
<data key="redirectUrl">http://sample.com</data>
<data key="suggestedTerms">1</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminSearchTermsFormPage" url="search/term/new/" area="admin" module="Magento_AdvancedSearch">
<section name="AdminSearchTermsPageFormFieldsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSearchTermsPageFormFieldsSection">
<element name="query_text" type="input" selector="#query_text"/>
<element name="store_id" type="select" selector="#store_id"/>
<element name="redirect" type="input" selector="#redirect"/>
<element name="display_in_terms" type="select" selector="#display_in_terms"/>
</section>
</sections>
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="AdminAddSearchTermTest">
<annotations>
<features value="AdvancedSearch"/>
<stories value="Add a new search term"/>
<title value="Admin should be able to create a new search term"/>
<description value="Admin should be able to create a new search term using search terms grid"/>
<severity value="CRITICAL"/>
<group value="AdvancedSearch"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminOpenNewSearchTermsPageActionGroup" stepKey="navigateToSearchTermPage"/>
<actionGroup ref="AdminFillSearchTermActionGroup" stepKey="fillNewSearchTermData">
<argument name="searchQuery" value="{{SearchTerms.searchQuery}}"/>
<argument name="store" value="{{SearchTerms.store}}"/>
<argument name="redirectUrl" value="{{SearchTerms.redirectUrl}}"/>
<argument name="suggestedTerms" value="{{SearchTerms.suggestedTerms}}"/>
</actionGroup>
<actionGroup ref="AdminSaveSearchTermActionGroup" stepKey="saveSearchTerm"/>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveSearchTermSuccessMessage">
<argument name="message" value="You saved the search term."/>
<argument name="messageType" value="success"/>
</actionGroup>
</test>
</tests>
22 changes: 13 additions & 9 deletions app/code/Magento/Amqp/Test/Unit/Setup/ConfigOptionsListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

namespace Magento\Amqp\Test\Unit\Setup;

use Magento\Amqp\Setup\ConnectionValidator;
use Magento\Framework\Config\Data\ConfigData;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Amqp\Setup\ConfigOptionsList;
use Magento\Framework\Setup\Option\TextConfigOption;
use Magento\Framework\App\DeploymentConfig;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class ConfigOptionsListTest extends \PHPUnit\Framework\TestCase
class ConfigOptionsListTest extends TestCase
{
/**
* @var ObjectManager
Expand All @@ -24,12 +28,12 @@ class ConfigOptionsListTest extends \PHPUnit\Framework\TestCase
private $model;

/**
* @var \Magento\Amqp\Setup\ConnectionValidator|\PHPUnit_Framework_MockObject_MockObject
* @var ConnectionValidator|MockObject
*/
private $connectionValidatorMock;

/**
* @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
* @var DeploymentConfig|MockObject
*/
private $deploymentConfigMock;

Expand All @@ -38,7 +42,7 @@ class ConfigOptionsListTest extends \PHPUnit\Framework\TestCase
*/
private $options;

protected function setUp()
protected function setUp(): void
{
$this->options = [
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_HOST => 'host',
Expand All @@ -51,18 +55,18 @@ protected function setUp()
];

$this->objectManager = new ObjectManager($this);
$this->connectionValidatorMock = $this->getMockBuilder(\Magento\Amqp\Setup\ConnectionValidator::class)
$this->connectionValidatorMock = $this->getMockBuilder(ConnectionValidator::class)
->disableOriginalConstructor()
->setMethods([])
->getMock();

$this->deploymentConfigMock = $this->getMockBuilder(\Magento\Framework\App\DeploymentConfig::class)
$this->deploymentConfigMock = $this->getMockBuilder(DeploymentConfig::class)
->disableOriginalConstructor()
->setMethods([])
->getMock();

$this->model = $this->objectManager->getObject(
\Magento\Amqp\Setup\ConfigOptionsList::class,
ConfigOptionsList::class,
[
'connectionValidator' => $this->connectionValidatorMock,
]
Expand Down Expand Up @@ -135,9 +139,9 @@ public function testCreateConfig($options, $expectedConfigData)
$result = $this->model->createConfig($options, $this->deploymentConfigMock);
$this->assertInternalType('array', $result);
$this->assertNotEmpty($result);
/** @var \Magento\Framework\Config\Data\ConfigData $configData */
/** @var ConfigData $configData */
$configData = $result[0];
$this->assertInstanceOf(\Magento\Framework\Config\Data\ConfigData::class, $configData);
$this->assertInstanceOf(ConfigData::class, $configData);
$this->assertEquals($expectedConfigData, $configData->getData());
}

Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AsynchronousOperations/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"require": {
"magento/framework": "*",
"magento/framework-message-queue": "*",
"magento/framework-bulk": "*",
"magento/module-authorization": "*",
"magento/module-backend": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
</annotations>

<waitForElementVisible selector="{{AdminHeaderSection.adminUserAccountText}}" stepKey="waitForAdminAccountTextVisible"/>
<seeElement selector="{{AdminHeaderSection.adminUserAccountText}}" stepKey="assertAdminAccountTextElement"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
<data key="scope_code">base</data>
<data key="value">en_US</data>
</entity>
<entity name="GeneralLocalCodeConfigsForMexico">
<data key="path">general/locale/code</data>
<data key="scope">websites</data>
<data key="scope_code">base</data>
<data key="value">es_MX</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<waitForLoadingMaskToDisappear stepKey="waitForSearchingOrder"/>
<!-- Create invoice -->
<comment userInput="Create invoice" stepKey="createInvoice"/>
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>

<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
Expand All @@ -95,8 +95,7 @@
<comment userInput="Create Shipment for the order" stepKey="createShipmentForOrder"/>
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage2"/>
<waitForPageLoad time="30" stepKey="waitForOrderListPageLoading"/>
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="openOrderPageForShip"/>
<waitForPageLoad stepKey="waitForOrderDetailsPage"/>
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrderPageForShip"/>
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
<waitForPageLoad stepKey="waitForShipmentPagePage"/>
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ public function getViewHeader(string $viewName): string
public function getDropViewSql(string $viewName): string
{
$quotedViewName = $this->getConnection()->quoteIdentifier($viewName);
return sprintf('DROP VIEW IF EXISTS %s;\n', $quotedViewName);
return sprintf("DROP VIEW IF EXISTS %s;\n", $quotedViewName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="deleteBackup">
<actionGroup name="AdminBackupDeleteActionGroup">
<annotations>
<description>Deletes a Backup using provided Backup Entity.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCategoriesPageActionGroup">
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryIndexPage"/>
<waitForPageLoad stepKey="waitForPageLoad" after="onCategoryIndexPage"/>
<actionGroup name="AdminBackupIndexPageOpenActionGroup">
<amOnPage url="{{AdminBackupIndexPage.url}}" stepKey="navigateToBackupIndexPage"/>
<waitForPageLoad stepKey="waitForBackupIndexPageLoad"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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="deleteBackup" extends="AdminBackupDeleteActionGroup" deprecated="Use DeleteBackupActionGroup"/>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="BackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<page name="AdminBackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<section name="AdminMainActionsSection"/>
<section name="AdminGridTableSection"/>
<section name="AdminCreateBackupFormSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!--Go to backup index page-->
<amOnPage url="{{BackupIndexPage.url}}" stepKey="goToBackupPage"/>
<waitForPageLoad stepKey="waitForBackupPage"/>
<actionGroup ref="AdminBackupIndexPageOpenActionGroup" stepKey="navigateToBackupPage"/>

<!--Create system backup-->
<actionGroup ref="CreateSystemBackupActionGroup" stepKey="createSystemBackup"/>
Expand All @@ -39,17 +38,17 @@
<actionGroup ref="CreateDatabaseBackupActionGroup" stepKey="createDatabaseBackup"/>

<!--Delete system backup-->
<actionGroup ref="deleteBackup" stepKey="deleteSystemBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteSystemBackup">
<argument name="backup" value="SystemBackup"/>
</actionGroup>

<!--Delete database/media backup-->
<actionGroup ref="deleteBackup" stepKey="deleteMediaBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteMediaBackup">
<argument name="backup" value="MediaBackup"/>
</actionGroup>

<!--Delete database backup-->
<actionGroup ref="deleteBackup" stepKey="deleteDatabaseBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteDatabaseBackup">
<argument name="backup" value="DatabaseBackup"/>
</actionGroup>

Expand Down
Loading

0 comments on commit eeb7433

Please sign in to comment.