From 891198c5117d4d2345b66745f86bfdfca1978525 Mon Sep 17 00:00:00 2001 From: nikunj Date: Wed, 20 Mar 2019 18:16:44 +0530 Subject: [PATCH 01/73] #21853: Allow mview indexers to use different entity columns. --- .../Framework/Mview/View/Subscription.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 67dff1a2cc5db..6e02f1d169daa 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -117,8 +117,19 @@ public function create() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { + // Store current column name for reverting back later. + $originalColumnName = $this->getColumnName(); + /** @var \Magento\Framework\Mview\ViewInterface $view */ + // Use the column name from specific subscription instead of + // use from the one which is currently updated. + $subscriptions = $view->getSubscriptions(); + $subscription = $subscriptions[$this->getTableName()]; + $this->columnName = $subscription['column']; $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); + + // Revert back the column name. + $this->columnName = $originalColumnName; } $this->connection->dropTrigger($trigger->getName()); @@ -146,8 +157,19 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { + // Store current column name for reverting back later. + $originalColumnName = $this->columnName; + /** @var \Magento\Framework\Mview\ViewInterface $view */ + // Use the column name from specific subscription instead of + // use from the one which is currently updated. + $subscriptions = $view->getSubscriptions(); + $subscription = $subscriptions[$this->getTableName()]; + $this->columnName = $subscription['column']; $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); + + // Revert back the column name. + $this->columnName = $originalColumnName; } $this->connection->dropTrigger($trigger->getName()); From b59fc5a549e85d556979b58c42b3cd39058a5a3f Mon Sep 17 00:00:00 2001 From: nikunj Date: Sun, 12 Apr 2020 17:37:36 +0530 Subject: [PATCH 02/73] #21853: Simplify the code change. --- .../Framework/Mview/View/Subscription.php | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 32841bd7e0f9d..3204722a86140 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -113,23 +113,16 @@ public function create() ->setEvent($event) ->setTable($this->resource->getTableName($this->tableName)); - $trigger->addStatement($this->buildStatement($event, $this->getView()->getChangelog())); + $trigger->addStatement($this->buildStatement($event, $this->getView()->getChangelog(), $this->getColumnName())); // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - // Store current column name for reverting back later. - $originalColumnName = $this->getColumnName(); - /** @var \Magento\Framework\Mview\ViewInterface $view */ // Use the column name from specific subscription instead of // use from the one which is currently updated. $subscriptions = $view->getSubscriptions(); $subscription = $subscriptions[$this->getTableName()]; - $this->columnName = $subscription['column']; - $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); - - // Revert back the column name. - $this->columnName = $originalColumnName; + $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); } $this->connection->dropTrigger($trigger->getName()); @@ -157,19 +150,12 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - // Store current column name for reverting back later. - $originalColumnName = $this->columnName; - /** @var \Magento\Framework\Mview\ViewInterface $view */ // Use the column name from specific subscription instead of // use from the one which is currently updated. $subscriptions = $view->getSubscriptions(); $subscription = $subscriptions[$this->getTableName()]; - $this->columnName = $subscription['column']; - $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); - - // Revert back the column name. - $this->columnName = $originalColumnName; + $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); } $this->connection->dropTrigger($trigger->getName()); @@ -216,9 +202,10 @@ protected function getLinkedViews() * * @param string $event * @param \Magento\Framework\Mview\View\ChangelogInterface $changelog + * @param string $subscriptionColumnName * @return string */ - protected function buildStatement($event, $changelog) + protected function buildStatement($event, $changelog, $subscriptionColumnName) { switch ($event) { case Trigger::EVENT_INSERT: @@ -258,7 +245,7 @@ protected function buildStatement($event, $changelog) $trigger, $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), $this->connection->quoteIdentifier($changelog->getColumnName()), - $this->connection->quoteIdentifier($this->getColumnName()) + $this->connection->quoteIdentifier($subscriptionColumnName) ); } From 4035ec08ada4cb5d5495bc7325a982c81c5c02b3 Mon Sep 17 00:00:00 2001 From: nikunj Date: Sun, 12 Apr 2020 17:40:13 +0530 Subject: [PATCH 03/73] #21853: Correct the comment. --- .../Magento/Framework/Mview/View/Subscription.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 3204722a86140..642f5bc610653 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -118,8 +118,9 @@ public function create() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { /** @var \Magento\Framework\Mview\ViewInterface $view */ - // Use the column name from specific subscription instead of - // use from the one which is currently updated. + // Use the column name from specific linked view instead of + // using from the one which is currently updated for all + // the views. $subscriptions = $view->getSubscriptions(); $subscription = $subscriptions[$this->getTableName()]; $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); @@ -151,8 +152,9 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { /** @var \Magento\Framework\Mview\ViewInterface $view */ - // Use the column name from specific subscription instead of - // use from the one which is currently updated. + // Use the column name from specific linked view instead of + // using from the one which is currently updated for all + // the views. $subscriptions = $view->getSubscriptions(); $subscription = $subscriptions[$this->getTableName()]; $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); From 320ced74bdf9e7739d20397b5eff2e8ad98c95f1 Mon Sep 17 00:00:00 2001 From: nikunj Date: Tue, 14 Apr 2020 12:12:03 +0530 Subject: [PATCH 04/73] 21853: Send the view object and do all processing in buildStatement. --- .../Framework/Mview/View/Subscription.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 642f5bc610653..cd6288a231eb9 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -113,17 +113,12 @@ public function create() ->setEvent($event) ->setTable($this->resource->getTableName($this->tableName)); - $trigger->addStatement($this->buildStatement($event, $this->getView()->getChangelog(), $this->getColumnName())); + $trigger->addStatement($this->buildStatement($event, $this->getView())); // Add statements for linked views foreach ($this->getLinkedViews() as $view) { /** @var \Magento\Framework\Mview\ViewInterface $view */ - // Use the column name from specific linked view instead of - // using from the one which is currently updated for all - // the views. - $subscriptions = $view->getSubscriptions(); - $subscription = $subscriptions[$this->getTableName()]; - $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); + $trigger->addStatement($this->buildStatement($event, $view)); } $this->connection->dropTrigger($trigger->getName()); @@ -152,12 +147,7 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { /** @var \Magento\Framework\Mview\ViewInterface $view */ - // Use the column name from specific linked view instead of - // using from the one which is currently updated for all - // the views. - $subscriptions = $view->getSubscriptions(); - $subscription = $subscriptions[$this->getTableName()]; - $trigger->addStatement($this->buildStatement($event, $view->getChangelog(), $subscription['column'])); + $trigger->addStatement($this->buildStatement($event, $view)); } $this->connection->dropTrigger($trigger->getName()); @@ -203,12 +193,18 @@ protected function getLinkedViews() * Build trigger statement for INSERT, UPDATE, DELETE events * * @param string $event - * @param \Magento\Framework\Mview\View\ChangelogInterface $changelog - * @param string $subscriptionColumnName + * @param \Magento\Framework\Mview\ViewInterface $view * @return string */ - protected function buildStatement($event, $changelog, $subscriptionColumnName) + protected function buildStatement($event, $view) { + // Get the subscription for the specific view and specific table. + // We will use column name from it. + $subscription = $view->getSubscriptions()[$this->getTableName()]; + + // Get the changelog from View to get changelog column name. + $changelog = $view->getChangelog(); + switch ($event) { case Trigger::EVENT_INSERT: $trigger = "INSERT IGNORE INTO %s (%s) VALUES (NEW.%s);"; @@ -247,7 +243,7 @@ protected function buildStatement($event, $changelog, $subscriptionColumnName) $trigger, $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), $this->connection->quoteIdentifier($changelog->getColumnName()), - $this->connection->quoteIdentifier($subscriptionColumnName) + $this->connection->quoteIdentifier($subscription['column']) ); } From 7c2d2a6774717fe6374df61edd22f39a5c02c733 Mon Sep 17 00:00:00 2001 From: nikunj Date: Sat, 29 Aug 2020 12:02:13 +0530 Subject: [PATCH 05/73] #21853: Fix tests. --- .../Framework/Mview/Test/Unit/View/SubscriptionTest.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index b91c0b525390f..e0bdf570945a2 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -220,8 +220,6 @@ public function testCreate() $this->viewMock->expects($this->exactly(3)) ->method('getId') ->willReturn('this_id'); - $this->viewMock->expects($this->never()) - ->method('getSubscriptions'); $this->viewCollectionMock->expects($this->exactly(1)) ->method('getViewsByStateMode') @@ -290,9 +288,7 @@ public function testRemove() $otherViewMock->expects($this->exactly(1)) ->method('getId') ->willReturn('other_id'); - $otherViewMock->expects($this->exactly(1)) - ->method('getSubscriptions') - ->willReturn([['name' => $this->tableName], ['name' => 'otherTableName']]); + $otherViewMock->expects($this->exactly(3)) ->method('getChangelog') ->willReturn($otherChangelogMock); @@ -300,8 +296,6 @@ public function testRemove() $this->viewMock->expects($this->exactly(3)) ->method('getId') ->willReturn('this_id'); - $this->viewMock->expects($this->never()) - ->method('getSubscriptions'); $this->viewCollectionMock->expects($this->exactly(1)) ->method('getViewsByStateMode') From 8388a90ea53e67a3f0bde1e03e2f24b64f1925ee Mon Sep 17 00:00:00 2001 From: nikunj Date: Mon, 31 Aug 2020 11:44:45 +0530 Subject: [PATCH 06/73] #21853: Fix tests. --- .../Magento/Framework/Mview/View/Subscription.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index cd6288a231eb9..a65f6e98016f1 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -178,7 +178,7 @@ protected function getLinkedViews() continue; } // Search in view subscriptions - foreach ($view->getSubscriptions() as $subscription) { + foreach ($view->getSubscriptions() ?? [] as $subscription) { if ($subscription['name'] != $this->getTableName()) { continue; } @@ -200,7 +200,12 @@ protected function buildStatement($event, $view) { // Get the subscription for the specific view and specific table. // We will use column name from it. - $subscription = $view->getSubscriptions()[$this->getTableName()]; + $subscriptions = $view->getSubscriptions() ?? []; + if (empty($subscriptions[$this->getTableName()])) { + return ''; + } + + $subscription = $subscriptions[$this->getTableName()]; // Get the changelog from View to get changelog column name. $changelog = $view->getChangelog(); From ff56be5640ab6654ba677f5fba24f98efa5faacd Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Mon, 28 Sep 2020 16:39:52 +0300 Subject: [PATCH 07/73] magento/magento2#21853: Allow mview indexers to use different entity columns - unit & static tests fix. --- .../Mview/Test/Unit/View/SubscriptionTest.php | 32 +++++++++++++++++-- .../Framework/Mview/View/Subscription.php | 6 ++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index e0bdf570945a2..dc14cae93ca70 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -44,7 +44,7 @@ class SubscriptionTest extends TestCase protected $viewMock; /** @var string */ - private $tableName; + private $tableName = 'thisTableName'; protected function setUp(): void { @@ -210,9 +210,14 @@ public function testCreate() $otherViewMock->expects($this->exactly(1)) ->method('getId') ->willReturn('other_id'); - $otherViewMock->expects($this->exactly(1)) + $otherViewMock->expects($this->exactly(4)) ->method('getSubscriptions') - ->willReturn([['name' => $this->tableName], ['name' => 'otherTableName']]); + ->willReturn( + [ + $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], + 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] + ] + ); $otherViewMock->expects($this->exactly(3)) ->method('getChangelog') ->willReturn($otherChangelogMock); @@ -234,6 +239,17 @@ public function testCreate() ->method('createTrigger') ->with($triggerMock); + $this->tableName = 'thisTableName'; + + $this->viewMock->expects($this->exactly(3)) + ->method('getSubscriptions') + ->willReturn( + [ + $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], + 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] + ] + ); + $this->model->create(); } @@ -285,6 +301,7 @@ public function testRemove() true, [] ); + $otherViewMock->expects($this->exactly(1)) ->method('getId') ->willReturn('other_id'); @@ -293,6 +310,15 @@ public function testRemove() ->method('getChangelog') ->willReturn($otherChangelogMock); + $otherViewMock->expects($this->any()) + ->method('getSubscriptions') + ->willReturn( + [ + $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], + 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] + ] + ); + $this->viewMock->expects($this->exactly(3)) ->method('getId') ->willReturn('this_id'); diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index a65f6e98016f1..cfab8b2479bc1 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -11,9 +11,7 @@ use Magento\Framework\Mview\View\StateInterface; /** - * Class Subscription - * - * @package Magento\Framework\Mview\View + * Mview subscription. */ class Subscription implements SubscriptionInterface { @@ -202,7 +200,7 @@ protected function buildStatement($event, $view) // We will use column name from it. $subscriptions = $view->getSubscriptions() ?? []; if (empty($subscriptions[$this->getTableName()])) { - return ''; + return ''; } $subscription = $subscriptions[$this->getTableName()]; From df20ae184f493825627219cadb0e3f0f0e5c6947 Mon Sep 17 00:00:00 2001 From: Aapo Kiiso Date: Tue, 17 Nov 2020 15:12:33 +0200 Subject: [PATCH 08/73] Allow backend login without redirect --- .../Magento/Backend/Controller/Adminhtml/Auth/Login.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php index 1de77c810f316..18de812b2fa9d 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php @@ -48,12 +48,6 @@ public function execute() return $this->getRedirect($this->_backendUrl->getStartupPageUrl()); } - $requestUrl = $this->getRequest()->getUri(); - $backendUrl = $this->getUrl('*'); - // redirect according to rewrite rule - if ($requestUrl != $backendUrl) { - return $this->getRedirect($backendUrl); - } return $this->resultPageFactory->create(); } From 4c1094ac6a1e2439b5525878f7f273b6dfab45b4 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Wed, 25 Nov 2020 16:02:37 +0200 Subject: [PATCH 09/73] extracted getting column to separate method --- .../Framework/Mview/View/Subscription.php | 72 +++++++++++-------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index cfab8b2479bc1..6cbfa8012e71b 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -7,8 +7,10 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Trigger; -use Magento\Framework\Mview\View\StateInterface; +use Magento\Framework\DB\Ddl\TriggerFactory; +use Magento\Framework\Mview\ViewInterface; /** * Mview subscription. @@ -18,17 +20,17 @@ class Subscription implements SubscriptionInterface /** * Database connection * - * @var \Magento\Framework\DB\Adapter\AdapterInterface + * @var AdapterInterface */ protected $connection; /** - * @var \Magento\Framework\DB\Ddl\TriggerFactory + * @var TriggerFactory */ protected $triggerFactory; /** - * @var \Magento\Framework\Mview\View\CollectionInterface + * @var CollectionInterface */ protected $viewCollection; @@ -60,7 +62,7 @@ class Subscription implements SubscriptionInterface * * @var array */ - private $ignoredUpdateColumns = []; + private $ignoredUpdateColumns; /** * @var Resource @@ -69,18 +71,18 @@ class Subscription implements SubscriptionInterface /** * @param ResourceConnection $resource - * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory - * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection - * @param \Magento\Framework\Mview\ViewInterface $view + * @param TriggerFactory $triggerFactory + * @param CollectionInterface $viewCollection + * @param ViewInterface $view * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns */ public function __construct( ResourceConnection $resource, - \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory, - \Magento\Framework\Mview\View\CollectionInterface $viewCollection, - \Magento\Framework\Mview\ViewInterface $view, + TriggerFactory $triggerFactory, + CollectionInterface $viewCollection, + ViewInterface $view, $tableName, $columnName, $ignoredUpdateColumns = [] @@ -96,9 +98,9 @@ public function __construct( } /** - * Create subsciption + * Create subscription * - * @return \Magento\Framework\Mview\View\SubscriptionInterface + * @return SubscriptionInterface */ public function create() { @@ -115,7 +117,7 @@ public function create() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - /** @var \Magento\Framework\Mview\ViewInterface $view */ + /** @var ViewInterface $view */ $trigger->addStatement($this->buildStatement($event, $view)); } @@ -129,7 +131,7 @@ public function create() /** * Remove subscription * - * @return \Magento\Framework\Mview\View\SubscriptionInterface + * @return SubscriptionInterface */ public function remove() { @@ -144,7 +146,7 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - /** @var \Magento\Framework\Mview\ViewInterface $view */ + /** @var ViewInterface $view */ $trigger->addStatement($this->buildStatement($event, $view)); } @@ -170,13 +172,13 @@ protected function getLinkedViews() $viewList = $this->viewCollection->getViewsByStateMode(StateInterface::MODE_ENABLED); foreach ($viewList as $view) { - /** @var \Magento\Framework\Mview\ViewInterface $view */ + /** @var ViewInterface $view */ // Skip the current view if ($view->getId() == $this->getView()->getId()) { continue; } // Search in view subscriptions - foreach ($view->getSubscriptions() ?? [] as $subscription) { + foreach ($view->getSubscriptions() as $subscription) { if ($subscription['name'] != $this->getTableName()) { continue; } @@ -191,21 +193,12 @@ protected function getLinkedViews() * Build trigger statement for INSERT, UPDATE, DELETE events * * @param string $event - * @param \Magento\Framework\Mview\ViewInterface $view + * @param ViewInterface $view * @return string */ protected function buildStatement($event, $view) { - // Get the subscription for the specific view and specific table. - // We will use column name from it. - $subscriptions = $view->getSubscriptions() ?? []; - if (empty($subscriptions[$this->getTableName()])) { - return ''; - } - - $subscription = $subscriptions[$this->getTableName()]; - - // Get the changelog from View to get changelog column name. + $column = $this->getSubscriptionColumn($view); $changelog = $view->getChangelog(); switch ($event) { @@ -242,14 +235,31 @@ protected function buildStatement($event, $view) default: return ''; } + return sprintf( $trigger, $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), $this->connection->quoteIdentifier($changelog->getColumnName()), - $this->connection->quoteIdentifier($subscription['column']) + $this->connection->quoteIdentifier($column) ); } + /** + * Returns subscription column name by view + * + * @param ViewInterface $view + * @return string + */ + private function getSubscriptionColumn(ViewInterface $view): string + { + $subscriptions = $view->getSubscriptions(); + if (!isset($subscriptions[$this->getTableName()]['column'])) { + throw new \RuntimeException(sprintf('Column name for view with id "%s" doesn\'t exist', $view->getId())); + } + + return $subscriptions[$this->getTableName()]['column']; + } + /** * Build an "after" event for the given table and event * @@ -269,7 +279,7 @@ private function getAfterEventTriggerName($event) /** * Retrieve View related to subscription * - * @return \Magento\Framework\Mview\ViewInterface + * @return ViewInterface * @codeCoverageIgnore */ public function getView() From 4ad7aae8b66c9b18a6c67c53d202014f1086b4f5 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Mon, 30 Nov 2020 10:37:48 +0200 Subject: [PATCH 10/73] fix unit test --- .../Mview/Test/Unit/View/SubscriptionTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index c4df73a79a5d8..df7d246f538aa 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -383,6 +383,18 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ->method('getViewId') ->willReturn($viewId); + $this->viewMock->expects($this->once()) + ->method('getSubscriptions') + ->willReturn( + [ + $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], + 'cataloginventory_stock_item' => ['name' => 'otherTableName', 'column' => 'columnName'] + ] + ); + $this->viewMock->expects($this->once()) + ->method('getChangeLog') + ->willReturn($otherChangelogMock); + $model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, @@ -396,7 +408,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void $method = new \ReflectionMethod($model, 'buildStatement'); $method->setAccessible(true); - $statement = $method->invoke($model, Trigger::EVENT_UPDATE, $otherChangelogMock); + $statement = $method->invoke($model, Trigger::EVENT_UPDATE, $this->viewMock); $this->assertStringNotContainsString($ignoredColumnName, $statement); $this->assertStringContainsString($notIgnoredColumnName, $statement); From 8a9b7689bb75567ae92e7e9b938f9095475fae3e Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Mon, 30 Nov 2020 10:41:31 +0200 Subject: [PATCH 11/73] define arguments & return types --- lib/internal/Magento/Framework/Mview/View/Subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 20ea0998afc2d..d8367bb832e82 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -205,7 +205,7 @@ protected function getLinkedViews() * @param ViewInterface $view * @return string */ - protected function buildStatement($event, $view) + protected function buildStatement(string $event, ViewInterface $view): string { $column = $this->getSubscriptionColumn($view); $changelog = $view->getChangelog(); From 1de30e394110c0fb284994c4da73390530462723 Mon Sep 17 00:00:00 2001 From: saphaljha Date: Tue, 8 Dec 2020 19:10:15 +0530 Subject: [PATCH 12/73] Changed config to store before default --- app/code/Magento/Newsletter/Model/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Config.php b/app/code/Magento/Newsletter/Model/Config.php index c469d35e74f72..eba0980e993b2 100644 --- a/app/code/Magento/Newsletter/Model/Config.php +++ b/app/code/Magento/Newsletter/Model/Config.php @@ -41,7 +41,7 @@ public function __construct( * @param string $scopeType * @return bool */ - public function isActive(string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT): bool + public function isActive(string $scopeType = \Magento\Store\Model\ScopeInterface::SCOPE_STORE): bool { return $this->scopeConfig->isSetFlag(self::XML_PATH_NEWSLETTER_ACTIVE, $scopeType); } From 760a4e362ec11ffaec8e317c16fbea9e5557de45 Mon Sep 17 00:00:00 2001 From: Aapo Kiiso Date: Wed, 9 Dec 2020 08:53:52 +0200 Subject: [PATCH 13/73] Fix test to check that login form is visible after admin expiration --- .../Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml index dc88ad9d2cbf1..4996992c70245 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml @@ -48,7 +48,7 @@ - + From edab7db4816e971a8cdf43c8704f97765e12b49d Mon Sep 17 00:00:00 2001 From: Anna Pak Date: Thu, 10 Dec 2020 09:57:32 +0200 Subject: [PATCH 14/73] Refactored Search Actions --- ...tNameIsNotOnProductMainPageActionGroup.xml | 21 +++++++++++++ ...ateProductAttributeFromProductPageTest.xml | 14 ++++++--- ...CustomOptionsSuiteAndImportOptionsTest.xml | 14 ++++++--- ...nCreateVirtualProductWithTierPriceTest.xml | 15 ++++++--- ...rifyDataOverridingOnStoreViewLevelTest.xml | 31 +++++++++++++------ ...rifyDataOverridingOnStoreViewLevelTest.xml | 20 +++++++----- ...dminUpdateSimpleProductTieredPriceTest.xml | 16 +++++++--- ...RegularPriceInStockDisabledProductTest.xml | 14 ++++++--- ...WithRegularPriceInStockEnabledFlatTest.xml | 7 +++-- ...PriceInStockNotVisibleIndividuallyTest.xml | 19 +++++++----- ...ceInStockVisibleInCatalogAndSearchTest.xml | 18 +++++++---- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 27 ++++++++++------ ...larPriceInStockVisibleInSearchOnlyTest.xml | 15 ++++++--- ...eProductWithRegularPriceOutOfStockTest.xml | 15 ++++++--- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 14 ++++++--- ...iceOutOfStockVisibleInCategoryOnlyTest.xml | 14 ++++++--- ...PriceOutOfStockVisibleInSearchOnlyTest.xml | 14 ++++++--- ...eInStockVisibleInCategoryAndSearchTest.xml | 14 ++++++--- ...tOfStockVisibleInCategoryAndSearchTest.xml | 15 ++++++--- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 14 ++++++--- ...tOfStockVisibleInCategoryAndSearchTest.xml | 15 ++++++--- ...MinimalQueryLengthForCatalogSearchTest.xml | 14 ++++++--- 22 files changed, 243 insertions(+), 117 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml new file mode 100644 index 0000000000000..9492aabe1c6f3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + Validates that the provided Product Name is NOT present on a Storefront page. + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 61ef389c7909e..759087afbf95a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -129,10 +129,14 @@ - - - - - + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 7871f4305575a..1874f0709d9ec 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -127,11 +127,15 @@ - - - - - + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index 994ea76ca33df..0c488b86a92c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -105,11 +105,16 @@ - - - - - + + + + + + + + + + As low as ${{tierPriceOnVirtualProduct.price}} diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 5f7cecfde188a..3b1e9582ebc4c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -71,20 +71,31 @@ - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index 8a05ed9d64b8b..62ca93f9bba7b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -69,20 +69,24 @@ - - - - + + + + + + - - - - + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..d7c5377327193 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -112,6 +112,7 @@ + @@ -143,10 +144,15 @@ - - - - - + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index a9630aba467c6..2775876895499 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -81,10 +81,14 @@ - - - - - + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index aa1b1ae702914..c1b80b94179fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -8,15 +8,18 @@ - + - + <title value="DEPRECACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <testCaseId value="MC-10818"/> <severity value="CRITICAL"/> <group value="catalog"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 86fac835ce44d..7f347a6280d91 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -57,7 +57,7 @@ <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="selectVisibility"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="fillSimpleProductUrlKey"/> @@ -86,18 +86,23 @@ <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="seeSimpleProductUrlKey"/> <!--Verify customer don't see updated simple product link on magento storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> + <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..0158633d77df3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -86,6 +86,7 @@ <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -121,12 +122,17 @@ </assertEquals> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice245InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <argument name="phrase" value="{{simpleProductRegularPrice245InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeSimpleProductNameOnStorefrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 77c3e7548a3cf..5b45c4dce8e5b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -40,8 +40,10 @@ <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> + <!-- <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <waitForPageLoad stepKey="waitUntilProductIsOpened"/> --> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/> @@ -74,8 +76,10 @@ <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/> <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillProductSku"/> <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> - <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/> + <!-- <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> --> <!-- Verify customer see updated simple product in the product form page --> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/> @@ -86,6 +90,7 @@ <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -123,10 +128,14 @@ <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="dontSeeProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBo"> + <argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 39dab0b08915c..7b6db040ad8e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -86,6 +86,7 @@ <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -118,10 +119,14 @@ <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice325InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice325InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..8caf2afb1b914 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -86,6 +86,7 @@ <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> @@ -117,10 +118,14 @@ <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index f4375ad499dfd..469446cd702ce 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -116,11 +116,15 @@ <!-- Verify customer don't see updated virtual product link on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice.sku}}" stepKey="fillVirtualProductSkuOnStorefrontPage"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductSkuOnStorefrontPagee"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductRegularPrice.name}}"/> + </actionGroup> <!-- Verify customer see updated virtual product in category page --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 343326547254a..ac8b80045bdc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -122,10 +122,14 @@ <!--Verify customer don't see updated virtual product link(from above step) on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 0d6a1c87c62fe..942079421e3aa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -100,11 +100,15 @@ <!--Verify customer don't see updated virtual product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice99OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"> + <argument name="productName" value="{{updateVirtualProductRegularPrice99OutOfStock.name}}"/> + </actionGroup> <!--Verify customer don't see updated virtual product link on category page --> <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.name$$)}}" stepKey="openCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index f423cd6c77807..da43d12ab7983 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -112,11 +112,15 @@ <!-- Verify customer see updated virtual product on the magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPrice.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductSpecialPrice.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductSpecialPrice.name}}"/> + </actionGroup> <!--Verify customer see updated virtual product with special price(from above step) on product storefront page by url key --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 78a15ee7eb195..c72fe4e8d8535 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -130,10 +130,15 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductNameOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductNameOnStorefrontPage"> + <argument name="productName" value="{{updateVirtualProductSpecialPriceOutOfStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index f64e628c0edb9..1006ba0df12db 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -146,10 +146,14 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductWithTierPriceInStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductTierPriceInStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductTierPriceInStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductWithTierPriceInStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 6e835f2e5e98b..b611d31782925 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -146,10 +146,15 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualTierPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualTierPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualTierPriceOutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualTierPriceOutOfStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml index d6a5aa8b93572..8b9b78b67bc75 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml @@ -38,10 +38,14 @@ <comment userInput="Go to Storefront and search for product" stepKey="searchProdUsingMinQueryLength"/> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> <comment userInput="Quick search by single character and avoid using ES stopwords" stepKey="commentQuickSearch"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="B" stepKey="fillAttribute"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInCategoryPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <argument name="phrase" value="B"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> </test> </tests> From e93ac14f541dcf01585453c7921d68396be63e03 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 10:17:44 +0200 Subject: [PATCH 15/73] AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest adjusted --- ...mpleProductWithRegularPriceInStockEnabledFlatTest.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index c1b80b94179fa..018337d9e09d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -8,18 +8,15 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead"> + <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest"> <annotations> <stories value="Update Simple Product"/> - <title value="DEPRECACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <testCaseId value="MC-10818"/> <severity value="CRITICAL"/> <group value="catalog"/> <group value="mtf_migrated"/> - <skip> - <issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId> - </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -140,4 +137,4 @@ <waitForPageLoad stepKey="waitForSearch"/> <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> </test> -</tests> +</tests> \ No newline at end of file From 99cfcaa7cf5d6e26d53a23f13b466bd19c82ec3a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 10:18:46 +0200 Subject: [PATCH 16/73] refactored --- ...pdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index 018337d9e09d4..aa1b1ae702914 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForSearch"/> <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> </test> -</tests> \ No newline at end of file +</tests> From 701a96a2df0ebefaefff6da3a45f25dde5931cb2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 17:25:01 +0200 Subject: [PATCH 17/73] refactored asserting product details on storefont --- ...tAdminManageStockOnEditPageActionGroup.xml | 23 +++++++++++ ...uctStockStatusOnProductPageActionGroup.xml | 21 ++++++++++ ...dminUpdateSimpleProductTieredPriceTest.xml | 38 ++++++++++--------- ...ceInStockVisibleInCatalogAndSearchTest.xml | 38 ++++++++++--------- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 34 +++++++++-------- ...larPriceInStockVisibleInSearchOnlyTest.xml | 38 ++++++++++--------- ...gularPriceInStockWithCustomOptionsTest.xml | 36 ++++++++++-------- ...eProductWithRegularPriceOutOfStockTest.xml | 34 +++++++++-------- 8 files changed, 165 insertions(+), 97 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..5e993106b5a61 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml @@ -0,0 +1,23 @@ +<?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="AssertAdminManageStockOnEditPageActionGroup"> + <annotations> + <description>Check if manageStock value is correct + (the Product Edit page->Advanced Inventory section should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="manageStock" type="string"/> + </arguments> + + <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="seeManageStock"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..857d88ebc197c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AssertStorefrontProductStockStatusOnProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Stock Status is present and correct + (the Product Detail page should be opened on Storefront prior this check)</description> + </annotations> + <arguments> + <argument name="productStockStatus" type="string"/> + </arguments> + + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..0f10142ccbd52 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -6,7 +6,7 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminUpdateSimpleProductTieredPriceTest"> <annotations> @@ -71,10 +71,10 @@ <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="fillSimpleProductWeight"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="selectProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -122,23 +122,27 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductTierPrice300InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductTierPrice300InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductTierPrice300InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductTierPrice300InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductTierPrice300InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductTierPrice300InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/> + </actionGroup> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..93046bc624053 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -85,7 +85,7 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -102,23 +102,27 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice245InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice245InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice245InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice245InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice245InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/> + </actionGroup> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 77c3e7548a3cf..5f0b14d9cd404 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -85,7 +85,7 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -102,23 +102,27 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice32501InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice32501InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/> + </actionGroup> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 39dab0b08915c..8e9040a371f52 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -85,7 +85,7 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -97,23 +97,27 @@ <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice325InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice325InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice325InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice325InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice325InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice325InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice325InStock.storefrontStatus}}"/> + </actionGroup> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 670030d1d98ea..f9fc864f079e0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -98,7 +98,7 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPriceCustomOptions.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPriceCustomOptions.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPriceCustomOptions.urlKey}}" stepKey="seeUrlKey"/> @@ -117,23 +117,27 @@ <seeInField selector="{{AdminProductCustomizableOptionsSection.fillOptionValueSku(simpleProductCustomizableOption.title,'0')}}" userInput="{{simpleProductCustomizableOption.option_0_sku}}" stepKey="seeOptionSku"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPriceCustomOptions.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPriceCustomOptions.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPriceCustomOptions.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPriceCustomOptions.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPriceCustomOptions.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPriceCustomOptions.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPriceCustomOptions.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPriceCustomOptions.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPriceCustomOptions.storefrontStatus}}"/> + </actionGroup> <!--Verify customer see customizable options are Required --> <seeElement selector="{{StorefrontProductInfoMainSection.requiredCustomSelect(simpleProductCustomizableOption.title)}}" stepKey="verifyFirstCustomOptionIsRequired"/> @@ -153,7 +157,7 @@ <seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeYouAddedSimpleprod4ToYourShoppingCartSuccessSaveMessage"/> <seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> - <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.storefront_new_cartprice}}" stepKey="seeProductPriceInMiniCart"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..ae03f0f075e62 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -85,7 +85,7 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> @@ -96,23 +96,27 @@ <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice32503OutOfStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}"/> + </actionGroup> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> From 40cf39ef3153061e06b59a503c88cd261700a953 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 17:33:44 +0200 Subject: [PATCH 18/73] refactored --- .../Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 0f10142ccbd52..f05dde1902c68 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -6,7 +6,7 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminUpdateSimpleProductTieredPriceTest"> <annotations> From 631dc30f6ebbed20ed0555c8b8cf1078210160e3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 13 Dec 2020 10:42:47 +0200 Subject: [PATCH 19/73] renamed ActionGroup --- ...efrontAssertProductNameIsNotOnProductMainPageActionGroup.xml | 2 +- ...eSimpleProductWithRegularPriceInStockDisabledProductTest.xml | 2 +- ...ProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml | 2 +- ...leProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 2 +- .../AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml | 2 +- ...lProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...oductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml | 2 +- ...ProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml | 2 +- ...WithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- ...tualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...uctWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml index 9492aabe1c6f3..ccda16f37085f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml @@ -7,7 +7,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup"> + <actionGroup name="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup"> <annotations> <description>Validates that the provided Product Name is NOT present on a Storefront page.</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index 2775876895499..38591b836e52a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -87,7 +87,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage"> <argument name="productName" value="{{simpleProductDisabled.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 7f347a6280d91..dd8792e68af2b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -101,7 +101,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"> <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 5b45c4dce8e5b..8946a86fef2ab 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -134,7 +134,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 8caf2afb1b914..f440f714e8c39 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -124,7 +124,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 469446cd702ce..cda4e092a444f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -122,7 +122,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> <argument name="productName" value="{{updateVirtualProductRegularPrice.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index ac8b80045bdc0..1c23d2cd59f39 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -128,7 +128,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> <argument name="productName" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 942079421e3aa..c738a589946c0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -106,7 +106,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"> <argument name="productName" value="{{updateVirtualProductRegularPrice99OutOfStock.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index c72fe4e8d8535..df2e7f530158f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -136,7 +136,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductNameOnStorefrontPage"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductNameOnStorefrontPage"> <argument name="productName" value="{{updateVirtualProductSpecialPriceOutOfStock.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 1006ba0df12db..6d21178bbfa01 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -152,7 +152,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> <argument name="productName" value="{{updateVirtualProductWithTierPriceInStock.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index b611d31782925..ded8f7d03029e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -152,7 +152,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> <argument name="productName" value="{{updateVirtualTierPriceOutOfStock.name}}"/> </actionGroup> From c11b85901a6508d1d5c6201ff14321c6ca7f6b1b Mon Sep 17 00:00:00 2001 From: OMelnyk <sasha19957099@gmail.com> Date: Mon, 14 Dec 2020 14:37:52 +0200 Subject: [PATCH 20/73] magento/partners-magento2ce#31112: Customer Order Totals missing gift card amount --- app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php index ab3ace45f336c..d767cfd32cdb9 100644 --- a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php +++ b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php @@ -60,7 +60,8 @@ public function resolve( ], 'taxes' => $this->getAppliedShippingTaxesDetails($order), 'discounts' => $this->getShippingDiscountDetails($order), - ] + ], + 'model' => $order ]; } From e5444ad190e86c06855006518fb9b32486ca2d0a Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk <vova.yatsyuk@gmail.com> Date: Thu, 17 Dec 2020 16:31:44 +0200 Subject: [PATCH 21/73] Add missing vatid field. It was copied from nearby address/edit.phtml template --- .../view/frontend/templates/form/register.phtml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml index 5e58f94683ec1..1d25a601c5523 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml @@ -131,6 +131,23 @@ $formData = $block->getFormData(); </div> </div> + <?php if ($addressHelper->isVatAttributeVisible()): ?> + <?php $_vatidValidationClass = $addressHelper->getAttributeValidationClass('vat_id'); ?> + <div class="field taxvat"> + <label class="label" for="vat_id"> + <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?></span> + </label> + <div class="control"> + <input type="text" + name="vat_id" + value="<?= $escaper->escapeHtmlAttr($formData->getVatId()) ?>" + title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?>" + class="input-text <?= $escaper->escapeHtmlAttr($_vatidValidationClass) ?>" + id="vat_id"> + </div> + </div> + <?php endif; ?> + <div class="field country required"> <label for="country" class="label"> <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('country_id') ?></span> From 73ef59b9e0a3a1f7ada74bdd00f7168d7106ace1 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 18 Dec 2020 16:43:36 +0200 Subject: [PATCH 22/73] magento/magento2#30950 allow login without redirect when using a secret key --- app/code/Magento/Backend/App/Action/Plugin/Authentication.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 4b25e9921e404..519db00d6439d 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -225,7 +225,8 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt // Checks, whether secret key is required for admin access or request uri is explicitly set if ($this->_url->useSecretKey()) { - $requestUri = $this->_url->getUrl('*/*/*', ['_current' => true]); + $requestParts = explode('/', trim($request->getRequestUri(), '/'), 2); + $requestUri = $this->_url->getUrl(array_pop($requestParts)); } elseif ($request) { $requestUri = $request->getRequestUri(); } From d01133d13f6d130d5497a891a4e0ea3195a7bcac Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Fri, 18 Dec 2020 18:49:23 +0200 Subject: [PATCH 23/73] MFTF has been added. --- .../StorefrontCustomerAddressSection.xml | 1 + ...IdAtAccountCreateWithMultishipmentTest.xml | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml index c1e0ac6573be7..533a1d91b9c77 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml @@ -19,6 +19,7 @@ <element name="stateProvinceFill" type="input" selector="#region"/> <element name="zip" type="input" selector="#zip"/> <element name="country" type="select" selector="#country"/> + <element name="vatId" type="input" selector="#vat_id"/> <element name="saveAddress" type="button" selector="[data-action='save-address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml new file mode 100644 index 0000000000000..efaf4d7dc639d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml @@ -0,0 +1,55 @@ +<?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="StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest"> + <annotations> + <features value="Multishipment"/> + <stories value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> + <title value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> + <description value="'VAT Number' field should be available at create account page if 'Show VAT Number on Storefront' is Yes"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40016"/> + <group value="Multishipment"/> + </annotations> + <before> + <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 1" stepKey="showVatNumberOnStorefrontYes"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> + <argument name="tags" value="config"/> + </actionGroup> + <createData stepKey="category" entity="SimpleSubCategory"/> + <createData stepKey="product1" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <!-- Add product to the cart --> + <amOnPage url="$$product1.name$$.html" stepKey="goToProductPage"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!-- Check Out with Multiple Addresses --> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <waitForElementVisible selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="waitMultipleAddressShippingButton"/> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + <!--Create an account--> + <waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="waitCreateAnAccountButton"/> + <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickOnCreateAnAccountButton"/> + <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> + <!--Check the VAT Number field--> + <seeElement selector="{{StorefrontCustomerAddressSection.vatId}}" stepKey="assertVatIdField"/> + <after> + <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> + <argument name="tags" value="config"/> + </actionGroup> + <deleteData stepKey="deleteCategory" createDataKey="category"/> + <deleteData stepKey="deleteProduct1" createDataKey="product1"/> + </after> + </test> +</tests> From 628a1e4247dabe95ed2e343a37ed945a39811b7f Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Mon, 21 Dec 2020 14:36:21 +0530 Subject: [PATCH 24/73] Updated wishlist graphql readme file --- app/code/Magento/WishlistGraphQl/README.md | 44 ++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/WishlistGraphQl/README.md b/app/code/Magento/WishlistGraphQl/README.md index 9121593e6a759..3bab2a76bd5eb 100644 --- a/app/code/Magento/WishlistGraphQl/README.md +++ b/app/code/Magento/WishlistGraphQl/README.md @@ -1,4 +1,42 @@ -# WishlistGraphQl +# Magento_WishlistGraphQl module -**WishlistGraphQl** provides type information for the GraphQl module -to generate wishlist fields. +The **Magento_WishlistGraphQl** module adds, removes, and updates products on the wishlist. + +The **Magento_WishlistGraphQl** module extends **Magento_GraphQl** and **Magento_Wishlist** modules. The module provides type and resolver information for GraphQL API. + +## Installation details + +Before installing this module, note that the **Magento_WishlistGraphQl** is dependent on the following modules: + +- Magento_Catalog +- Magento_Checkout +- Magento_Customer +- Magento_CustomerGraphQl +- Magento_Directory +- Magento_GiftMessage +- Magento_GraphQl +- Magento_Quote +- Magento_Sales +- Magento_Store + +For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_WishlistGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistGraphQl module. + +## Additional information + +For more information about the **Magento_WishlistGraphQl** [Queries](#queries) and [Mutations](#mutations) see below: + +### Queries {#queries} + +- [`wishlist`](https://devdocs.magento.com/guides/v2.4/graphql/queries/wishlist.html) + +### Mutations {#mutations} + +- [`addProductsToWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/add-products-to-wishlist.html) +- [`removeProductsFromWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/remove-products-from-wishlist.html) +- [`updateProductsInWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/update-products-in-wishlist.html) From c16f995ae5a10e037841f2624ebf1e6987f5cba9 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Mon, 21 Dec 2020 16:54:17 +0530 Subject: [PATCH 25/73] Updated wishlist analytics readme file --- app/code/Magento/WishlistAnalytics/README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/WishlistAnalytics/README.md b/app/code/Magento/WishlistAnalytics/README.md index 275acf0796286..32cf1d35bbd06 100644 --- a/app/code/Magento/WishlistAnalytics/README.md +++ b/app/code/Magento/WishlistAnalytics/README.md @@ -1,3 +1,18 @@ # Magento_WishlistAnalytics module -The Magento_WishlistAnalytics module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The **Magento_WishlistAnalytics** module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). + +## Installation details + +Before installing this module, note that the **Magento_WishlistAnalytics** is dependent on the following modules: + +- Magento_Analytics +- Magento_Wishlist + +For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_WishlistAnalytics module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistAnalytics module. From 217c32c91a960a28f648efe9653fc3517af65779 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 21 Dec 2020 13:54:58 +0200 Subject: [PATCH 26/73] redirect to backend if request uri isn't valid --- app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php | 5 +++++ app/code/Magento/User/Controller/Adminhtml/User/Save.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php index 18de812b2fa9d..16be2cf1343eb 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php @@ -48,6 +48,11 @@ public function execute() return $this->getRedirect($this->_backendUrl->getStartupPageUrl()); } + $requestUrl = $this->getRequest()->getUri(); + if (!$requestUrl->isValid()) { + return $this->getRedirect($this->getUrl('*')); + } + return $this->resultPageFactory->create(); } diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Save.php b/app/code/Magento/User/Controller/Adminhtml/User/Save.php index 521c09f7b7707..72024a85bef13 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Save.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Save.php @@ -105,7 +105,7 @@ public function execute() $this->getSecurityCookie()->setLogoutReasonCookie( \Magento\Security\Model\AdminSessionsManager::LOGOUT_REASON_USER_LOCKED ); - $this->_redirect('adminhtml/*/'); + $this->_redirect('*'); } catch (NotificationExceptionInterface $exception) { $this->messageManager->addErrorMessage($exception->getMessage()); } catch (\Magento\Framework\Exception\AuthenticationException $e) { From 6e3b5b09fc4208c6a0545b70a0c2c8771f491744 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 21 Dec 2020 13:56:25 +0200 Subject: [PATCH 27/73] added a comment to prevent bic --- .../Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml index 4996992c70245..c7bfdd8bb9e98 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml @@ -48,6 +48,7 @@ <wait time="120" stepKey="waitForUserToExpire"/> <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomers"/> <!-- Confirm that user is logged out --> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAdminLoginUrl"/> <seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/> <!-- Delete created user --> From cfbc08c8957ab7a23fc3a6c074303950c93e126c Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Tue, 22 Dec 2020 10:22:40 +0530 Subject: [PATCH 28/73] Removed extensibility content from the readme file. --- app/code/Magento/WishlistAnalytics/README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/code/Magento/WishlistAnalytics/README.md b/app/code/Magento/WishlistAnalytics/README.md index 32cf1d35bbd06..5bbd19416ac82 100644 --- a/app/code/Magento/WishlistAnalytics/README.md +++ b/app/code/Magento/WishlistAnalytics/README.md @@ -10,9 +10,3 @@ Before installing this module, note that the **Magento_WishlistAnalytics** is de - Magento_Wishlist For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Extensibility - -Extension developers can interact with the Magento_WishlistAnalytics module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistAnalytics module. From 6cb297ba167aa95aaa0f2f9fa000292dcfaabd1a Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Tue, 22 Dec 2020 13:27:50 +0530 Subject: [PATCH 29/73] Updated wishlist readme file --- app/code/Magento/Wishlist/README.md | 102 +++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Wishlist/README.md b/app/code/Magento/Wishlist/README.md index 1caed125814e7..67fbef6771cba 100644 --- a/app/code/Magento/Wishlist/README.md +++ b/app/code/Magento/Wishlist/README.md @@ -1,2 +1,100 @@ -The Magento_Wishlist implements the Wishlist functionality. -This allows customers to create a list of products that they can add to their shopping cart to be purchased at a later date, or share with friends. +# Magento_Wishlist module + +The **Magento_Wishlist** module implements the Wishlist functionality. + +This module allows customers to create a list of products that they can add to their shopping cart to be purchased at a later date, or share with friends. + +## Installation details + +Before installing this module, note that the **Magento_Wishlist** is dependent on the following modules: + +- Magento_Captcha +- Magento_Catalog +- Magento_Customer + +Before disabling or uninstalling this module, please consider the following dependencies: + +- Magento_WishlistAnalytics + +Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +`Pricing/` - the directory that contain solutions for configurable and downloadable product price. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_Wishlist module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Wishlist module. + +### Events + +The module dispatches the following events: + +- `product_option_renderer_init` event in the `\Magento\Wishlist\Block\Customer\Wishlist\Item\Options::_construct()` method. Parameters: + - `block` is a Wishlist block customer items (`\Magento\Wishlist\Block\Customer\Wishlist\Item\Options` class). +- `rss_wishlist_xml_callback` event in the `\Magento\Wishlist\Model\Rss\Wishlist::getRssData()` method. Parameters: + - `$args` is a array of product object (`\Magento\Catalog\Model\Product` class). +- `wishlist_add_item` event in the `\Magento\Wishlist\Model\Wishlist::addItem()` method. Parameters: + - `item` is an item object (`\Magento\Wishlist\Model\Item` class). +- `wishlist_add_product` event in the `\Magento\Wishlist\Controller\Index\Add::execute()` method. Parameters: + - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). + - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). + - `item` is an item object (`\Magento\Wishlist\Model\Item` class). +- `wishlist_item_collection_products_after_load` event in the `\Magento\Wishlist\Model\ResourceModel\Item\Collection::_assignProducts()` method. Parameters: + - `product_collection` is a product collection object (`\Magento\Catalog\Model\ResourceModel\Product\Collection` class). +- `wishlist_items_renewed` event in the `\Magento\Wishlist\Helper\Data::calculate()` method. +- `wishlist_product_add_after` event in the `\Magento\Wishlist\Model\Wishlist::addNewItem()` method. Parameters: + - `items` is an array of item object (`\Magento\Wishlist\Model\Item` class). +- `wishlist_share` event in the `\Magento\Wishlist\Controller\Index\Send::execute()` method. Parameters: + - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). +- `wishlist_update_item` event in the `\Magento\Wishlist\Controller\Index\UpdateItemOptions::execute()` method. Parameters: + - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). + - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). + - `item` is an item object (`\Magento\Wishlist\Model\Item` class). + +For information about the event system in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +This module introduces the following layouts and layout handles in the directories: + +- `view/adminhtml/layout`: + - `customer_index_wishlist` +- `view/base/layout`: + - `catalog_product_prices` +- `view/frantend/layout`: + - `catalog_category_view` + - `catalog_product_view` + - `catalogsearch_advanced_result` + - `checkout_cart_index` + - `checkout_cart_item_renderers` + - `customer_account` + - `default` + - `wishlist_email_items` + - `wishlist_email_rss` + - `wishlist_index_configure` + - `wishlist_index_configure_type_bundle` + - `wishlist_index_configure_type_configurable` + - `wishlist_index_configure_type_downloadable` + - `wishlist_index_configure_type_grouped` + - `wishlist_index_configure_type_simple` + - `wishlist_index_index` + - `wishlist_index_share` + - `wishlist_shared_index.xml` + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +You can extend a customer form and widgets using the configuration files located in the directories +- `view/base/ui_component`: + - `customer_form` +- `view/frontend/ui_component`: + - `widget_recently_compared` + - `widget_recently_viewed` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). From 8584f85dbb74fd6b4a014d6f2199849446302d96 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Tue, 22 Dec 2020 14:19:07 +0530 Subject: [PATCH 30/73] Updated widget readme file --- app/code/Magento/Widget/README.md | 42 ++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Widget/README.md b/app/code/Magento/Widget/README.md index 4d70d3b6838e0..bac31207cc228 100644 --- a/app/code/Magento/Widget/README.md +++ b/app/code/Magento/Widget/README.md @@ -1 +1,41 @@ -The Widget module allows Magento application to be extended with custom widget blocks. \ No newline at end of file +# Magento_Widget module + +The **Magento_Widget** module allows Magento application to be extended with custom widget blocks. + +## Installation details + +Before installing this module, note that the **Magento_Widget** is dependent on the following modules: + +- Magento_Catalog +- Magento_Cms +- Magento_Store + +Before disabling or uninstalling this module, please consider the following dependencies: + +- Magento_CatalogWidget +- Magento_CurrencySymbol +- Magento_Newsletter + +Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the **Magento_Widget** module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Widget** module. + +### Layouts + +This module introduces the following layouts and layout handles in the directories: + +- `view/adminhtml/layout`: + - `adminhtml_widget_index` + - `adminhtml_widget_instance_block` + - `adminhtml_widget_instance_edit` + - `adminhtml_widget_instance_index` + - `adminhtml_widget_loadoptions` +- `view/frantend/layout`: + - `default` + - `print` + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). From ee667ff1e80c685b27bbe129bce1e4ff43d887bb Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Tue, 22 Dec 2020 14:24:54 +0530 Subject: [PATCH 31/73] Update README.md --- app/code/Magento/WishlistGraphQl/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/WishlistGraphQl/README.md b/app/code/Magento/WishlistGraphQl/README.md index 3bab2a76bd5eb..43b455ad58b81 100644 --- a/app/code/Magento/WishlistGraphQl/README.md +++ b/app/code/Magento/WishlistGraphQl/README.md @@ -2,7 +2,7 @@ The **Magento_WishlistGraphQl** module adds, removes, and updates products on the wishlist. -The **Magento_WishlistGraphQl** module extends **Magento_GraphQl** and **Magento_Wishlist** modules. The module provides type and resolver information for GraphQL API. +The **Magento_WishlistGraphQl** module extends **Magento_GraphQl** and **Magento_Wishlist** modules. This module provides type and resolver information for GraphQL API. ## Installation details From af5765d2af52f59d364f7b2b0d035387ad8733bc Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Tue, 22 Dec 2020 14:34:02 +0530 Subject: [PATCH 32/73] Updated weee graphql module readme file --- app/code/Magento/WeeeGraphQl/README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/WeeeGraphQl/README.md b/app/code/Magento/WeeeGraphQl/README.md index b44771513d562..c80589a38af5c 100644 --- a/app/code/Magento/WeeeGraphQl/README.md +++ b/app/code/Magento/WeeeGraphQl/README.md @@ -1,4 +1,22 @@ -# WeeeGraphQl +# Magento_WeeeGraphQl module -**WeeeGraphQl** provides type information for the GraphQl module -to generate wee tax fields for catalog and product information endpoints. +The **Magento_WeeeGraphQl** module provides type information for the GraphQl module to generate wee tax fields for the catalog and product information endpoints. + +The **Magento_WeeeGraphQl** module extends **Magento_GraphQl** and **Magento_Weee** modules. This module provides type and resolver information for GraphQL API. + +## Installation details + +Before installing this module, note that the **Magento_WeeeGraphQl** is dependent on the following modules: + +- `Magento_CatalogGraphQl` +- `Magento_Store` +- `Magento_Tax` +- `Magento_Weee` + +For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the **Magento_WeeeGraphQl** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_WeeeGraphQl** module. From cfa15e19f1d063e25b841178e33afe77606c5188 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 22 Dec 2020 15:16:59 +0200 Subject: [PATCH 33/73] refactored AdminCheckingCreditMemoTotalsTes --- ...dminCheckingCreditMemoUpdateTotalsTest.xml | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 37a4782ce2e73..03dd8b28a624f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -20,44 +20,61 @@ <group value="sales"/> </annotations> <before> - <!--Create product--> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <!--Create customer--> + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> - <!--Login to admin page--> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <!--Delete simple product--> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <!--Delete customer--> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> - <argument name="product" value="$$createSimpleProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="submitInvoice"/> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="getOrderId"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$getOrderId}"/> </actionGroup> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <!--Create invoice--> - <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> - <!--Submit invoice--> - <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> - <!--Create Credit Memo--> <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> - <argument name="orderId" value="{$grabOrderId}"/> + <argument name="orderId" value="{$getOrderId}"/> </actionGroup> <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> <actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateCreditMemoTotals"/> <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> - <!--Go to Credit Memo tab--> <click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemosTab"/> <waitForPageLoad stepKey="waitForCreditMemosGridToLoad"/> - <!--Check refunded total --> <see selector="{{AdminOrderCreditMemosTabSection.gridRow('1')}}" userInput="$123" stepKey="seeCreditMemoInGrid"/> </test> </tests> From b162d05d3c2cb933ad8116debdb71d5ae3a5bb89 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 22 Dec 2020 18:09:24 +0200 Subject: [PATCH 34/73] magento/magento2#31251: [MFTF] Refactoring of Search actions on Storefront. --- ...roductWithRegularPriceInStockNotVisibleIndividuallyTest.xml | 1 - ...eProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 3 --- .../AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml | 1 - 3 files changed, 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index f36b76d0f8dcd..6cdc3da8d94a3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index ee69bc5ced82b..807de2821fbc1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -38,9 +38,6 @@ <!-- Search default simple product in the grid --> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> - </actionGroup><comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 049d7fc0eaebe..4a7f6366617a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> From 7cf765776bec638224b4a3ea1c1bf51def4249d7 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Wed, 23 Dec 2020 15:15:05 +0530 Subject: [PATCH 35/73] Updated weee module readme file --- app/code/Magento/Weee/README.md | 113 ++++++++++++++++++++++++++------ 1 file changed, 93 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index ef433ec4c96f9..3ba049795b8c9 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -1,26 +1,99 @@ -# Overview -The Magento_Weee module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. -Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. This module extends the existing functionality of Magento_Tax. +# Magento_Weee module -The Magento_Weee module includes the following: +The **Magento_Weee** module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. -* ability to add different number of fixed product taxes to product. They are treated as a product attribute; -* configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; -* a new line item in the totals section. +Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. -# System requirements -The Magento_Weee module does not have any specific system requirements. +This module extends the existing functionality of **Magento_Tax**. -## Install -Magento_Weee module can be installed automatically (using native Magento install mechanism) without any additional actions +The **Magento_Weee** module includes the following: -## Uninstall -Magento installation with existing products with FPT: -* Disable FPT on the backend -* Remove all products with FPT -* Remove all FPT attributes from attribute sets -* Delete all FPT attributes -* Remove module directory from the code base +- Ability to add different number of fixed product taxes to product. They are treated as a product attribute. +- Configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed. +- A new line item in the totals section. -New Magento installation: -* Can be removed without additional actions +## Installation details + +The **Magento_Weee** module can be installed automatically (using native Magento install mechanism) without any additional actions. + +Before installing this module, note that the **Magento_Weee** is dependent on the following modules: + +- Magento_Catalog +- Magento_Checkout +- Magento_Customer +- Magento_Quote +- Magento_Sales +- Magento_Store +- Magento_Tax + +Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +`Pricing/` - directory that contain tax adjustment. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the **Magento_Weee** module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Weee** module. + +### Layouts + +This module introduces the following layouts and layout handles in the directories: + +- `view/adminhtml/layout`: + - `catalog_product_form` + - `sales_creditmemo_item_price` + - `sales_invoice_item_price` + - `sales_order_create_item_price` + - `sales_order_creditmemo_new` + - `sales_order_creditmemo_updateqty` + - `sales_order_creditmemo_view` + - `sales_order_invoice_new` + - `sales_order_invoice_updateqty` + - `sales_order_invoice_view` + - `sales_order_item_price` + - `sales_order_view` + +- `view/base/layout`: + - `catalog_product_prices` + +- `view/frantend/layout`: + - `checkout_cart_index` + - `checkout_index_index` + - `checkout_item_price_renderers` + - `default` + - `sales_email_item_price` + - `sales_email_order_creditmemo_items` + - `sales_email_order_invoice_items` + - `sales_email_order_items` + - `sales_guest_creditmemo` + - `sales_guest_invoice` + - `sales_guest_print` + - `sales_guest_printcreditmemo` + - `sales_guest_printinvoice` + - `sales_guest_view` + - `sales_order_creditmemo` + - `sales_order_invoice` + - `sales_order_item_price` + - `sales_order_print` + - `sales_order_printcreditmemo` + - `sales_order_printinvoice` + - `sales_order_view` + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +You can extend a customer form and widgets using the configuration files located in the directories + +- `view/adminhtml/ui_component`: + - `product_attribute_add_form` +- `view/frontend/ui_component`: + - `widget_recently_compared` + - `widget_recently_viewed` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). From db1be3fd789c37aaa4642f4c49e5fd48e84dc1c8 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Wed, 23 Dec 2020 15:31:07 +0530 Subject: [PATCH 36/73] Updated webapi security module readme file --- app/code/Magento/WebapiSecurity/README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/WebapiSecurity/README.md b/app/code/Magento/WebapiSecurity/README.md index ec5f84d1d14fa..954ec10d3dc60 100644 --- a/app/code/Magento/WebapiSecurity/README.md +++ b/app/code/Magento/WebapiSecurity/README.md @@ -1,6 +1,15 @@ -# WebapiSecurity +# Magento_WebapiSecurity module + +The **Magento_WebapiSecurity** module enables access management of some Web API resources. + +If checkbox enabled in backend through: `Stores -> Configuration -> Services -> Magento Web API -> Web Api Security` then the security of all the services outlined in `app/code/Magento/WebapiSecurity/etc/di.xml` would be loosened. You may modify this list to customize which services should follow this behavior. -**WebapiSecurity** enables access management of some Web API resources. -If checkbox is enabled in backend through: Stores -> Configuration -> Services -> Magento Web API -> Web Api Security -then the security of all of the services outlined in app/code/Magento/WebapiSecurity/etc/di.xml would be loosened. You may modify this list to customize which services should follow this behavior. By loosening the security, these services would allow access anonymously (by anyone). + +## Installation details + +Before installing this module, note that the **Magento_WebapiSecurity** is dependent on the following modules: + +- `Magento_Webapi` + +Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). From 6ef6f5789dcfa43b9507bfd64070dbb96f09f2f4 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 23 Dec 2020 12:04:59 +0200 Subject: [PATCH 37/73] added StorefrontGuestCheckoutProceedToPaymentStepActionGroup --- ...heckoutProceedToPaymentStepActionGroup.xml | 20 +++++++++++++++++++ ...sNotAffectedStartedCheckoutProcessTest.xml | 4 ++-- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 4 ++-- ...utAsCustomerUsingNonDefaultAddressTest.xml | 4 ++-- ...tomerUsingNonExistentCustomerGroupTest.xml | 4 ++-- .../OnePageCheckoutUsingSignInLinkTest.xml | 4 ++-- ...OnePageCheckoutWithAllProductTypesTest.xml | 4 ++-- ...StorefrontCheckTaxAddingValidVATIdTest.xml | 4 ++-- ...dableProductLinkAfterPartialRefundTest.xml | 4 ++-- 9 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml new file mode 100644 index 0000000000000..a55db2b92e9c3 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml @@ -0,0 +1,20 @@ +<?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="StorefrontGuestCheckoutProceedToPaymentStepActionGroup"> + <annotations> + <description>Clicks next on Checkout Shipping step. Waits for Payment step</description> + </annotations> + + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded" after="clickNext"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index ffbd6152af80b..259934503ec0e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -67,8 +67,8 @@ <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> <!-- Click Next button --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Payment step is opened --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index 3d7f8e1dcfed4..b3c5174605575 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -69,8 +69,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 8fcb8211c4625..929943dcfde52 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -64,8 +64,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(DE_Address_Berlin_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <!-- Change the address --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml index 6b1d3a7ba66aa..78c4d3301e746 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml @@ -79,8 +79,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index c7b1c441f1978..36ce5a87c9974 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -63,8 +63,8 @@ </actionGroup> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 38e2203b45258..18f5b91348191 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -187,8 +187,8 @@ <fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="fillPhone" /> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNextBtn"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 5a75d5d272295..28ae33ff7f56b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -87,8 +87,8 @@ <!--Proceed to checkout--> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml index 2ced91731e4ba..47d89ca3b8700 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml @@ -70,8 +70,8 @@ <comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/> <waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/> <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> From 0b5401fa48ae61878f7a250ab589baf3c05b5070 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Wed, 23 Dec 2020 15:51:46 +0530 Subject: [PATCH 38/73] Updated webapi async module readme file --- app/code/Magento/WebapiAsync/README.md | 29 ++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/WebapiAsync/README.md b/app/code/Magento/WebapiAsync/README.md index ed57634e77caf..3d9a2b7b10967 100644 --- a/app/code/Magento/WebapiAsync/README.md +++ b/app/code/Magento/WebapiAsync/README.md @@ -1,3 +1,28 @@ -# WebapiAsync +# Magento_WebapiAsync module -**WebapiAsync** Extends Webapi extension and provide functional to process asynchronous requests. It handle asynchronous requests, schedule, publish and consum bulk operations from queue. +**Magento_WebapiAsync** module extends Webapi extension and provide functional to process asynchronous requests. + +**Magento_WebapiAsync** module handles asynchronous requests, schedule, publish and consume bulk operations from a queue. + +## Installation details + +Before installing this module, note that the **Magento_WebapiAsync** is dependent on the following modules: + +- Magento_AsynchronousOperations +- Magento_Customer +- Magento_User +- Magento_Webapi + +Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +`Code/` - the directory that contains Remote service reader configuration files. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_WebapiAsync module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WebapiAsync module. From 772b16fd9ace21f2b6145962d42e60ed9e245352 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 23 Dec 2020 12:57:04 +0200 Subject: [PATCH 39/73] magento/magento2#31251: [MFTF] Refactoring of Search actions on Storefront. --- .../Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml | 1 - ...oductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml | 1 - ...pleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 1 - ...mpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml | 1 - 4 files changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index dbdf4dce301d3..a021bf2d7141e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -115,7 +115,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelectToApplyChanges"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index c10cd19eef563..40d8fc0d288da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 807de2821fbc1..8b26272ac35fb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 9f4b4402fb94d..e79c1a549460f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnAdvancedCategorySelect"/> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> From 7889a6ffe566b7e13fa74877b0a7c3cf82cb9e45 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Wed, 23 Dec 2020 17:56:20 +0200 Subject: [PATCH 40/73] Fix has been updated --- app/code/Magento/Customer/Block/Form/Register.php | 3 ++- app/code/Magento/Newsletter/Model/Config.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index d6d0d9c494c11..006deed601274 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -9,6 +9,7 @@ use Magento\Customer\Model\AccountManagement; use Magento\Framework\App\ObjectManager; use Magento\Newsletter\Model\Config; +use Magento\Store\Model\ScopeInterface; /** * Customer register form block @@ -184,7 +185,7 @@ public function getRegion() public function isNewsletterEnabled() { return $this->_moduleManager->isOutputEnabled('Magento_Newsletter') - && $this->newsLetterConfig->isActive(); + && $this->newsLetterConfig->isActive(ScopeInterface::SCOPE_STORE); } /** diff --git a/app/code/Magento/Newsletter/Model/Config.php b/app/code/Magento/Newsletter/Model/Config.php index eba0980e993b2..c469d35e74f72 100644 --- a/app/code/Magento/Newsletter/Model/Config.php +++ b/app/code/Magento/Newsletter/Model/Config.php @@ -41,7 +41,7 @@ public function __construct( * @param string $scopeType * @return bool */ - public function isActive(string $scopeType = \Magento\Store\Model\ScopeInterface::SCOPE_STORE): bool + public function isActive(string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT): bool { return $this->scopeConfig->isSetFlag(self::XML_PATH_NEWSLETTER_ACTIVE, $scopeType); } From 21c0bff1cf8e5ffcd73145574d9595d8625f53f3 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Wed, 23 Dec 2020 19:11:33 +0200 Subject: [PATCH 41/73] Test has been added --- ...DisabledForStoreViewAtRegistrationTest.xml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml new file mode 100644 index 0000000000000..e49948e9d2aa8 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml @@ -0,0 +1,34 @@ +<?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="StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest"> + <annotations> + <features value="Newsletter"/> + <stories value="Disabled Newsletter Subscription for store View"/> + <title value="Disabled Newsletter Subscription for store View"/> + <description value="Option to subscribe should not be displayed at registration form if it is switched off for current store"/> + <severity value="AVERAGE"/> + <group value="newsletter"/> + <group value="configuration"/> + <testCaseId value="MC-*"/> + </annotations> + <before> + <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 0" stepKey="disableSubscriptionForStore"/> + <magentoCLI command="cache:clean config" stepKey="cleanCache"/> + </before> + <after> + <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 1" stepKey="enableSubscriptionForStore"/> + <magentoCLI command="cache:clean config" stepKey="cleanCacheAgain"/> + </after> + <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="checkNoSubscriptionOption"/> + </test> +</tests> From 958af2bef627d164c29165be3ad5f9a2c0f2082b Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Thu, 24 Dec 2020 16:31:43 +0200 Subject: [PATCH 42/73] magento/magento2#31251: [MFTF] Refactoring of Search actions on Storefront. --- .../Test/AdminCreateProductAttributeFromProductPageTest.xml | 4 ++-- ...oductWithRegularPriceInStockNotVisibleIndividuallyTest.xml | 4 ++-- ...ctWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml | 2 +- ...ProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 2 +- ...roductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 3cf13bbd2f602..100d4bdef5f48 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -55,7 +55,7 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> <argument name="stockStatus" value="In Stock"/> - </actionGroup> + </actionGroup> <!-- Create New Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> @@ -133,7 +133,7 @@ </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchResultToLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> <argument name="productName" value="{{SimpleProduct.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 6cdc3da8d94a3..b5c04d2ba11f0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -57,7 +57,7 @@ <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickDoneOnCategorySelect"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="selectVisibility"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="fillSimpleProductUrlKey"/> @@ -95,7 +95,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="seeSimpleProductUrlKey"/> <!--Verify customer don't see updated simple product link on magento storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 40d8fc0d288da..0d0391ea5a873 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -124,7 +124,7 @@ </assertEquals> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> <argument name="phrase" value="{{simpleProductRegularPrice245InStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 8b26272ac35fb..76a768c1b2d21 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -126,7 +126,7 @@ <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBo"> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index cda4e092a444f..39ecb8c3bfd01 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -116,7 +116,7 @@ <!-- Verify customer don't see updated virtual product link on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductSkuOnStorefrontPagee"> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductSkuOnStorefrontPage"> <argument name="phrase" value="{{updateVirtualProductRegularPrice.sku}}"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> From 01a656ff2a318edbcc179231e31ad9b3c8565066 Mon Sep 17 00:00:00 2001 From: CJ <cperumal@ztech.io> Date: Mon, 28 Dec 2020 12:24:25 +0530 Subject: [PATCH 43/73] Chaged http to https --- app/code/Magento/WebapiAsync/README.md | 6 +++--- app/code/Magento/Weee/README.md | 10 +++++----- app/code/Magento/WeeeGraphQl/README.md | 2 +- app/code/Magento/Widget/README.md | 6 +++--- app/code/Magento/Wishlist/README.md | 10 +++++----- app/code/Magento/WishlistGraphQl/README.md | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/WebapiAsync/README.md b/app/code/Magento/WebapiAsync/README.md index 3d9a2b7b10967..36b092c938fa3 100644 --- a/app/code/Magento/WebapiAsync/README.md +++ b/app/code/Magento/WebapiAsync/README.md @@ -19,10 +19,10 @@ Please find here [how to enable or disable modules in Magento 2](https://devdocs `Code/` - the directory that contains Remote service reader configuration files. -For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility -Extension developers can interact with the Magento_WebapiAsync module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_WebapiAsync module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WebapiAsync module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WebapiAsync module. diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index 3ba049795b8c9..0e846694523a9 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -32,13 +32,13 @@ Please find here [how to enable or disable modules in Magento 2](https://devdocs `Pricing/` - directory that contain tax adjustment. -For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility -Extension developers can interact with the **Magento_Weee** module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the **Magento_Weee** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Weee** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Weee** module. ### Layouts @@ -84,7 +84,7 @@ This module introduces the following layouts and layout handles in the directori - `sales_order_printinvoice` - `sales_order_view` -For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -96,4 +96,4 @@ You can extend a customer form and widgets using the configuration files located - `widget_recently_compared` - `widget_recently_viewed` -For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +For information about a UI component in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/WeeeGraphQl/README.md b/app/code/Magento/WeeeGraphQl/README.md index c80589a38af5c..81ee1236f00a2 100644 --- a/app/code/Magento/WeeeGraphQl/README.md +++ b/app/code/Magento/WeeeGraphQl/README.md @@ -19,4 +19,4 @@ For information about enabling or disabling a module in Magento 2, see [Enable o Extension developers can interact with the **Magento_WeeeGraphQl** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_WeeeGraphQl** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_WeeeGraphQl** module. diff --git a/app/code/Magento/Widget/README.md b/app/code/Magento/Widget/README.md index bac31207cc228..8c06ee4c30fa9 100644 --- a/app/code/Magento/Widget/README.md +++ b/app/code/Magento/Widget/README.md @@ -20,9 +20,9 @@ Please find here [how to enable or disable modules in Magento 2](https://devdocs ## Extensibility -Extension developers can interact with the **Magento_Widget** module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the **Magento_Widget** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Widget** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Widget** module. ### Layouts @@ -38,4 +38,4 @@ This module introduces the following layouts and layout handles in the directori - `default` - `print` -For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). diff --git a/app/code/Magento/Wishlist/README.md b/app/code/Magento/Wishlist/README.md index 67fbef6771cba..c9ac4960c2180 100644 --- a/app/code/Magento/Wishlist/README.md +++ b/app/code/Magento/Wishlist/README.md @@ -26,9 +26,9 @@ For information about a typical file structure of a module in Magento 2, see [Mo ## Extensibility -Extension developers can interact with the Magento_Wishlist module. For more information about the Magento extension mechanism, see [Magento plug-ins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Wishlist module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Wishlist module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Wishlist module. ### Events @@ -56,7 +56,7 @@ The module dispatches the following events: - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). - `item` is an item object (`\Magento\Wishlist\Model\Item` class). -For information about the event system in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). +For information about the event system in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -86,7 +86,7 @@ This module introduces the following layouts and layout handles in the directori - `wishlist_index_share` - `wishlist_shared_index.xml` -For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -97,4 +97,4 @@ You can extend a customer form and widgets using the configuration files located - `widget_recently_compared` - `widget_recently_viewed` -For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +For information about a UI component in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/WishlistGraphQl/README.md b/app/code/Magento/WishlistGraphQl/README.md index 43b455ad58b81..7f2ba3dfa44b4 100644 --- a/app/code/Magento/WishlistGraphQl/README.md +++ b/app/code/Magento/WishlistGraphQl/README.md @@ -25,7 +25,7 @@ For information about enabling or disabling a module in Magento 2, see [Enable o Extension developers can interact with the Magento_WishlistGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistGraphQl module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistGraphQl module. ## Additional information From ed701258ce3d061899cf8d1e7143b67ca77830f9 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 28 Dec 2020 12:26:35 +0530 Subject: [PATCH 44/73] Update README.md --- app/code/Magento/Wishlist/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Wishlist/README.md b/app/code/Magento/Wishlist/README.md index c9ac4960c2180..66e0d90d5f0b2 100644 --- a/app/code/Magento/Wishlist/README.md +++ b/app/code/Magento/Wishlist/README.md @@ -22,7 +22,7 @@ Please find here [how to enable or disable modules in Magento 2](https://devdocs `Pricing/` - the directory that contain solutions for configurable and downloadable product price. -For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility From 680312b7df1af44ab7b4168f611602b310d292d9 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 28 Dec 2020 12:39:34 +0200 Subject: [PATCH 45/73] magento/magento2#31251: [MFTF] Refactoring of Search actions on Storefront. --- ...ProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml | 2 +- ...ductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index b5c04d2ba11f0..52f550248819e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -97,7 +97,7 @@ <!--Verify customer don't see updated simple product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 0d0391ea5a873..daf3833d1fd78 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -126,7 +126,7 @@ <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> From 910eb4101338d505fefc48b378082658fc6d7ddf Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 28 Dec 2020 13:50:49 +0200 Subject: [PATCH 46/73] fixing conflict merge; fixed unit test --- .../Mview/Test/Unit/View/SubscriptionTest.php | 32 +++++++------------ .../Framework/Mview/View/Subscription.php | 23 ++++++------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index 256f8d0cb19c7..ef55c71b06281 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -207,7 +207,7 @@ public function testCreate() ->method('getColumnName') ->willReturn('entity_id'); - $this->viewMock->expects($this->exactly(3)) + $this->viewMock->expects($this->atLeastOnce()) ->method('getChangelog') ->willReturn($changelogMock); @@ -251,17 +251,15 @@ public function testCreate() 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] ] ); - $otherViewMock->expects($this->exactly(3)) + $otherViewMock->expects($this->atLeastOnce()) ->method('getChangelog') ->willReturn($otherChangelogMock); $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); - $this->viewMock->expects($this->never()) - ->method('getSubscriptions'); - $this->viewCollectionMock->expects($this->exactly(1)) + $this->viewCollectionMock->expects($this->once()) ->method('getViewsByStateMode') ->with(StateInterface::MODE_ENABLED) ->willReturn([$this->viewMock, $otherViewMock]); @@ -274,8 +272,6 @@ public function testCreate() ->method('createTrigger') ->with($triggerMock); - $this->tableName = 'thisTableName'; - $this->viewMock->expects($this->exactly(3)) ->method('getSubscriptions') ->willReturn( @@ -293,7 +289,7 @@ public function testRemove() $triggerMock = $this->createMock(Trigger::class); $triggerMock->expects($this->exactly(3)) ->method('setName')->willReturnSelf(); - $triggerMock->expects($this->exactly(3)) + $triggerMock->expects($this->any()) ->method('getName') ->willReturn('triggerName'); $triggerMock->expects($this->exactly(3)) @@ -320,7 +316,7 @@ public function testRemove() true, [] ); - $otherChangelogMock->expects($this->exactly(3)) + $otherChangelogMock->expects($this->any()) ->method('getName') ->willReturn('other_test_view_cl'); $otherChangelogMock->expects($this->exactly(3)) @@ -336,17 +332,17 @@ public function testRemove() true, [] ); - - $otherViewMock->expects($this->exactly(1)) + $otherViewMock->expects($this->atLeastOnce()) ->method('getId') ->willReturn('other_id'); - - $otherViewMock->expects($this->exactly(3)) + $otherViewMock->expects($this->atLeastOnce()) ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->any()) - $otherViewMock->expects($this->any()) + $this->viewMock->expects($this->atLeastOnce()) + ->method('getId') + ->willReturn('this_id'); + $otherViewMock->expects($this->atLeastOnce()) ->method('getSubscriptions') ->willReturn( [ @@ -355,10 +351,6 @@ public function testRemove() ] ); - $this->viewMock->expects($this->exactly(3)) - ->method('getId') - ->willReturn('this_id'); - $this->viewCollectionMock->expects($this->exactly(1)) ->method('getViewsByStateMode') ->with(StateInterface::MODE_ENABLED) @@ -443,7 +435,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void 'cataloginventory_stock_item' => ['name' => 'otherTableName', 'column' => 'columnName'] ] ); - $this->viewMock->expects($this->once()) + $this->viewMock->expects($this->atLeastOnce()) ->method('getChangeLog') ->willReturn($otherChangelogMock); diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index cad9bc6675c1e..03a3bf9615ced 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -10,9 +10,8 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Trigger; -use Magento\Framework\Mview\Config; -use Magento\Framework\Mview\View\StateInterface; use Magento\Framework\DB\Ddl\TriggerFactory; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\ViewInterface; /** @@ -212,13 +211,14 @@ protected function getLinkedViews() /** * Prepare columns for trigger statement. Should be protected in order to serve new approach * - * @param ChangelogInterface $changelog + * @param ViewInterface $view * @param string $event * @return array * @throws \Exception */ - protected function prepareColumns(ChangelogInterface $changelog, string $event): array + protected function prepareColumns(ViewInterface $view, string $event): array { + $changelog = $view->getChangelog(); $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; $subscriptionData = $this->mviewConfig->getView($changelog->getViewId())['subscriptions'][$this->getTableName()]; $columns = [ @@ -226,7 +226,7 @@ protected function prepareColumns(ChangelogInterface $changelog, string $event): 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) ], 'column_values' => [ - 'entity_id' => $this->getEntityColumn($prefix) + 'entity_id' => $this->getEntityColumn($prefix, $view) ] ]; @@ -251,7 +251,6 @@ protected function prepareColumns(ChangelogInterface $changelog, string $event): protected function buildStatement(string $event, ViewInterface $view): string { $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; - $column = $this->getSubscriptionColumn($view); $changelog = $view->getChangelog(); switch ($event) { @@ -286,13 +285,14 @@ protected function buildStatement(string $event, ViewInterface $view): string } break; } - $columns = $this->prepareColumns($changelog, $event); + $columns = $this->prepareColumns($view, $event); + return sprintf( $trigger, $this->getProcessor()->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - implode(", " , $columns['column_names']), - implode(", ", $columns['column_values']) + implode(', ', $columns['column_names']), + implode(', ', $columns['column_values']) ); } @@ -319,11 +319,12 @@ private function getProcessor(): AdditionalColumnProcessorInterface /** * @param string $prefix + * @param ViewInterface $view * @return string */ - public function getEntityColumn(string $prefix): string + public function getEntityColumn(string $prefix, ViewInterface $view): string { - return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); + return $prefix . $this->connection->quoteIdentifier($this->getSubscriptionColumn($view)); } /** From 332ef5de29e285d41090cb8b8c866551ac4fe96e Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 29 Dec 2020 15:31:58 +0200 Subject: [PATCH 47/73] magento/magento2#31251: [MFTF] Refactoring of Search actions on Storefront. --- ...uctWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 76a768c1b2d21..a9ff81c9c7f87 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -36,9 +36,11 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> + <argument name="productSku" value="$initialSimpleProduct.sku$"/> + </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> @@ -74,8 +76,6 @@ <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/> - <!-- <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> - <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> --> <!-- Verify customer see updated simple product in the product form page --> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/> From 815ef7617724552ef795ccaac5bdf50b75933dae Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 29 Dec 2020 23:21:25 +0200 Subject: [PATCH 48/73] refactored AdminOrdersReleaseInUnholdStatusTest --- .../Sales/Test/Mftf/Data/HoldOrderData.xml | 17 +++++++ .../Test/Mftf/Metadata/HoldOrderMeta.xml | 17 +++++++ .../AdminOrdersReleaseInUnholdStatusTest.xml | 49 ++++++++++--------- 3 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml new file mode 100644 index 0000000000000..35b72f31f59ac --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml @@ -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="HoldOrder" type="HoldOrder"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml new file mode 100644 index 0000000000000..66036419815fb --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateHoldOrder" dataType="HoldOrder" type="create" auth="adminOauth" url="V1/orders/{return}/hold" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml index d2ded1cc73d2b..e0576f94347cf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml @@ -21,53 +21,56 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="HoldOrder" stepKey="holdOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> - - <!-- Hold Order --> - <click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="pushButtonHold"/> - <waitForPageLoad stepKey="waitForHold"/> - <see userInput="You put the order on hold." stepKey="seeHoldMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createFirstOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="pushButtonHold"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForHold"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeHoldMessage"/> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> - - <!-- Select Mass Action according to dataset: Unhold --> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="actionUnold"> <argument name="action" value="Unhold"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="1 order(s) have been released from on hold status." stepKey="assertOrderReleaseSuccessMessage"/> - <!--Assert order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Pending"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Pending" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> From 3bc048d8528eff0993999c584725a59e4c21a12a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 4 Jan 2021 12:07:38 +0200 Subject: [PATCH 49/73] refactored CancelOrdersInOrderSalesReportTest --- .../templates/widget/grid/extended.phtml | 5 +- .../Pricing/Price/BundleSelectionFactory.php | 5 +- .../Product/Form/Modifier/BundlePanelTest.php | 166 ++++++++++++ .../Product/Form/Modifier/BundlePanel.php | 17 +- .../catalog/category/widget/tree.phtml | 14 +- .../Model/Import/Product/Validator/Media.php | 2 +- .../Model/Quote/Item/QuantityValidator.php | 16 +- .../Initializer/QuantityValidatorTest.php | 49 +++- .../Pricing/Price/UpdateCatalogRulePrice.php | 68 +++++ .../CatalogRuleGraphQl/etc/graphql/di.xml | 12 + app/code/Magento/CatalogUrlRewrite/etc/di.xml | 8 + app/code/Magento/CmsUrlRewrite/etc/di.xml | 7 + ...vailableToConfigureDisabledProductTest.xml | 4 +- .../Controller/Adminhtml/Address/Viewfile.php | 180 +++++++++++++ .../Model/Address/AbstractAddress.php | 7 +- .../Magento/Customer/Model/FileProcessor.php | 7 +- .../Customer/Model/Metadata/Form/File.php | 20 +- .../StorefrontCustomerOrderShipmentPage.xml | 14 + .../Test/Unit/Model/FileProcessorTest.php | 22 +- .../Unit/Model/Metadata/Form/FileTest.php | 16 +- .../Model/Export/Address.php | 109 +++++--- .../Test/Unit/Model/Export/AddressTest.php | 89 +++---- .../Magento/Indexer/Model/ProcessManager.php | 5 +- .../Test/Unit/Model/ProcessManagerTest.php | 183 +++++++++++++ .../Controller/Hostedpro/ReturnAction.php | 6 +- .../Paypal/Model/Payflow/Service/Gateway.php | 68 ++++- .../Plugin/TransparentSessionChecker.php | 16 +- .../Model/Payflow/Service/GatewayTest.php | 177 +++++++++++-- .../AdminGoToOrdersReportPageActionGroup.xml | 18 ++ ...inCanceledOrdersInOrderSalesReportTest.xml | 101 ++++++++ .../CancelOrdersInOrderSalesReportTest.xml | 7 +- .../reports_report_review_product_grid.xml | 4 +- app/code/Magento/Review/Block/View.php | 3 +- ...inFilterProductReviewByNameActionGroup.xml | 20 ++ .../Test/Mftf/Data/ProductReviewData.xml | 16 ++ .../Section/AdminCreateNewReviewSection.xml | 5 + ...viewDateForReviewsByProductsReportTest.xml | 83 ++++++ .../Review/view/frontend/templates/view.phtml | 24 +- .../Model/Condition/AbstractCondition.php | 2 +- .../Model/Condition/AbstractConditionTest.php | 6 + .../Adminhtml/Order/AddressSave.php | 50 +++- .../Magento/Sales/Model/AdminOrder/Create.php | 43 ++- .../Model/Order/Creditmemo/Total/Tax.php | 244 ++++++++++++++---- .../Model/ResourceModel/Order/Invoice.php | 35 ++- ...ontOrderShipmentsQtyShippedActionGroup.xml | 24 ++ .../Sales/Test/Mftf/Data/CancelOrderData.xml | 17 ++ .../Test/Mftf/Metadata/CancelOrderMeta.xml | 17 ++ .../StorefrontSalesOrderShipmentSection.xml | 14 + ...ifyOrderShipmentForDecimalQuantityTest.xml | 104 ++++++++ .../Model/Order/Creditmemo/Total/TaxTest.php | 78 ++++-- .../ViewModel/Header/LogoPathResolver.php | 69 +++++ .../frontend/layout/sales_order_print.xml | 5 + .../layout/sales_order_printcreditmemo.xml | 5 + .../layout/sales_order_printinvoice.xml | 5 + .../layout/sales_order_printshipment.xml | 5 + .../shipment/items/renderer/default.phtml | 2 +- .../Magento/Theme/Block/Html/Header/Logo.php | 16 +- .../Test/Unit/Block/Html/Header/LogoTest.php | 7 +- .../Block/Html/Header/LogoPathResolver.php | 51 ++++ .../Html/Header/LogoPathResolverInterface.php | 21 ++ .../Theme/view/frontend/layout/default.xml | 6 +- .../Magento/UrlRewrite/Model/UrlRewrite.php | 168 +++++++++++- .../GraphQl/CatalogGraphQl/PriceRangeTest.php | 175 +++++++++++++ .../GraphQl/UrlRewrite/UrlResolverTest.php | 179 ++++++++++++- .../Quote/Api/GuestCartItemRepositoryTest.php | 2 +- .../Block/Widget/Grid/ExtendedTest.php | 56 +++- .../Bundle/Pricing/Price/FinalPriceTest.php | 72 ++++++ ...dle_product_with_tier_price_selections.php | 81 ++++++ ...ct_with_tier_price_selections_rollback.php | 33 +++ ...t_with_tier_prices_for_logged_in_group.php | 48 ++++ ...er_prices_for_logged_in_group_rollback.php | 10 + ...th_tier_prices_for_not_logged_in_group.php | 48 ++++ ...rices_for_not_logged_in_group_rollback.php | 10 + .../three_simple_products_with_tier_price.php | 68 +++++ ...mple_products_with_tier_price_rollback.php | 31 +++ .../Model/Export/ProductTest.php | 58 +++++ .../Model/Import/ProductTest.php | 82 ++++++ .../Model/Import/_files/import_media.csv | 2 +- ...port_media_additional_images_storeview.csv | 2 +- ...media_additional_images_with_wrong_url.csv | 2 + .../_files/import_media_existing_images.csv | 2 +- .../_files/import_media_hidden_images.csv | 4 +- ...import_with_json_and_markup_attributes.csv | 3 + ...ucts_to_import_with_non_existing_image.csv | 2 +- .../catalog_rule_25_customer_group_all.php | 39 +++ ...og_rule_25_customer_group_all_rollback.php | 35 +++ ...alog_rule_50_registered_customer_group.php | 39 +++ ..._50_registered_customer_group_rollback.php | 35 +++ .../Interception/PluginListGeneratorTest.php | 61 +++-- .../Controller/Hostedpro/ReturnActionTest.php | 54 ++++ .../Magento/Review/Block/ViewTest.php | 143 ++++++++++ .../_files/product_review_with_rating.php | 86 ++++++ .../product_review_with_rating_rollback.php | 11 + .../Sales/Block/Order/PrintOrder/LogoTest.php | 74 ++++++ .../DependenciesShowFrameworkCommandTest.php | 4 +- .../expected/framework-dependencies.csv | 2 +- lib/internal/Magento/Framework/File/Csv.php | 7 +- .../Framework/Filesystem/Driver/File.php | 7 +- .../Filesystem/Driver/StatefulFile.php | 2 +- .../Framework/Filesystem/DriverInterface.php | 2 +- .../Framework/Filesystem/File/Read.php | 2 +- .../Filesystem/File/ReadInterface.php | 2 +- .../Interception/PluginListGenerator.php | 4 +- pub/media/customer_address/.htaccess | 7 + 104 files changed, 3810 insertions(+), 343 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php create mode 100644 app/code/Magento/CatalogRuleGraphQl/Plugin/Pricing/Price/UpdateCatalogRulePrice.php create mode 100644 app/code/Magento/CatalogRuleGraphQl/etc/graphql/di.xml create mode 100644 app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php create mode 100644 app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerOrderShipmentPage.xml create mode 100644 app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php create mode 100644 app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml create mode 100644 app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml create mode 100644 app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterProductReviewByNameActionGroup.xml create mode 100644 app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertStorefrontOrderShipmentsQtyShippedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/StorefrontSalesOrderShipmentSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderShipmentForDecimalQuantityTest.xml create mode 100644 app/code/Magento/Sales/ViewModel/Header/LogoPathResolver.php create mode 100644 app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolver.php create mode 100644 app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolverInterface.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceRangeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_with_wrong_url.csv create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_json_and_markup_attributes.csv create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Paypal/Controller/Hostedpro/ReturnActionTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Review/Block/ViewTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating.php create mode 100644 dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/LogoTest.php create mode 100644 pub/media/customer_address/.htaccess diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml index d4aa14250837f..4bdee469e2fa4 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml @@ -14,12 +14,13 @@ * getPagerVisibility() * getVarNamePage() */ -$numColumns = count($block->getColumns()); /** * @var \Magento\Backend\Block\Widget\Grid\Extended $block * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +$numColumns = count($block->getColumns()); + ?> <?php if ($block->getCollection()): ?> <?php if ($block->canDisplayContainer()): ?> @@ -285,7 +286,9 @@ $numColumns = count($block->getColumns()); </table> </div> + <?php if ($block->canDisplayContainer()): ?> </div> + <?php endif; ?> <?php /** @var \Magento\Framework\Json\Helper\Data $jsonHelper */ $jsonHelper = $block->getData('jsonHelper'); diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php index a28d721cc9a4e..52a024dc9fac3 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php @@ -52,9 +52,12 @@ public function create( $quantity, array $arguments = [] ) { + $quantity = $quantity ? (float)$quantity : 1.; + $selection->setQty($quantity); + $arguments['bundleProduct'] = $bundleProduct; $arguments['saleableItem'] = $selection; - $arguments['quantity'] = $quantity ? (float)$quantity : 1.; + $arguments['quantity'] = $quantity; return $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments); } diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php new file mode 100644 index 0000000000000..51563d319dfc8 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php @@ -0,0 +1,166 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Ui\DataProvider\Product\Form\Modifier; + +use Magento\Bundle\Model\Product\Attribute\Source\Shipment\Type as ShipmentType; +use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel; +use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Locator\LocatorInterface; +use Magento\Framework\Stdlib\ArrayManager; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for bundle panel + */ +class BundlePanelTest extends TestCase +{ + /** + * @var UrlInterface|MockObject + */ + private $urlBuilder; + + /** + * @var ShipmentType|MockObject + */ + private $shipmentType; + + /** + * @var LocatorInterface|MockObject + */ + private $locatorMock; + + /** + * @var ProductInterface|MockObject + */ + private $productMock; + + /** + * @var ArrayManager|MockObject + */ + private $arrayManagerMock; + + /** + * @var BundlePanel + */ + private $bundlePanelModel; + + /** + * @return void + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + $this->arrayManagerMock = $this->getMockBuilder(ArrayManager::class) + ->disableOriginalConstructor() + ->getMock(); + $this->arrayManagerMock->expects($this->any()) + ->method('get') + ->willReturn([]); + $this->urlBuilder = $this->getMockBuilder(UrlInterface::class) + ->getMockForAbstractClass(); + $this->shipmentType = $this->getMockBuilder(ShipmentType::class) + ->getMockForAbstractClass(); + $this->productMock = $this->getMockBuilder(ProductInterface::class) + ->addMethods(['getStoreId']) + ->getMockForAbstractClass(); + $this->productMock->method('getId') + ->willReturn(true); + $this->productMock->method('getStoreId') + ->willReturn(0); + $this->locatorMock = $this->getMockBuilder(LocatorInterface::class) + ->onlyMethods(['getProduct']) + ->getMockForAbstractClass(); + $this->locatorMock->method('getProduct') + ->willReturn($this->productMock); + + $this->bundlePanelModel = $this->objectManager->getObject( + BundlePanel::class, + [ + 'locator' => $this->locatorMock, + 'urlBuilder' => $this->urlBuilder, + 'shipmentType' => $this->shipmentType, + 'arrayManager' => $this->arrayManagerMock, + ] + ); + } + + /** + * Test for modify meta + * + * @param string $shipmentTypePath + * @param string $dataScope + * + * @return void + * @dataProvider getDataModifyMeta + */ + public function testModifyMeta(string $shipmentTypePath, string $dataScope): void + { + $sourceMeta = [ + 'bundle-items' => [ + 'children' => [ + BundlePrice::CODE_PRICE_TYPE => [] + ] + ] + ]; + $this->arrayManagerMock->method('findPath') + ->willReturnMap( + [ + [ + BundlePanel::CODE_SHIPMENT_TYPE, + [], + null, + 'children', + ArrayManager::DEFAULT_PATH_DELIMITER, + $shipmentTypePath + ], + ] + ); + $this->arrayManagerMock->method('merge') + ->willReturn([]); + $this->arrayManagerMock->method('remove') + ->willReturn([]); + $this->arrayManagerMock->method('set') + ->willReturn([]); + $this->arrayManagerMock->expects($this->at(12)) + ->method('merge') + ->with( + $shipmentTypePath . BundlePanel::META_CONFIG_PATH, + [], + [ + 'dataScope' => $dataScope, + 'validation' => [ + 'required-entry' => false + ] + ] + ); + $this->bundlePanelModel->modifyMeta($sourceMeta); + } + + /** + * Data provider for modify meta test + * + * @return string[][] + */ + public function getDataModifyMeta(): array + { + return [ + [ + 'bundle-items/children', + 'data.product.shipment_type' + ], + [ + 'someAttrGroup/children', + 'shipment_type' + ], + ]; + } +} diff --git a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php index 5ff9e674acad9..01b113def9243 100644 --- a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php +++ b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php @@ -252,16 +252,19 @@ public function modifyData(array $data) */ private function modifyShipmentType(array $meta) { + $actualPath = $this->arrayManager->findPath( + static::CODE_SHIPMENT_TYPE, + $meta, + null, + 'children' + ); + $meta = $this->arrayManager->merge( - $this->arrayManager->findPath( - static::CODE_SHIPMENT_TYPE, - $meta, - null, - 'children' - ) . static::META_CONFIG_PATH, + $actualPath . static::META_CONFIG_PATH, $meta, [ - 'dataScope' => 'data.product.shipment_type', + 'dataScope' => stripos($actualPath, self::CODE_BUNDLE_DATA) === 0 + ? 'data.product.shipment_type' : 'shipment_type', 'validation' => [ 'required-entry' => false ] diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml index 6c92ddcf36243..cf64c57c720b7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml @@ -77,6 +77,16 @@ $scriptString .= <<<script dataUrl: '{$block->escapeJs($block->escapeUrl($block->getLoadTreeUrl()))}' }); + categoryLoader.processResponse = function (response, parent, callback) { + var config = JSON.parse(response.responseText); + + this.buildCategoryTree(parent, config); + + if (typeof callback == "function") { + callback(this, parent); + } + }; + categoryLoader.buildCategoryTree = function(parent, config) { if (!config) return null; @@ -164,8 +174,10 @@ $scriptString .= <<<script }; categoryLoader.on("beforeload", function(treeLoader, node) { - $('{$block->escapeJs($_divId)}').fire('category:beforeLoad', {treeLoader:treeLoader}); treeLoader.baseParams.id = node.attributes.id; + treeLoader.baseParams.store = node.attributes.store; + treeLoader.baseParams.form_key = FORM_KEY; + $('{$block->escapeJs($_divId)}').fire('category:beforeLoad', {treeLoader:treeLoader}); }); tree{$block->escapeJs($block->getId())} = new Ext.tree.TreePanel.Enhanced('{$block->escapeJs($_divId)}', { diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Media.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Media.php index d1fe1eee80e19..8df5afce568f1 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Media.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Media.php @@ -114,8 +114,8 @@ public function isValid($value) ] ); $valid = false; + break; } - break; } } return $valid; diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php index 317a573a653e9..12a48caf62414 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php @@ -157,11 +157,17 @@ public function validate(Observer $observer) if ($stockStatus->getStockStatus() === Stock::STOCK_OUT_OF_STOCK || $parentStockStatus && $parentStockStatus->getStockStatus() == Stock::STOCK_OUT_OF_STOCK ) { - $quoteItem->addErrorInfo( - 'cataloginventory', - Data::ERROR_QTY, - __('This product is out of stock.') - ); + $hasError = $quoteItem->getStockStateResult() + ? $quoteItem->getStockStateResult()->getHasError() : false; + if (!$hasError) { + $quoteItem->addErrorInfo( + 'cataloginventory', + Data::ERROR_QTY, + __('This product is out of stock.') + ); + } else { + $quoteItem->addErrorInfo(null, Data::ERROR_QTY); + } $quoteItem->getQuote()->addErrorInfo( 'stock', 'cataloginventory', diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php index edc22a008c554..36b9fd0adeb81 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php @@ -153,7 +153,7 @@ protected function setUp(): void ->getMock(); $this->storeMock = $this->createMock(Store::class); $this->quoteItemMock = $this->getMockBuilder(Item::class) - ->addMethods(['getProductId', 'getHasError']) + ->addMethods(['getProductId', 'getHasError', 'getStockStateResult']) ->onlyMethods( [ 'getQuote', @@ -460,6 +460,53 @@ public function testException() $this->quantityValidator->validate($this->observerMock); } + /** + * This tests the scenario when the error is in the quote item already + * + * @return void + */ + public function testValidateOutStockWithAlreadyErrorInQuoteItem(): void + { + $this->createInitialStub(1); + $resultMock = $this->getMockBuilder(DataObject::class) + ->addMethods(['checkQtyIncrements', 'getMessage', 'getQuoteMessage', 'getHasError']) + ->getMock(); + $resultMock->method('getHasError') + ->willReturn(true); + $this->stockRegistryMock->method('getStockItem') + ->willReturn($this->stockItemMock); + $this->stockRegistryMock->expects($this->at(1)) + ->method('getStockStatus') + ->willReturn($this->stockStatusMock); + $this->quoteItemMock->method('getParentItem') + ->willReturn($this->parentItemMock); + $this->quoteItemMock->method('getStockStateResult') + ->willReturn($resultMock); + $this->stockRegistryMock->expects($this->at(2)) + ->method('getStockStatus') + ->willReturn($this->parentStockItemMock); + $this->parentStockItemMock->method('getStockStatus') + ->willReturn(0); + $this->stockStatusMock->expects($this->atLeastOnce()) + ->method('getStockStatus') + ->willReturn(1); + $this->quoteItemMock->expects($this->once()) + ->method('addErrorInfo') + ->with( + null, + Data::ERROR_QTY, + ); + $this->quoteMock->expects($this->once()) + ->method('addErrorInfo') + ->with( + 'stock', + 'cataloginventory', + Data::ERROR_QTY, + __('Some of the products are out of stock.') + ); + $this->quantityValidator->validate($this->observerMock); + } + /** * @param $qty * @param $hasError diff --git a/app/code/Magento/CatalogRuleGraphQl/Plugin/Pricing/Price/UpdateCatalogRulePrice.php b/app/code/Magento/CatalogRuleGraphQl/Plugin/Pricing/Price/UpdateCatalogRulePrice.php new file mode 100644 index 0000000000000..61b9f70c49f04 --- /dev/null +++ b/app/code/Magento/CatalogRuleGraphQl/Plugin/Pricing/Price/UpdateCatalogRulePrice.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogRuleGraphQl\Plugin\Pricing\Price; + +use Magento\CatalogRule\Model\ResourceModel\Rule; +use Magento\CatalogRule\Pricing\Price\CatalogRulePrice; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; + +/** + * Class UpdateCatalogRulePrice + * + * Plugin to update catalog rule price based on customer group id + */ +class UpdateCatalogRulePrice +{ + /** + * @var TimezoneInterface + */ + private $dateTime; + + /** + * @var Rule + */ + private $ruleResource; + + /** + * @param TimezoneInterface $dateTime + * @param Rule $ruleResource + */ + public function __construct( + TimezoneInterface $dateTime, + Rule $ruleResource + ) { + $this->dateTime = $dateTime; + $this->ruleResource = $ruleResource; + } + + /** + * Returns catalog rule value for logged in customer group + * + * @param CatalogRulePrice $catalogRulePrice + * @param float|boolean $value + * @return float|boolean + */ + public function afterGetValue( + CatalogRulePrice $catalogRulePrice, + $value + ) { + $product = $catalogRulePrice->getProduct(); + if ($product && $product->getCustomerGroupId()) { + $store = $product->getStore(); + $value = $this->ruleResource->getRulePrice( + $this->dateTime->scopeDate($store->getId()), + $store->getWebsiteId(), + $product->getCustomerGroupId(), + $product->getId() + ); + $value = $value ? (float) $value : false; + } + + return $value; + } +} diff --git a/app/code/Magento/CatalogRuleGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogRuleGraphQl/etc/graphql/di.xml new file mode 100644 index 0000000000000..571783edece6c --- /dev/null +++ b/app/code/Magento/CatalogRuleGraphQl/etc/graphql/di.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\CatalogRule\Pricing\Price\CatalogRulePrice"> + <plugin name="update_catalog_rule_price_for_logged_in_customer_group" type="Magento\CatalogRuleGraphQl\Plugin\Pricing\Price\UpdateCatalogRulePrice"/> + </type> +</config> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index d22816243f64c..533693692cd5c 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -59,6 +59,14 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewrite\Model\UrlRewrite"> + <arguments> + <argument name="entityToCacheTagMap" xsi:type="array"> + <item name="product" xsi:type="const">Magento\Catalog\Model\Product::CACHE_TAG</item> + <item name="category" xsi:type="const">Magento\Catalog\Model\Category::CACHE_TAG</item> + </argument> + </arguments> + </type> <type name="Magento\Eav\Model\Config"> <arguments> <argument name="attributesForPreload" xsi:type="array"> diff --git a/app/code/Magento/CmsUrlRewrite/etc/di.xml b/app/code/Magento/CmsUrlRewrite/etc/di.xml index 497d7a175842d..0463bf5b696c5 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/di.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/di.xml @@ -9,4 +9,11 @@ <type name="Magento\Cms\Model\ResourceModel\Page"> <plugin name="cms_url_rewrite_plugin" type="Magento\CmsUrlRewrite\Plugin\Cms\Model\ResourceModel\Page"/> </type> + <type name="Magento\UrlRewrite\Model\UrlRewrite"> + <arguments> + <argument name="entityToCacheTagMap" xsi:type="array"> + <item name="cms-page" xsi:type="const">Magento\Cms\Model\Page::CACHE_TAG</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index e0dae94f13150..b75dd590dbbf1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -125,7 +125,7 @@ <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus"> <argument name="stockStatus" value="Out of Stock"/> </actionGroup> - + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProductForm"/> <!-- Go to created customer page --> <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> @@ -158,7 +158,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickToAddProductToOrder"/> <waitForPageLoad stepKey="waitForNewOrderPageLoad"/> - <see userInput="This product is out of stock." stepKey="seeTheErrorMessageDisplayed"/> + <see userInput="There are no source items with the in stock status" stepKey="seeTheErrorMessageDisplayed"/> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrderThirdTime"> <argument name="customer" value="$createCustomer$"/> diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php new file mode 100644 index 0000000000000..a8cad14c23a72 --- /dev/null +++ b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php @@ -0,0 +1,180 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Controller\Adminhtml\Address; + +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Framework\Exception\NotFoundException; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Controller\Result\RawFactory; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\Controller\ResultInterface; +use Magento\Framework\Filesystem; +use Magento\Framework\Controller\Result\Raw; +use Magento\MediaStorage\Helper\File\Storage; +use Magento\Framework\App\Response\Http\FileFactory; +use Magento\Framework\Filesystem\Io\File as IoFile; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Backend\App\Action; + +/** + * Class Viewfile serves to show file or image by file/image name provided in request parameters. + */ +class Viewfile extends Action implements HttpGetActionInterface +{ + /** + * Authorization level of a basic admin session + */ + const ADMIN_RESOURCE = 'Magento_Customer::manage'; + + /** + * @var RawFactory + */ + private $resultRawFactory; + + /** + * @var DecoderInterface + */ + private $urlDecoder; + + /** + * @var Filesystem + */ + private $filesystem; + + /** + * @var Storage + */ + private $storage; + + /** + * @var FileFactory + */ + private $fileFactory; + + /** + * @var IoFile + */ + private $ioFile; + + /** + * @param Context $context + * @param FileFactory $fileFactory + * @param RawFactory $resultRawFactory + * @param DecoderInterface $urlDecoder + * @param Filesystem $filesystem + * @param Storage $storage + * @param IoFile $ioFile + */ + public function __construct( + Context $context, + FileFactory $fileFactory, + RawFactory $resultRawFactory, + DecoderInterface $urlDecoder, + Filesystem $filesystem, + Storage $storage, + IoFile $ioFile + ) { + parent::__construct($context); + $this->resultRawFactory = $resultRawFactory; + $this->urlDecoder = $urlDecoder; + $this->filesystem = $filesystem; + $this->storage = $storage; + $this->fileFactory = $fileFactory; + $this->ioFile = $ioFile; + } + + /** + * Customer address view file action + * + * @return ResultInterface|void + * @throws NotFoundException + */ + public function execute() + { + list($file, $plain) = $this->getFileParams(); + + $directory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA); + $fileName = AddressMetadataInterface::ENTITY_TYPE_ADDRESS . DIRECTORY_SEPARATOR . + ltrim($file, DIRECTORY_SEPARATOR); + $path = $directory->getAbsolutePath($fileName); + if (mb_strpos($path, '..') !== false + || (!$directory->isFile($fileName) && !$this->storage->processStorageFile($path)) + ) { + throw new NotFoundException(__('Page not found.')); + } + + $pathInfo = $this->ioFile->getPathInfo($path); + if ($plain) { + $extension = $pathInfo['extension']; + switch (strtolower($extension)) { + case 'gif': + $contentType = 'image/gif'; + break; + case 'jpg': + $contentType = 'image/jpeg'; + break; + case 'png': + $contentType = 'image/png'; + break; + default: + $contentType = 'application/octet-stream'; + break; + } + $stat = $directory->stat($fileName); + $contentLength = $stat['size']; + $contentModify = $stat['mtime']; + + /** @var Raw $resultRaw */ + $resultRaw = $this->resultRawFactory->create(); + $resultRaw->setHttpResponseCode(200) + ->setHeader('Pragma', 'public', true) + ->setHeader('Content-type', $contentType, true) + ->setHeader('Content-Length', $contentLength) + ->setHeader('Last-Modified', date('r', $contentModify)); + $resultRaw->setContents($directory->readFile($fileName)); + + return $resultRaw; + } else { + $name = $pathInfo['basename']; + $this->fileFactory->create( + $name, + ['type' => 'filename', 'value' => $fileName], + DirectoryList::MEDIA + ); + } + } + + /** + * Get parameters from request. + * + * @return array + * @throws NotFoundException + */ + private function getFileParams() : array + { + $file = null; + $plain = false; + if ($this->getRequest()->getParam('file')) { + // download file + $file = $this->urlDecoder->decode( + $this->getRequest()->getParam('file') + ); + } elseif ($this->getRequest()->getParam('image')) { + // show plain image + $file = $this->urlDecoder->decode( + $this->getRequest()->getParam('image') + ); + $plain = true; + } else { + throw new NotFoundException(__('Page not found.')); + } + + return [$file, $plain]; + } +} diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 8421fc92f8c4a..d1364dc0aeba6 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -331,10 +331,11 @@ protected function _implodeArrayValues($value) return ''; } - $isScalar = false; + $isScalar = true; foreach ($value as $val) { - if (is_scalar($val)) { - $isScalar = true; + if (!is_scalar($val)) { + $isScalar = false; + break; } } if ($isScalar) { diff --git a/app/code/Magento/Customer/Model/FileProcessor.php b/app/code/Magento/Customer/Model/FileProcessor.php index 02bfe78be535c..59e2d5fb2b577 100644 --- a/app/code/Magento/Customer/Model/FileProcessor.php +++ b/app/code/Magento/Customer/Model/FileProcessor.php @@ -158,9 +158,10 @@ public function getViewUrl($filePath, $type) $viewUrl = ''; if ($this->entityTypeCode == AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { - $filePath = $this->entityTypeCode . '/' . ltrim($filePath, '/'); - $viewUrl = $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]) - . $this->mediaDirectory->getRelativePath($filePath); + $viewUrl = $this->urlBuilder->getUrl( + 'customer/address/viewfile', + [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] + ); } if ($this->entityTypeCode == CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index 17cfc0325ef41..1add044c50c9e 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -100,6 +100,7 @@ public function __construct( FileProcessorFactory $fileProcessorFactory = null, IoFile $ioFile = null ) { + $value = $this->prepareFileValue($value); parent::__construct($localeDate, $logger, $attribute, $localeResolver, $value, $entityTypeCode, $isAjax); $this->urlEncoder = $urlEncoder; $this->_fileValidator = $fileValidator; @@ -302,11 +303,11 @@ public function validateValue($value) public function compactValue($value) { if ($this->getIsAjaxRequest()) { - return $this; + return ''; } // Remove outdated file (in the case of file uploader UI component) - if (empty($value) && !empty($this->_value)) { + if (!empty($this->_value) && !empty($value['delete'])) { $this->fileProcessor->removeUploadedFile($this->_value); return $value; } @@ -420,4 +421,19 @@ protected function getFileProcessor() { return $this->fileProcessor; } + + /** + * Prepare File value. + * + * @param array|string $value + * @return array|string + */ + private function prepareFileValue($value) + { + if (is_array($value) && isset($value['value'])) { + $value = $value['value']; + } + + return $value; + } } diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerOrderShipmentPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerOrderShipmentPage.xml new file mode 100644 index 0000000000000..da41e6ada79a0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerOrderShipmentPage.xml @@ -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="StorefrontCustomerOrderShipmentPage" url="sales/order/shipment/order_id/{{var1}}" area="storefront" module="Magento_Customer" parameterized="true"> + <section name="StorefrontCustomerOrderSection"/> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index 7a0522f6476f2..fb775ce78bbbc 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -162,22 +162,22 @@ public function testGetViewUrlCustomer() public function testGetViewUrlCustomerAddress() { $filePath = 'filename.ext1'; + $encodedFilePath = 'encodedfilenameext1'; - $baseUrl = 'baseUrl'; - $relativeUrl = 'relativeUrl'; + $fileUrl = 'fileUrl'; - $this->urlBuilder->expects($this->once()) - ->method('getBaseUrl') - ->with(['_type' => UrlInterface::URL_TYPE_MEDIA]) - ->willReturn($baseUrl); + $this->urlEncoder->expects($this->once()) + ->method('encode') + ->with($filePath) + ->willReturn($encodedFilePath); - $this->mediaDirectory->expects($this->once()) - ->method('getRelativePath') - ->with(AddressMetadataInterface::ENTITY_TYPE_ADDRESS . '/' . $filePath) - ->willReturn($relativeUrl); + $this->urlBuilder->expects($this->once()) + ->method('getUrl') + ->with('customer/address/viewfile', ['image' => $encodedFilePath]) + ->willReturn($fileUrl); $model = $this->getModel(AddressMetadataInterface::ENTITY_TYPE_ADDRESS); - $this->assertEquals($baseUrl . $relativeUrl, $model->getViewUrl($filePath, 'image')); + $this->assertEquals($fileUrl, $model->getViewUrl($filePath, 'image')); } public function testRemoveUploadedFile() diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php index 3c5016df230f9..b0e9805bb3d2a 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php @@ -347,7 +347,7 @@ public function testCompactValueIsAjax() ] ); - $this->assertSame($model, $model->compactValue('aValue')); + $this->assertSame('', $model->compactValue('aValue')); } public function testCompactValueNoDelete() @@ -362,12 +362,12 @@ public function testCompactValueNoDelete() ] ); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->any()) ->method('removeUploadedFile') ->with('value') ->willReturnSelf(); - $this->assertSame([], $model->compactValue([])); + $this->assertSame('value', $model->compactValue([])); } public function testCompactValueDelete() @@ -377,11 +377,11 @@ public function testCompactValueDelete() $mediaDirMock = $this->getMockForAbstractClass( \Magento\Framework\Filesystem\Directory\WriteInterface::class ); - $mediaDirMock->expects($this->once()) + $mediaDirMock->expects($this->any()) ->method('delete') ->with(self::ENTITY_TYPE . '/' . 'value'); - $this->fileSystemMock->expects($this->once()) + $this->fileSystemMock->expects($this->any()) ->method('getDirectoryWrite') ->with(DirectoryList::MEDIA) ->will($this->returnValue($mediaDirMock)); @@ -394,7 +394,7 @@ public function testCompactValueDelete() ] ); - $this->assertSame('', $model->compactValue(['delete' => true])); + $this->assertIsArray($model->compactValue(['delete' => true])); } public function testCompactValueTmpFile() @@ -589,12 +589,12 @@ public function testCompactValueRemoveUiComponentValue() ] ); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->any()) ->method('removeUploadedFile') ->with($value) ->willReturnSelf(); - $this->assertEquals([], $model->compactValue([])); + $this->assertEquals($value, $model->compactValue([])); } public function testCompactValueNoAction() diff --git a/app/code/Magento/CustomerImportExport/Model/Export/Address.php b/app/code/Magento/CustomerImportExport/Model/Export/Address.php index 03ce884a44d20..a2d38767432d9 100644 --- a/app/code/Magento/CustomerImportExport/Model/Export/Address.php +++ b/app/code/Magento/CustomerImportExport/Model/Export/Address.php @@ -5,6 +5,17 @@ */ namespace Magento\CustomerImportExport\Model\Export; +use Magento\Customer\Model\ResourceModel\Address\Collection; +use Magento\Customer\Model\ResourceModel\Address\CollectionFactory; +use Magento\Eav\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\DB\Select; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\ImportExport\Model\Export\Entity\AbstractEav; +use Magento\ImportExport\Model\Export\Factory; +use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory; +use Magento\Store\Model\StoreManagerInterface; + /** * Customer address export * @@ -13,7 +24,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 */ -class Address extends \Magento\ImportExport\Model\Export\Entity\AbstractEav +class Address extends AbstractEav { /**#@+ * Permanent column names @@ -93,7 +104,7 @@ class Address extends \Magento\ImportExport\Model\Export\Entity\AbstractEav /** * Customer addresses collection * - * @var \Magento\Customer\Model\ResourceModel\Address\Collection + * @var Collection */ protected $_addressCollection; @@ -118,31 +129,31 @@ class Address extends \Magento\ImportExport\Model\Export\Entity\AbstractEav * * @var array */ - protected $_customers = []; + protected $_customers; /** - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory - * @param \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory $resourceColFactory - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Eav\Model\Config $eavConfig + * @param ScopeConfigInterface $scopeConfig + * @param StoreManagerInterface $storeManager + * @param Factory $collectionFactory + * @param CollectionByPagesIteratorFactory $resourceColFactory + * @param TimezoneInterface $localeDate + * @param Config $eavConfig * @param \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerColFactory - * @param \Magento\CustomerImportExport\Model\Export\CustomerFactory $eavCustomerFactory - * @param \Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressColFactory + * @param CustomerFactory $eavCustomerFactory + * @param CollectionFactory $addressColFactory * @param array $data * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\ImportExport\Model\Export\Factory $collectionFactory, - \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory $resourceColFactory, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Eav\Model\Config $eavConfig, + ScopeConfigInterface $scopeConfig, + StoreManagerInterface $storeManager, + Factory $collectionFactory, + CollectionByPagesIteratorFactory $resourceColFactory, + TimezoneInterface $localeDate, + Config $eavConfig, \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerColFactory, - \Magento\CustomerImportExport\Model\Export\CustomerFactory $eavCustomerFactory, - \Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressColFactory, + CustomerFactory $eavCustomerFactory, + CollectionFactory $addressColFactory, array $data = [] ) { parent::__construct( @@ -178,19 +189,20 @@ public function __construct( */ protected function _initCustomers() { - if (empty($this->_customers)) { + if ($this->_customers === null) { + $this->_customers = []; // add customer default addresses column name to customer attribute mapping array $this->_customerCollection->addAttributeToSelect(self::$_defaultAddressAttributeMapping); // filter customer collection $this->_customerCollection = $this->_customerEntity->filterEntityCollection($this->_customerCollection); - $customers = []; - $addCustomer = function (\Magento\Customer\Model\Customer $customer) use (&$customers) { - $customers[$customer->getId()] = $customer->getData(); - }; + $selectIds = $this->_customerCollection->getAllIdsSql(); + $this->_customerCollection->setPageSize($this->_pageSize); + $pageCount = $this->_customerCollection->getLastPageNumber(); - $this->_byPagesIterator->iterate($this->_customerCollection, $this->_pageSize, [$addCustomer]); - $this->_customers = $customers; + for ($pageNum = 1; $pageNum <= $pageCount; $pageNum++) { + $this->_customers += $this->loadCustomerData($selectIds, $pageNum); + } } return $this; @@ -211,7 +223,7 @@ protected function _getHeaderColumns() /** * Get customers collection * - * @return \Magento\Customer\Model\ResourceModel\Address\Collection + * @return Collection */ protected function _getEntityCollection() { @@ -227,7 +239,7 @@ public function export() { // skip and filter by customer address attributes $this->_prepareEntityCollection($this->_getEntityCollection()); - $this->_getEntityCollection()->setCustomerFilter(array_keys($this->_customers)); + $this->_getEntityCollection()->setCustomerFilter(array_keys($this->getCustomers())); // prepare headers $this->getWriter()->setHeaderCols($this->_getHeaderColumns()); @@ -248,7 +260,7 @@ public function exportItem($item) $row = $this->_addAttributeValuesToRow($item); /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $this->_customers[$item->getParentId()]; + $customer = $this->getCustomers()[$item->getParentId()]; // Fill row with default address attributes values foreach (self::$_defaultAddressAttributeMapping as $columnName => $attributeCode) { @@ -274,10 +286,8 @@ public function exportItem($item) */ public function setParameters(array $parameters) { - // push filters from post into export customer model + // push filters from post into export customer model $this->_customerEntity->setParameters($parameters); - $this->_initCustomers(); - return parent::setParameters($parameters); } @@ -290,4 +300,39 @@ public function getEntityTypeCode() { return $this->getAttributeCollection()->getEntityTypeCode(); } + + /** + * Get Customers Data + * + * @return array + */ + private function getCustomers(): array + { + $this->_initCustomers(); + return $this->_customers; + } + + /** + * Load Customers Data + * + * @param Select $selectIds + * @param int $pageNum + * @return array + */ + private function loadCustomerData(Select $selectIds, int $pageNum = 0): array + { + $select = $this->_customerCollection->getConnection()->select(); + $select->from( + ['customer' => $this->_customerCollection->getTable('customer_entity')], + ['entity_id', 'email', 'store_id', 'website_id', 'default_billing', 'default_shipping'] + )->where( + 'customer.entity_id IN (?)', $selectIds + ); + + if ($pageNum > 0) { + $select->limitPage($pageNum, $this->_pageSize); + } + + return $this->_customerCollection->getConnection()->fetchAssoc($select); + } } diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Export/AddressTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Export/AddressTest.php index f40d71d2efa7c..2d8c105d2b29c 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Export/AddressTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Export/AddressTest.php @@ -7,10 +7,7 @@ namespace Magento\CustomerImportExport\Test\Unit\Model\Export; -use Magento\Customer\Model\AddressFactory; -use Magento\Customer\Model\Config\Share; -use Magento\Customer\Model\GroupFactory; -use Magento\Customer\Model\ResourceModel\Customer; +use Magento\Customer\Model\ResourceModel\Customer\Collection as CustomerCollection; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\CustomerImportExport\Model\Export\Address; use Magento\CustomerImportExport\Model\Export\CustomerFactory; @@ -19,9 +16,10 @@ use Magento\Eav\Model\Entity\TypeFactory; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Data\Collection; -use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\Data\Collection\EntityFactory; use Magento\Framework\DataObject; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\DB\Select; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -30,7 +28,6 @@ use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManager; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** @@ -82,7 +79,7 @@ class AddressTest extends TestCase /** * ObjectManager helper * - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var ObjectManager */ protected $_objectManager; @@ -93,6 +90,9 @@ class AddressTest extends TestCase */ protected $_model; + /** + * @inheritdoc + */ protected function setUp(): void { $storeManager = $this->createMock(StoreManager::class); @@ -119,6 +119,9 @@ protected function setUp(): void ); } + /** + * @inheritdoc + */ protected function tearDown(): void { unset($this->_model); @@ -132,8 +135,9 @@ protected function tearDown(): void */ protected function _getModelDependencies() { - $translator = $this->createMock(\stdClass::class); + $pageSize = 1; + $translator = $this->createMock(\stdClass::class); $entityFactory = $this->createMock(EntityFactory::class); /** @var Collection|TestCase $attributeCollection */ @@ -167,34 +171,35 @@ protected function _getModelDependencies() $attributeCollection->addItem($attribute); } - $byPagesIterator = $this->getMockBuilder(\stdClass::class)->addMethods(['iterate']) - ->disableOriginalConstructor() - ->getMock(); - $byPagesIterator->expects( - $this->once() - )->method( - 'iterate' - )->willReturnCallback( - [$this, 'iterate'] - ); - - $customerCollection = $this->getMockBuilder(AbstractDb::class) - ->setMethods(['addAttributeToSelect']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); + $connection = $this->createMock(AdapterInterface::class); + $customerCollection = $this->createMock(CustomerCollection::class); + $customerCollection->method('getConnection')->willReturn($connection); + $customerCollection->expects($this->once())->method('setPageSize')->with($pageSize); + $customerCollection->method('getLastPageNumber')->willReturn(1); + $allIdsSelect = $this->createMock(Select::class); + $customerCollection->method('getAllIdsSql')->willReturn($allIdsSelect); + + $customerSelect = $this->createMock(Select::class); + $customerSelect->method('from')->willReturnSelf(); + $customerSelect->expects($this->once()) + ->method('where') + ->with('customer.entity_id IN (?)', $allIdsSelect) + ->willReturnSelf(); + $customerSelect->expects($this->once())->method('limitPage')->with(1, $pageSize); + $connection->method('select')->willReturn($customerSelect); + $connection->method('fetchAssoc')->with($customerSelect)->willReturn([1 => $this->_customerData]); $customerEntity = $this->getMockBuilder(\stdClass::class) ->addMethods(['filterEntityCollection', 'setParameters']) ->disableOriginalConstructor() ->getMock(); - $customerEntity->expects($this->any())->method('filterEntityCollection')->willReturnArgument(0); - $customerEntity->expects($this->any())->method('setParameters')->willReturnSelf(); + $customerEntity->method('filterEntityCollection')->willReturnArgument(0); + $customerEntity->method('setParameters')->willReturnSelf(); $data = [ 'translator' => $translator, 'attribute_collection' => $attributeCollection, - 'page_size' => 1, - 'collection_by_pages_iterator' => $byPagesIterator, + 'page_size' => $pageSize, 'entity_type_id' => 1, 'customer_collection' => $customerCollection, 'customer_entity' => $customerEntity, @@ -228,36 +233,6 @@ public function getWebsites($withDefault = false) return $websites; } - /** - * Iterate stub - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param AbstractDb $collection - * @param int $pageSize - * @param array $callbacks - */ - public function iterate(AbstractDb $collection, $pageSize, array $callbacks) - { - $resource = $this->createPartialMock(Customer::class, ['getIdFieldName']); - $resource->expects($this->any())->method('getIdFieldName')->willReturn('id'); - $arguments = [ - 'data' => $this->_customerData, - 'resource' => $resource, - $this->createMock(Share::class), - $this->createMock(AddressFactory::class), - $this->createMock(\Magento\Customer\Model\ResourceModel\Address\CollectionFactory::class), - $this->createMock(GroupFactory::class), - $this->createMock(\Magento\Customer\Model\AttributeFactory::class), - ]; - /** @var $customer \Magento\Customer\Model\Customer|MockObject */ - $customer = $this->_objectManager->getObject(\Magento\Customer\Model\Customer::class, $arguments); - - foreach ($callbacks as $callback) { - call_user_func($callback, $customer); - } - } - /** * Test for method exportItem() * diff --git a/app/code/Magento/Indexer/Model/ProcessManager.php b/app/code/Magento/Indexer/Model/ProcessManager.php index 2b25c8c6a3d15..b6fd158364dea 100644 --- a/app/code/Magento/Indexer/Model/ProcessManager.php +++ b/app/code/Magento/Indexer/Model/ProcessManager.php @@ -111,9 +111,12 @@ private function multiThreadsExecute($userFunctions) $this->startChildProcess($userFunction); } } - // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock,Magento2.Functions.DiscouragedFunction + // phpcs:ignore Magento2.Functions.DiscouragedFunction while (pcntl_waitpid(0, $status) != -1) { //Waiting for the completion of child processes + if ($status > 0) { + $this->failInChildProcess = true; + } } if ($this->failInChildProcess) { diff --git a/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php new file mode 100644 index 0000000000000..9e9d2a5c81aba --- /dev/null +++ b/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php @@ -0,0 +1,183 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Test\Unit\Model; + +use Magento\Framework\App\ResourceConnection; +use Magento\Indexer\Model\ProcessManager; +use PHPUnit\Framework\TestCase; + +/** + * Class covers process manager execution test logic + */ +class ProcessManagerTest extends TestCase +{ + /** + * @dataProvider functionsWithErrorProvider + * @param array $userFunctions + * @param int $threadsCount + * @return void + */ + public function testFailureInChildProcessHandleMultiThread(array $userFunctions, int $threadsCount): void + { + $connectionMock = $this->createMock(ResourceConnection::class); + $processManager = new ProcessManager( + $connectionMock, + null, + $threadsCount + ); + + try { + $processManager->execute($userFunctions); + $this->fail('Exception was not handled'); + } catch (\RuntimeException $exception) { + $this->assertEquals('Fail in child process', $exception->getMessage()); + } + } + + /** + * Closure functions data provider for multi thread execution + * + * @return array + * @SuppressWarnings(PHPMD.ExitExpression) + */ + public function functionsWithErrorProvider(): array + { + return [ + 'more_threads_than_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(1); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 4, + ], + 'less_threads_than_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(1); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 2, + ], + 'equal_threads_and_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(1); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 3, + ], + ]; + } + + /** + * @dataProvider successFunctionsProvider + * @param array $userFunctions + * @param int $threadsCount + * @return void + */ + public function testSuccessChildProcessHandleMultiThread(array $userFunctions, int $threadsCount): void + { + $connectionMock = $this->createMock(ResourceConnection::class); + $processManager = new ProcessManager( + $connectionMock, + null, + $threadsCount + ); + + try { + $processManager->execute($userFunctions); + } catch (\RuntimeException $exception) { + $this->fail('Exception was not handled'); + } + } + + /** + * Closure functions data provider for multi thread execution + * + * @return array + * @SuppressWarnings(PHPMD.ExitExpression) + */ + public function successFunctionsProvider(): array + { + return [ + 'more_threads_than_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(0); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 4, + ], + 'less_threads_than_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(0); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 2, + ], + 'equal_threads_and_functions' => [ + 'user_functions' => [ + // @codingStandardsIgnoreStart + function () { + exit(0); + }, + function () { + exit(0); + }, + function () { + exit(0); + }, + // @codingStandardsIgnoreEnd + ], + 'threads_count' => 3, + ], + ]; + } +} diff --git a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php b/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php index bb8b5f8fa0b46..dbaf432878de9 100644 --- a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php +++ b/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php @@ -26,11 +26,7 @@ class ReturnAction extends Action implements CsrfAwareActionInterface, HttpPostA */ public function execute() { - $session = $this->_objectManager->get(\Magento\Checkout\Model\Session::class); - //TODO: some actions with order - if ($session->getLastRealOrderId()) { - $this->_redirect('checkout/onepage/success'); - } + $this->_redirect('checkout/onepage/success'); } /** diff --git a/app/code/Magento/Paypal/Model/Payflow/Service/Gateway.php b/app/code/Magento/Paypal/Model/Payflow/Service/Gateway.php index 6a2229c3d55ca..374af021cbf38 100644 --- a/app/code/Magento/Paypal/Model/Payflow/Service/Gateway.php +++ b/app/code/Magento/Paypal/Model/Payflow/Service/Gateway.php @@ -85,7 +85,8 @@ public function postRequest(DataObject $request, ConfigInterface $config) ); $client->setConfig($clientConfig); $client->setMethod(\Zend_Http_Client::POST); - $client->setParameterPost($request->getData()); + $requestData = $this->prepareRequestData($request->getData()); + $client->setParameterPost($requestData); $client->setHeaders( [ 'X-VPS-VIT-CLIENT-CERTIFICATION-ID' => '33baf5893fc2123d8b191d2d011b7fdc', @@ -97,9 +98,7 @@ public function postRequest(DataObject $request, ConfigInterface $config) try { $response = $client->request(); - - $responseArray = []; - parse_str(strstr($response->getBody(), 'RESULT'), $responseArray); + $responseArray = $this->parseNVP(strstr($response->getBody(), 'RESULT')); $result->setData(array_change_key_case($responseArray, CASE_LOWER)); $result->setData('result_code', $result->getData('result')); @@ -115,7 +114,7 @@ public function postRequest(DataObject $request, ConfigInterface $config) } finally { $this->logger->debug( [ - 'request' => $request->getData(), + 'request' => $requestData, 'result' => $result->getData() ], (array)$config->getValue('getDebugReplacePrivateDataKeys'), @@ -125,4 +124,63 @@ public function postRequest(DataObject $request, ConfigInterface $config) return $result; } + + /** + * Add length tag to parameters name which contains special characters: =, & + * + * The length tag specifies the exact number of characters and spaces (number of bytes) that appear in the value + * eg ['COMPANYNAME[14]' => 'Ruff & Johnson')] + * + * @param array $data + * @return array + */ + private function prepareRequestData(array $data): array + { + $requestData = []; + foreach ($data as $k => $v) { + if (strpos($v, '&') !== false || strpos($v, '=') !== false) { + $requestData[$k . '[' . strlen($v) . ']'] = $v; + } else { + $requestData[$k] = $v; + } + } + return $requestData; + } + + /** + * Parse NVP string into array + * + * Use length tag (if present) to parse the key value. + * + * The length tag specifies the exact number of characters and spaces (number of bytes) that appear in the value + * e.g COMPANYNAME[14]=Ruff & Johnson + * e.g COMMENT1[7]=Level=5 + * + * @param string $nvp + * @return array + */ + private function parseNVP(string $nvp): array + { + $result = []; + while (strlen($nvp) > 0) { + $keyPos = strpos($nvp, '='); + if ($keyPos !== false) { + $key = substr($nvp, 0, $keyPos); + if (preg_match('/\[(\d+)]$/', $key, $keyParts)) { + $valueLength = (int) $keyParts[1]; + $key = substr($key, 0, strpos($key, '[')); + $result[$key] = substr($nvp, $keyPos + 1, $valueLength); + $valuePos = $keyPos + 1 + $valueLength; + } else { + $valuePos = strpos($nvp, '&') ? strpos($nvp, '&') : strlen($nvp); + $value = substr($nvp, $keyPos + 1, $valuePos - $keyPos - 1); + $result[$key] = $value; + } + $nvp = substr($nvp, $valuePos + 1); + } else { + $nvp = ''; + } + } + return $result; + } } diff --git a/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php b/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php index 5157ba3208fb7..d53fd183c1942 100644 --- a/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php +++ b/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php @@ -15,7 +15,13 @@ */ class TransparentSessionChecker { - private const TRANSPARENT_REDIRECT_PATH = 'paypal/transparent/redirect'; + /** + * @var string[] + */ + private $disableSessionUrls = [ + 'paypal/transparent/redirect', + 'paypal/hostedpro/return', + ]; /** * @var Http @@ -45,6 +51,12 @@ public function afterCheck(SessionStartChecker $subject, bool $result): bool return false; } - return strpos((string)$this->request->getPathInfo(), self::TRANSPARENT_REDIRECT_PATH) === false; + foreach ($this->disableSessionUrls as $url) { + if (strpos((string)$this->request->getPathInfo(), $url) !== false) { + return false; + } + } + + return true; } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php index 194b708a0352b..a2d8111ec33c6 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php @@ -17,27 +17,43 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use ReflectionMethod; +use Zend_Http_Client_Exception; +use Zend_Http_Response; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class GatewayTest extends TestCase { - /** @var Gateway|MockObject */ - protected $object; - - /** @var ZendClientFactory|MockObject */ - protected $httpClientFactoryMock; - - /** @var Random|MockObject */ - protected $mathRandomMock; - - /** @var Logger|MockObject */ - protected $loggerMock; - - /** @var ZendClient|MockObject */ - protected $zendClientMock; - + /** + * @var Gateway|MockObject + */ + private $object; + + /** + * @var ZendClientFactory|MockObject + */ + private $httpClientFactoryMock; + + /** + * @var Random|MockObject + */ + private $mathRandomMock; + + /** + * @var Logger|MockObject + */ + private $loggerMock; + + /** + * @var ZendClient|MockObject + */ + private $zendClientMock; + + /** + * @inheritdoc + */ protected function setUp(): void { $this->httpClientFactoryMock = $this->getMockBuilder(ZendClientFactory::class) @@ -66,24 +82,28 @@ protected function setUp(): void ); } - public function testPostRequestOk() + /** + * @param string $nvpResponse + * @param array $expectedResult + * @dataProvider postRequestOkDataProvider + */ + public function testPostRequestOk(string $nvpResponse, array $expectedResult): void { $configMap = [ ['getDebugReplacePrivateDataKeys', null, ['masked']], ['debug', null, true] ]; - $expectedResponse = 'RESULT=0&RESPMSG=Approved&SECURETOKEN=8ZIaw2&SECURETOKENID=2481d53'; /** @var ConfigInterface|MockObject $configInterfaceMock */ $configInterfaceMock = $this->getMockBuilder(ConfigInterface::class) ->getMockForAbstractClass(); - $zendResponseMock = $this->getMockBuilder(\Zend_Http_Response::class) + $zendResponseMock = $this->getMockBuilder(Zend_Http_Response::class) ->setMethods(['getBody']) ->disableOriginalConstructor() ->getMock(); $zendResponseMock->expects(static::once()) ->method('getBody') - ->willReturn($expectedResponse); + ->willReturn($nvpResponse); $this->zendClientMock->expects(static::once()) ->method('request') ->willReturn($zendResponseMock); @@ -98,8 +118,119 @@ public function testPostRequestOk() $result = $this->object->postRequest($object, $configInterfaceMock); - static::assertInstanceOf(DataObject::class, $result); - static::assertArrayHasKey('result_code', $result->getData()); + static::assertEquals($expectedResult, $result->toArray()); + } + + /** + * @return array[] + */ + public function postRequestOkDataProvider(): array + { + return [ + [ + 'RESULT=0&RESPMSG=Approved&SECURETOKEN=9tl4MmP46NUadl9pwCKFgfQjA' + . '&SECURETOKENID=vVWBMSNb9j0SLlYw4AbqBnKmuogtzNNC', + [ + 'result' => '0', + 'securetoken' => '9tl4MmP46NUadl9pwCKFgfQjA', + 'securetokenid' => 'vVWBMSNb9j0SLlYw4AbqBnKmuogtzNNC', + 'respmsg' => 'Approved', + 'result_code' => '0', + ] + ], + [ + 'RESULT=0&PNREF=A30A3A958244&RESPMSG=Approved&AUTHCODE=028PNI&AVSADDR=N&AVSZIP=N&HOSTCODE=A' + . '&PROCAVS=N&VISACARDLEVEL=12&TRANSTIME=2020-12-16 14:43:57&FIRSTNAME[4]=Joé' + . '&LASTNAME=O\'Reilly&COMPANYNAME[14]=Ruff & Johnson&COMMENT1[7]=Level=5' + . '&AMT=30.00&ACCT=1111&EXPDATE=1224&CARDTYPE=0&IAVS=N', + [ + 'result' => '0', + 'pnref' => 'A30A3A958244', + 'respmsg' => 'Approved', + 'authcode' => '028PNI', + 'avsaddr' => 'N', + 'avszip' => 'N', + 'hostcode' => 'A', + 'procavs' => 'N', + 'visacardlevel' => '12', + 'transtime' => '2020-12-16 14:43:57', + 'firstname' => 'Joé', + 'lastname' => 'O\'Reilly', + 'companyname' => 'Ruff & Johnson', + 'comment1' => 'Level=5', + 'amt' => '30.00', + 'acct' => '1111', + 'expdate' => '1224', + 'cardtype' => '0', + 'iavs' => 'N', + 'result_code' => '0', + ] + ], + ]; + } + + /** + * @param array $requestData + * @param string $requestBody + * @dataProvider requestBodyDataProvider + */ + public function testRequestBody(array $requestData, string $requestBody): void + { + $configMap = [ + ['getDebugReplacePrivateDataKeys', null, ['masked']], + ['debug', null, true] + ]; + + /** @var ConfigInterface|MockObject $configInterfaceMock */ + $configInterfaceMock = $this->getMockBuilder(ConfigInterface::class) + ->getMockForAbstractClass(); + $zendResponseMock = $this->getMockBuilder(Zend_Http_Response::class) + ->setMethods(['getBody']) + ->disableOriginalConstructor() + ->getMock(); + $zendResponseMock->expects(static::once()) + ->method('getBody') + ->willReturn('RESULT=0&RESPMSG=Approved'); + $this->zendClientMock->expects(static::once()) + ->method('request') + ->willReturn($zendResponseMock); + + $configInterfaceMock->expects(static::any()) + ->method('getValue') + ->willReturnMap($configMap); + $this->loggerMock->expects(static::once()) + ->method('debug'); + + $request = new DataObject($requestData); + $this->object->postRequest($request, $configInterfaceMock); + $method = new ReflectionMethod($this->zendClientMock, '_prepareBody'); + $method->setAccessible(true); + $this->assertEquals($requestBody, $method->invoke($this->zendClientMock)); + } + + /** + * @return array[] + */ + public function requestBodyDataProvider(): array + { + return [ + [ + [ + 'companyname' => 'Ruff & Johnson', + 'comment1' => 'Level=5', + 'shiptofirstname' => 'Joé', + 'shiptolastname' => 'O\'Reilly', + 'shiptostreet' => '4659 Rainbow Road', + 'shiptocity' => 'Los Angeles', + 'shiptostate' => 'CA', + 'shiptozip' => '90017', + 'shiptocountry' => 'US', + ], + 'companyname[14]=Ruff & Johnson&comment1[7]=Level=5&shiptofirstname=Joé&shiptolastname=O\'Reilly' + . '&shiptostreet=4659 Rainbow Road&shiptocity=Los Angeles&shiptostate=CA&shiptozip=90017' + . '&shiptocountry=US' + ] + ]; } public function testPostRequestFail() @@ -108,7 +239,7 @@ public function testPostRequestFail() /** @var ConfigInterface|MockObject $configInterfaceMock */ $configInterfaceMock = $this->getMockBuilder(ConfigInterface::class) ->getMockForAbstractClass(); - $zendResponseMock = $this->getMockBuilder(\Zend_Http_Response::class) + $zendResponseMock = $this->getMockBuilder(Zend_Http_Response::class) ->setMethods(['getBody']) ->disableOriginalConstructor() ->getMock(); @@ -116,7 +247,7 @@ public function testPostRequestFail() ->method('getBody'); $this->zendClientMock->expects(static::once()) ->method('request') - ->willThrowException(new \Zend_Http_Client_Exception()); + ->willThrowException(new Zend_Http_Client_Exception()); $object = new DataObject(); $this->object->postRequest($object, $configInterfaceMock); diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml new file mode 100644 index 0000000000000..b8f117a0de4bc --- /dev/null +++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml @@ -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="AdminGoToOrdersReportPageActionGroup"> + <annotations> + <description>Redirects to the Orders Report page</description> + </annotations> + + <amOnPage url="{{OrdersReportPage.url}}" stepKey="goToOrdersReportPage"/> + <waitForPageLoad stepKey="waitForOrdersReportPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml new file mode 100644 index 0000000000000..e56d2b5bcbe6e --- /dev/null +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml @@ -0,0 +1,101 @@ +<?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="AdminCanceledOrdersInOrderSalesReportTest"> + <annotations> + <features value="Reports"/> + <stories value="Order Sales Report includes canceled orders"/> + <group value="reports"/> + <title value="Canceled orders in order sales report"/> + <description value="Verify canceling of orders in order sales report"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-95960"/> + <useCaseId value="MAGETWO-95823"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <createData entity="Shipment" stepKey="shipOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="CancelOrder" stepKey="cancelOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage1"/> + <generateDate stepKey="generateEndDate" date="+0 day" format="m/d/Y"/> + <generateDate stepKey="generateStartDate" date="-1 day" format="m/d/Y"/> + <actionGroup ref="GenerateOrderReportForNotCancelActionGroup" stepKey="generateReportAfterCancelOrderBefore"> + <argument name="orderFromDate" value="$generateStartDate"/> + <argument name="orderToDate" value="$generateEndDate"/> + <argument name="statuses" value="['closed', 'complete', 'fraud', 'holded', 'payment_review', 'paypal_canceled_reversal', 'paypal_reversed', 'processing']"/> + </actionGroup> + <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCountBefore"/> + <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersSpecified"/> + + <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage2"/> + <actionGroup ref="GenerateOrderReportActionGroup" stepKey="generateReportAfterCancelOrder"> + <argument name="orderFromDate" value="$generateStartDate"/> + <argument name="orderToDate" value="$generateEndDate"/> + </actionGroup> + <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCount"/> + <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersAny"/> + + <assertEquals stepKey="assertEquals"> + <actualResult type="string">{$grabCanceledOrdersAny}</actualResult> + <expectedResult type="string">{$grabCanceledOrdersSpecified}</expectedResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 6e9e8e800e076..54d3059f24532 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -7,16 +7,19 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="CancelOrdersInOrderSalesReportTest"> + <test name="CancelOrdersInOrderSalesReportTest" deprecated="Use AdminCanceledOrdersInOrderSalesReportTest instead"> <annotations> <features value="Reports"/> <stories value="Order Sales Report includes canceled orders"/> <group value="reports"/> - <title value="Canceled orders in order sales report"/> + <title value="DEPRECATED. Canceled orders in order sales report"/> <description value="Verify canceling of orders in order sales report"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-95960"/> <useCaseId value="MAGETWO-95823"/> + <skip> + <issueId value="DEPRECATED">Use AdminCanceledOrdersInOrderSalesReportTest instead</issueId> + </skip> </annotations> <before> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml index 26d0e8b13659d..b9d4572cd4868 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml @@ -90,8 +90,8 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Last Review</argument> <argument name="type" xsi:type="string">datetime</argument> - <argument name="id" xsi:type="string">created_at</argument> - <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">last_review</argument> + <argument name="index" xsi:type="string">last_review</argument> <argument name="column_css_class" xsi:type="string">col-date</argument> <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php index fcfa11faa169d..bbdd246835f9e 100644 --- a/app/code/Magento/Review/Block/View.php +++ b/app/code/Magento/Review/Block/View.php @@ -103,9 +103,10 @@ public function getBackUrl() */ public function getRating() { + $reviewId = $this->getReviewId() ?: $this->getReviewData()->getId(); if (!$this->getRatingCollection()) { $ratingCollection = $this->_voteFactory->create()->getResourceCollection()->setReviewFilter( - $this->getReviewId() + $reviewId )->setStoreFilter( $this->_storeManager->getStore()->getId() )->addRatingInfo( diff --git a/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterProductReviewByNameActionGroup.xml b/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterProductReviewByNameActionGroup.xml new file mode 100644 index 0000000000000..b0544081980bb --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterProductReviewByNameActionGroup.xml @@ -0,0 +1,20 @@ +<?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="AdminFilterProductReviewByNameActionGroup"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <waitForPageLoad stepKey="waitForGridToAppear"/> + <fillField userInput="{{productName}}" selector="{{AdminCreateNewReviewSection.filterProductName}}" stepKey="searchReview"/> + <click selector="{{AdminCreateNewReviewSection.searchButton}}" stepKey="startSearch"/> + <waitForPageLoad stepKey="waitForResults"/> + <see userInput="{{productName}}" selector="{{AdminCreateNewReviewSection.gridProductColumn}}" stepKey="assertReviewColumn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Review/Test/Mftf/Data/ProductReviewData.xml b/app/code/Magento/Review/Test/Mftf/Data/ProductReviewData.xml index f66decd1b7bd0..ba2102d0ee1f1 100644 --- a/app/code/Magento/Review/Test/Mftf/Data/ProductReviewData.xml +++ b/app/code/Magento/Review/Test/Mftf/Data/ProductReviewData.xml @@ -16,4 +16,20 @@ <item>Default Store View</item> </array> </entity> + <entity name="firstSimpleProductReview"> + <data key="nickname" unique="suffix">user1</data> + <data key="title">Review title 1</data> + <data key="detail">Simple product review 1</data> + <array key="select_stores"> + <item>Default Store View</item> + </array> + </entity> + <entity name="secondSimpleProductReview"> + <data key="nickname" unique="suffix">user2</data> + <data key="title">Review title 2</data> + <data key="detail">Simple product review 2</data> + <array key="select_stores"> + <item>Default Store View</item> + </array> + </entity> </entities> diff --git a/app/code/Magento/Review/Test/Mftf/Section/AdminCreateNewReviewSection.xml b/app/code/Magento/Review/Test/Mftf/Section/AdminCreateNewReviewSection.xml index 3b17b20e9da1b..28eb3112f259a 100644 --- a/app/code/Magento/Review/Test/Mftf/Section/AdminCreateNewReviewSection.xml +++ b/app/code/Magento/Review/Test/Mftf/Section/AdminCreateNewReviewSection.xml @@ -18,8 +18,13 @@ <element name="submitReview" type="button" selector="#save_button"/> <element name="SuccessMessage" type="button" selector="div.message-success"/> <element name="gridProducts_filter_review_cnt" type="button" selector="#gridProducts_filter_review_cnt"/> + <element name="filterProductName" type="button" selector="#gridProducts_filter_name"/> <element name="searchButton" type="button" selector="//*[@id='gridProducts']//button[contains(@title, 'Search')]"/> <element name="gridReviewColumn" type="text" selector="//tbody//td[@data-column='review_cnt']"/> + <element name="gridLastReviewColumn" type="text" selector="//tbody//td[@data-column='created_at']"/> + <element name="gridProductColumn" type="text" selector="//tbody//td[@data-column='name']"/> + <element name="showReviewsButton" type="text" selector="//tbody//td[@data-column='action']"/> + <element name="grabLatestUserReviewDate" type="text" selector="//table[@class='data-grid']//tbody//tr[position()=1]//td[position()=3]"/> <element name="gridCustomer_filter_review_cnt" type="button" selector="#customers_grid_filter_review_cnt"/> <element name="CustomerSearchButton" type="button" selector="//*[@id='customers_grid']//button[contains(@title, 'Search')]"/> </section> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml new file mode 100644 index 0000000000000..3405314f24f78 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml @@ -0,0 +1,83 @@ +<?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="AdminValidateLastReviewDateForReviewsByProductsReportTest"> + <annotations> + <features value="Review"/> + <stories value="Reports: Review by Products"/> + <title value="Admin Validate Last Review Date For Review by Products Reports"/> + <description value="Admin Validate Last Review Date For Review by Products Reports"/> + <severity value="MAJOR"/> + <useCaseId value="MC-39737"/> + <testCaseId value="MC-39838"/> + </annotations> + <before> + <!--Step1. Login as admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <!--Step2. Create product and Category--> + <createData stepKey="category" entity="SimpleSubCategory"/> + <createData stepKey="createProduct" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <!--Step9. Delete newly created product reviews --> + <actionGroup ref="AdminOpenReviewsPageActionGroup" stepKey="openAllReviewsPage"/> + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteFirstCustomerReview"> + <argument name="nickname" value="{{firstSimpleProductReview.nickname}}"/> + </actionGroup> + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteSecondCustomerReview"> + <argument name="nickname" value="{{secondSimpleProductReview.nickname}}"/> + </actionGroup> + <!--Step10. delete Category and Products --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <!--Step11. Admin Logout--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Step3. Navigate to Marketing > User Content> All Review --> + <amOnPage url="{{AdminReviewsPage.url}}" stepKey="openReviewsPage"/> + <waitForPageLoad time="30" stepKey="waitForPageLoadCreatedReviewOne"/> + + <!--Step4. Add First and Second Review For Same Product--> + <actionGroup ref="AdminAddProductReviewActionGroup" stepKey="addFirstReview"> + <argument name="review" value="firstSimpleProductReview"/> + <argument name="sku" value="$$createProduct.sku$$"/> + </actionGroup> + <amOnPage url="{{AdminReviewsPage.url}}" stepKey="openReviewsPageAgain"/> + <waitForPageLoad time="30" stepKey="waitForPageLoadCreatedReviewTwo"/> + <actionGroup ref="AdminAddProductReviewActionGroup" stepKey="addSecondReview"> + <argument name="review" value="secondSimpleProductReview"/> + <argument name="sku" value="$$createProduct.sku$$"/> + </actionGroup> + <!--Step5. Navigate to Reports > Reviews > By Products --> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsByProductsPage"> + <argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuReportsReviewsByProducts.dataUiId}}"/> + </actionGroup> + <!--Step6. Search product review by product name --> + <actionGroup ref="AdminFilterProductReviewByNameActionGroup" stepKey="navigateToReportsReview"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> + <!--Step7. Click 'Show Reviews' to see review details--> + <grabTextFrom selector="{{AdminCreateNewReviewSection.gridLastReviewColumn}}" stepKey="grabLastReviewDate"/> + <click selector="{{AdminCreateNewReviewSection.showReviewsButton}}" stepKey="showReviewsPage"/> + <waitForPageLoad stepKey="waitForReviewListPageToLoad"/> + <!--Step8. Assert product last review date matches latest user review date--> + <fillField selector="{{AdminReviewGridSection.nickname}}" userInput="{{secondSimpleProductReview.nickname}}" stepKey="fillNickname"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForGridViewPageToLoad"/> + <grabTextFrom selector="{{AdminCreateNewReviewSection.grabLatestUserReviewDate}}" stepKey="grabLatestUserReviewDate"/> + <assertEquals stepKey="assertReviewDate"> + <actualResult type="string">$grabLastReviewDate</actualResult> + <expectedResult type="string">$grabLatestUserReviewDate</expectedResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Review/view/frontend/templates/view.phtml b/app/code/Magento/Review/view/frontend/templates/view.phtml index b51353b7df685..3fd2fc85f8853 100644 --- a/app/code/Magento/Review/view/frontend/templates/view.phtml +++ b/app/code/Magento/Review/view/frontend/templates/view.phtml @@ -33,16 +33,26 @@ <caption class="table-caption"><?= $block->escapeHtml(__('Product Rating')) ?></caption> <?php foreach ($block->getRating() as $_rating): ?> <?php if ($_rating->getPercent()): ?> + <?php $rating = ceil($_rating->getPercent()) ?> <tr> - <td class="label"><?= $block->escapeHtml(__($_rating->getRatingCode())) ?></td> + <td class="label" width="10%"> + <?= $block->escapeHtml(__($_rating->getRatingCode())) ?> + </td> <td class="value"> - <div class="rating-box"> - <div class="rating"/> + <?php $ratingId = $_rating->getRatingId() ?> + <div class="rating-summary item" + id="rating-div-<?= $block->escapeHtml($ratingId) ?>"> + <div class="rating-result" title="<?= /* @noEscape */ $rating ?>%"> + <span> + <span><?= /* @noEscape */ $rating ?>%</span> + </span> + </div> + <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( + "width:" . /* @noEscape */ $rating . "%", + 'div#rating-div-'.$_rating->getRatingId(). + '>div.rating-result>span:first-child' + ) ?> </div> - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( - "width:" . /* @noEscape */ ceil($_rating->getPercent()) . "%;", - 'div.rating-box div.rating' - ) ?> </td> </tr> <?php endif; ?> diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index 67fc3590ac501..d5d3b80755360 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -838,7 +838,7 @@ public function validateAttribute($validatedValue) } } } elseif (is_array($value)) { - if (!is_array($validatedValue)) { + if (!is_array($validatedValue) || empty($validatedValue)) { return false; } $result = array_intersect($value, $validatedValue); diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php index 3c55eacaff559..91f1c4b942f75 100644 --- a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php +++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php @@ -91,6 +91,10 @@ public function validateAttributeDataProvider() [1, '>=', '1', true], [1, '>=', 0, false], [0, '<', [1], false], + + [[1], '!{}', [], false], + [[1], '!{}', [1], false], + [[1], '!{}', [0], false], ]; } @@ -176,6 +180,8 @@ public function validateAttributeArrayInputTypeDataProvider() [[3], '{}', [], false, 'grid'], [1, '{}', 1, false, 'grid'], [1, '!{}', [1, 2, 3], false, 'grid'], + [1, '!{}', [], false, 'grid'], + [[1], '!{}', [], false, 'grid'], [[1], '{}', null, false, 'grid'], [null, '{}', null, true, 'input'], [null, '!{}', null, false, 'input'], diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php index 5633e16d7d3d0..879baa948e919 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php @@ -27,6 +27,7 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Customer\Model\AttributeMetadataDataProvider; /** * Sales address save @@ -52,6 +53,11 @@ class AddressSave extends Order implements HttpPostActionInterface */ private $orderAddressRepository; + /** + * @var AttributeMetadataDataProvider + */ + private $attributeMetadataDataProvider; + /** * @param Context $context * @param Registry $coreRegistry @@ -82,7 +88,8 @@ public function __construct( OrderRepositoryInterface $orderRepository, LoggerInterface $logger, RegionFactory $regionFactory = null, - OrderAddressRepositoryInterface $orderAddressRepository = null + OrderAddressRepositoryInterface $orderAddressRepository = null, + AttributeMetadataDataProvider $attributeMetadataDataProvider = null ) { $this->regionFactory = $regionFactory ?: ObjectManager::getInstance()->get(RegionFactory::class); $this->orderAddressRepository = $orderAddressRepository ?: ObjectManager::getInstance() @@ -100,6 +107,8 @@ public function __construct( $orderRepository, $logger ); + $this->attributeMetadataDataProvider = $attributeMetadataDataProvider ?: ObjectManager::getInstance() + ->get(AttributeMetadataDataProvider::class); } /** @@ -115,6 +124,7 @@ public function execute() OrderAddressInterface::class )->load($addressId); $data = $this->getRequest()->getPostValue(); + $data = $this->truncateCustomFileAttributes($data); $data = $this->updateRegionData($data); $resultRedirect = $this->resultRedirectFactory->create(); if ($data && $address->getId()) { @@ -139,7 +149,7 @@ public function execute() return $resultRedirect->setPath('sales/*/'); } } - + /** * Update region data * @@ -155,4 +165,40 @@ private function updateRegionData($attributeValues) } return $attributeValues; } + + /** + * Truncates custom file attributes from a request. + * + * As custom file type attributes are not working workaround is introduced. + * + * @param array $data + * @return array + */ + private function truncateCustomFileAttributes(array $data): array + { + $foundArrays = []; + + foreach ($data as $value) { + if (is_array($value)) { + $foundArrays = $value; + } + } + + if (empty($foundArrays)) { + return $data; + } + + $attributesList = $this->attributeMetadataDataProvider->loadAttributesCollection( + 'customer_address', + 'adminhtml_customer_address' + ); + $attributesList->addFieldToFilter('is_user_defined', 1); + $attributesList->addFieldToFilter('frontend_input', 'file'); + + foreach ($attributesList as $customFileAttribute) { + unset($data[$customFileAttribute->getAttributeCode()]); + } + + return $data; + } } diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 5d621f1632837..6bd6e8e4e83e1 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -7,10 +7,12 @@ namespace Magento\Sales\Model\AdminOrder; use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\Data\AttributeMetadataInterface; use Magento\Customer\Model\Metadata\Form as CustomerForm; use Magento\Framework\Api\ExtensibleDataObjectConverter; use Magento\Framework\App\ObjectManager; use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\Quote\Address\CustomAttributeListInterface; use Magento\Quote\Model\Quote\Item; use Magento\Sales\Api\Data\OrderAddressInterface; use Magento\Sales\Model\Order; @@ -250,6 +252,11 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ */ private $storeManager; + /** + * @var CustomAttributeListInterface + */ + private $customAttributeList; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param \Magento\Framework\Event\ManagerInterface $eventManager @@ -282,6 +289,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer * @param ExtensibleDataObjectConverter|null $dataObjectConverter * @param StoreManagerInterface $storeManager + * @param CustomAttributeListInterface|null $customAttributeList * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -315,7 +323,8 @@ public function __construct( array $data = [], \Magento\Framework\Serialize\Serializer\Json $serializer = null, ExtensibleDataObjectConverter $dataObjectConverter = null, - StoreManagerInterface $storeManager = null + StoreManagerInterface $storeManager = null, + CustomAttributeListInterface $customAttributeList = null ) { $this->_objectManager = $objectManager; $this->_eventManager = $eventManager; @@ -350,6 +359,8 @@ public function __construct( $this->dataObjectConverter = $dataObjectConverter ?: ObjectManager::getInstance() ->get(ExtensibleDataObjectConverter::class); $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class); + $this->customAttributeList = $customAttributeList ?: ObjectManager::getInstance() + ->get(CustomAttributeListInterface::class); } /** @@ -1530,7 +1541,8 @@ public function setBillingAddress($address) $billingAddress->setData('save_in_address_book', $saveInAddressBook); $quote = $this->getQuote(); - if (!$quote->isVirtual() && $this->getShippingAddress()->getSameAsBilling()) { + $shippingAddress = $this->getShippingAddress(); + if (!$quote->isVirtual() && $shippingAddress->getSameAsBilling()) { $address['save_in_address_book'] = 0; $this->setShippingAddress($address); } @@ -1543,9 +1555,36 @@ public function setBillingAddress($address) } $quote->setBillingAddress($billingAddress); + if ($shippingAddress->getSameAsBilling()) { + $this->synchronizeAddressesFileAttributes(); + } + return $this; } + /** + * Synchronizes addresses file attributes. + * + * @return void + */ + private function synchronizeAddressesFileAttributes(): void + { + $billingAddress = $this->getBillingAddress(); + $shippingAddress = $this->getShippingAddress(); + + /** @var AttributeMetadataInterface[] $customAttributes */ + $customAttributes = $this->customAttributeList->getAttributes(); + foreach ($customAttributes as $attribute) { + $attributeCode = $attribute->getAttributeCode(); + if ($attribute->getFrontendInput() === 'file' + && !empty($billingAddress->getData($attributeCode)) + && empty($shippingAddress->getData($attributeCode)) + ) { + $shippingAddress->setData($attributeCode, $billingAddress->getData($attributeCode)); + } + } + } + /** * Set shipping method * diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php index 95dace13d832f..faed11c4f718e 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -5,22 +5,38 @@ */ namespace Magento\Sales\Model\Order\Creditmemo\Total; +use Magento\Sales\Api\Data\CreditmemoInterface; +use Magento\Sales\Model\Order\Creditmemo; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\ResourceModel\Order\Invoice as ResourceInvoice; + /** * Collects credit memo taxes. */ class Tax extends AbstractTotal { /** - * Collects credit memo taxes. - * - * @param \Magento\Sales\Model\Order\Creditmemo $creditmemo - * @return $this - * + * @var ResourceInvoice + */ + private $resourceInvoice; + + /** + * @param ResourceInvoice $resourceInvoice + * @param array $data + */ + public function __construct(ResourceInvoice $resourceInvoice, array $data = []) + { + $this->resourceInvoice = $resourceInvoice; + parent::__construct($data); + } + + /** + * {@inheritdoc} * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) + public function collect(Creditmemo $creditmemo) { $shippingTaxAmount = 0; $baseShippingTaxAmount = 0; @@ -28,38 +44,37 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $baseTotalTax = 0; $totalDiscountTaxCompensation = 0; $baseTotalDiscountTaxCompensation = 0; - $order = $creditmemo->getOrder(); - /** @var $item \Magento\Sales\Model\Order\Creditmemo\Item */ foreach ($creditmemo->getAllItems() as $item) { $orderItem = $item->getOrderItem(); if ($orderItem->isDummy() || $item->getQty() <= 0) { continue; } + $orderItemTax = (double)$orderItem->getTaxInvoiced(); $baseOrderItemTax = (double)$orderItem->getBaseTaxInvoiced(); $orderItemQty = (double)$orderItem->getQtyInvoiced(); if ($orderItemQty) { - /** - * Check item tax amount - */ - + /** Check item tax amount */ $tax = $orderItemTax - $orderItem->getTaxRefunded(); $baseTax = $baseOrderItemTax - $orderItem->getBaseTaxRefunded(); - $discountTaxCompensation = $orderItem->getDiscountTaxCompensationInvoiced() - - $orderItem->getDiscountTaxCompensationRefunded(); - $baseDiscountTaxCompensation = $orderItem->getBaseDiscountTaxCompensationInvoiced() - - $orderItem->getBaseDiscountTaxCompensationRefunded(); + $discountTaxCompensation = $orderItem->getDiscountTaxCompensationInvoiced() + - $orderItem->getDiscountTaxCompensationRefunded(); + $baseDiscountTaxCompensation = $orderItem->getBaseDiscountTaxCompensationInvoiced() + - $orderItem->getBaseDiscountTaxCompensationRefunded(); if (!$item->isLast()) { $availableQty = $orderItemQty - $orderItem->getQtyRefunded(); $tax = $creditmemo->roundPrice($tax / $availableQty * $item->getQty()); - $baseTax = $creditmemo->roundPrice($baseTax / $availableQty * $item->getQty(), 'base'); - $discountTaxCompensation = - $creditmemo->roundPrice($discountTaxCompensation / $availableQty * $item->getQty()); - $baseDiscountTaxCompensation = - $creditmemo->roundPrice($baseDiscountTaxCompensation / $availableQty * $item->getQty(), 'base'); + $baseTax = $creditmemo->roundPrice(($baseTax / $availableQty * $item->getQty()), 'base'); + $discountTaxCompensation = $creditmemo->roundPrice( + $discountTaxCompensation / $availableQty * $item->getQty() + ); + $baseDiscountTaxCompensation = $creditmemo->roundPrice( + $baseDiscountTaxCompensation / $availableQty * $item->getQty(), + 'base' + ); } $item->setTaxAmount($tax); @@ -77,14 +92,14 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $isPartialShippingRefunded = false; $baseOrderShippingAmount = (float)$order->getBaseShippingAmount(); if ($invoice = $creditmemo->getInvoice()) { - //recalculate tax amounts in case if refund shipping value was changed + // recalculate tax amounts in case if refund shipping value was changed if ($baseOrderShippingAmount && $creditmemo->getBaseShippingAmount() !== null) { $taxFactor = $creditmemo->getBaseShippingAmount() / $baseOrderShippingAmount; $shippingTaxAmount = $invoice->getShippingTaxAmount() * $taxFactor; $baseShippingTaxAmount = $invoice->getBaseShippingTaxAmount() * $taxFactor; $totalDiscountTaxCompensation += $invoice->getShippingDiscountTaxCompensationAmount() * $taxFactor; - $baseTotalDiscountTaxCompensation += - $invoice->getBaseShippingDiscountTaxCompensationAmnt() * $taxFactor; + $baseTotalDiscountTaxCompensation += $invoice->getBaseShippingDiscountTaxCompensationAmnt() + * $taxFactor; $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); $totalDiscountTaxCompensation = $creditmemo->roundPrice($totalDiscountTaxCompensation); @@ -97,14 +112,11 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) } } else { $orderShippingAmount = $order->getShippingAmount(); - $baseOrderShippingRefundedAmount = $order->getBaseShippingRefunded(); - $shippingTaxAmount = 0; $baseShippingTaxAmount = 0; $shippingDiscountTaxCompensationAmount = 0; $baseShippingDiscountTaxCompensationAmount = 0; - $shippingDelta = $baseOrderShippingAmount - $baseOrderShippingRefundedAmount; if ($shippingDelta > $creditmemo->getBaseShippingAmount()) { @@ -113,45 +125,39 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $shippingTaxAmount = $order->getShippingTaxAmount() * $part; $baseShippingTaxAmount = $order->getBaseShippingTaxAmount() * $basePart; $shippingDiscountTaxCompensationAmount = $order->getShippingDiscountTaxCompensationAmount() * $part; - $baseShippingDiscountTaxCompensationAmount = - $order->getBaseShippingDiscountTaxCompensationAmnt() * $basePart; + $baseShippingDiscountTaxCompensationAmount = $order->getBaseShippingDiscountTaxCompensationAmnt() + * $basePart; $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); - $shippingDiscountTaxCompensationAmount = - $creditmemo->roundPrice($shippingDiscountTaxCompensationAmount); - $baseShippingDiscountTaxCompensationAmount = - $creditmemo->roundPrice($baseShippingDiscountTaxCompensationAmount, 'base'); + $shippingDiscountTaxCompensationAmount = $creditmemo->roundPrice( + $shippingDiscountTaxCompensationAmount + ); + $baseShippingDiscountTaxCompensationAmount = $creditmemo->roundPrice( + $baseShippingDiscountTaxCompensationAmount, + 'base' + ); if ($part < 1 && $order->getShippingTaxAmount() > 0) { $isPartialShippingRefunded = true; } } elseif ($shippingDelta == $creditmemo->getBaseShippingAmount()) { $shippingTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded(); $baseShippingTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded(); - $shippingDiscountTaxCompensationAmount = $order->getShippingDiscountTaxCompensationAmount() - - $order->getShippingDiscountTaxCompensationRefunded(); - $baseShippingDiscountTaxCompensationAmount = $order->getBaseShippingDiscountTaxCompensationAmnt() - - $order->getBaseShippingDiscountTaxCompensationRefunded(); + $shippingDiscountTaxCompensationAmount = $order->getShippingDiscountTaxCompensationAmount() + - $order->getShippingDiscountTaxCompensationRefunded(); + $baseShippingDiscountTaxCompensationAmount = $order->getBaseShippingDiscountTaxCompensationAmnt() + - $order->getBaseShippingDiscountTaxCompensationRefunded(); } + $totalTax += $shippingTaxAmount; $baseTotalTax += $baseShippingTaxAmount; $totalDiscountTaxCompensation += $shippingDiscountTaxCompensationAmount; $baseTotalDiscountTaxCompensation += $baseShippingDiscountTaxCompensationAmount; } - $allowedTax = $order->getTaxInvoiced() - $order->getTaxRefunded() - $creditmemo->getTaxAmount(); - $allowedBaseTax = $order->getBaseTaxInvoiced() - $order->getBaseTaxRefunded() - $creditmemo->getBaseTaxAmount(); - $allowedDiscountTaxCompensation = $order->getDiscountTaxCompensationInvoiced() + - $order->getShippingDiscountTaxCompensationAmount() - - $order->getDiscountTaxCompensationRefunded() - - $order->getShippingDiscountTaxCompensationRefunded() - - $creditmemo->getDiscountTaxCompensationAmount() - - $creditmemo->getShippingDiscountTaxCompensationAmount(); - $allowedBaseDiscountTaxCompensation = $order->getBaseDiscountTaxCompensationInvoiced() + - $order->getBaseShippingDiscountTaxCompensationAmnt() - - $order->getBaseDiscountTaxCompensationRefunded() - - $order->getBaseShippingDiscountTaxCompensationRefunded() - - $creditmemo->getBaseShippingDiscountTaxCompensationAmnt() - - $creditmemo->getBaseDiscountTaxCompensationAmount(); + $allowedTax = $this->calculateAllowedTax($creditmemo); + $allowedBaseTax = $this->calculateAllowedBaseTax($creditmemo); + $allowedDiscountTaxCompensation = $this->calculateAllowedDiscountTaxCompensation($creditmemo); + $allowedBaseDiscountTaxCompensation = $this->calculateAllowedBaseDiscountTaxCompensation($creditmemo); if ($creditmemo->isLast() && !$isPartialShippingRefunded) { $totalTax = $allowedTax; @@ -161,10 +167,11 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) } else { $totalTax = min($allowedTax, $totalTax); $baseTotalTax = min($allowedBaseTax, $baseTotalTax); - $totalDiscountTaxCompensation = - min($allowedDiscountTaxCompensation, $totalDiscountTaxCompensation); - $baseTotalDiscountTaxCompensation = - min($allowedBaseDiscountTaxCompensation, $baseTotalDiscountTaxCompensation); + $totalDiscountTaxCompensation = min($allowedDiscountTaxCompensation, $totalDiscountTaxCompensation); + $baseTotalDiscountTaxCompensation = min( + $allowedBaseDiscountTaxCompensation, + $baseTotalDiscountTaxCompensation + ); } $creditmemo->setTaxAmount($creditmemo->getTaxAmount() + $totalTax); @@ -177,9 +184,132 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $totalTax + $totalDiscountTaxCompensation); $creditmemo->setBaseGrandTotal( - $creditmemo->getBaseGrandTotal() + - $baseTotalTax + $baseTotalDiscountTaxCompensation + $creditmemo->getBaseGrandTotal() + $baseTotalTax + $baseTotalDiscountTaxCompensation ); return $this; + + } + + /** + * Calculate allowed to Credit Memo tax amount + * + * @param Creditmemo $creditMemo + * @return float + */ + private function calculateAllowedTax(Creditmemo $creditMemo): float + { + $invoice = $creditMemo->getInvoice(); + $order = $creditMemo->getOrder(); + if ($invoice!== null) { + $amount = $invoice->getTaxAmount() + - $this->calculateInvoiceRefundedAmount($invoice, CreditmemoInterface::TAX_AMOUNT); + } else { + $amount = $order->getTaxInvoiced() - $order->getTaxRefunded(); + } + + return (float) $amount - $creditMemo->getTaxAmount(); + } + + /** + * Calculate allowed to Credit Memo tax amount in the base currency + * + * @param Creditmemo $creditMemo + * @return float + */ + private function calculateAllowedBaseTax(Creditmemo $creditMemo): float + { + $invoice = $creditMemo->getInvoice(); + $order = $creditMemo->getOrder(); + + if ($invoice!== null) { + $amount = $invoice->getBaseTaxAmount() + - $this->calculateInvoiceRefundedAmount($invoice, CreditmemoInterface::BASE_TAX_AMOUNT); + } else { + $amount = $order->getBaseTaxInvoiced() - $order->getBaseTaxRefunded(); + } + + return (float) $amount - $creditMemo->getBaseTaxAmount(); + } + + /** + * Calculate allowed to Credit Memo discount tax compensation amount + * + * @param Creditmemo $creditMemo + * @return float + */ + private function calculateAllowedDiscountTaxCompensation(Creditmemo $creditMemo): float + { + $invoice = $creditMemo->getInvoice(); + $order = $creditMemo->getOrder(); + + if ($invoice) { + $amount = $invoice->getDiscountTaxCompensationAmount() + + $invoice->getShippingDiscountTaxCompensationAmount() + - $this->calculateInvoiceRefundedAmount( + $invoice, + CreditmemoInterface::DISCOUNT_TAX_COMPENSATION_AMOUNT + ) - $this->calculateInvoiceRefundedAmount( + $invoice, + CreditmemoInterface::SHIPPING_DISCOUNT_TAX_COMPENSATION_AMOUNT + ); + } else { + $amount = $order->getDiscountTaxCompensationInvoiced() + + $order->getShippingDiscountTaxCompensationAmount() + - $order->getDiscountTaxCompensationRefunded() + - $order->getShippingDiscountTaxCompensationRefunded(); + } + + return (float) $amount + - $creditMemo->getDiscountTaxCompensationAmount() + - $creditMemo->getShippingDiscountTaxCompensationAmount(); + } + + /** + * Calculate allowed to Credit Memo discount tax compensation amount in the base currency + * + * @param Creditmemo $creditMemo + * @return float + */ + private function calculateAllowedBaseDiscountTaxCompensation(Creditmemo $creditMemo): float + { + $invoice = $creditMemo->getInvoice(); + $order = $creditMemo->getOrder(); + + if ($invoice) { + $amount = $invoice->getBaseDiscountTaxCompensationAmount() + + $invoice->getBaseShippingDiscountTaxCompensationAmnt() + - $this->calculateInvoiceRefundedAmount( + $invoice, + CreditmemoInterface::BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT + ) - $this->calculateInvoiceRefundedAmount( + $invoice, + CreditmemoInterface::BASE_SHIPPING_DISCOUNT_TAX_COMPENSATION_AMNT + ); + } else { + $amount = $order->getBaseDiscountTaxCompensationInvoiced() + + $order->getBaseShippingDiscountTaxCompensationAmnt() + - $order->getBaseDiscountTaxCompensationRefunded() + - $order->getBaseShippingDiscountTaxCompensationRefunded(); + } + + return (float) $amount + - $creditMemo->getBaseShippingDiscountTaxCompensationAmnt() + - $creditMemo->getBaseDiscountTaxCompensationAmount(); + } + + /** + * Calculate refunded amount for invoice + * + * @param Invoice $invoice + * @param string $field + * @return float + */ + private function calculateInvoiceRefundedAmount(Invoice $invoice, string $field): float + { + if (empty($invoice->getId())) { + return 0; + } + + return $this->resourceInvoice->calculateRefundedAmount((int)$invoice->getId(), $field); } } diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Invoice.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Invoice.php index 848f88118ed32..bc21e9cd6c894 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Invoice.php @@ -5,11 +5,9 @@ */ namespace Magento\Sales\Model\ResourceModel\Order; -use Magento\Framework\App\ResourceConnection; -use Magento\SalesSequence\Model\Manager; -use Magento\Sales\Model\ResourceModel\Attribute; +use Magento\Framework\DataObject; +use Magento\Framework\Model\AbstractModel; use Magento\Sales\Model\ResourceModel\EntityAbstract as SalesResource; -use Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot; use Magento\Sales\Model\Spi\InvoiceResourceInterface; /** @@ -37,10 +35,10 @@ protected function _construct() /** * Perform actions before object save * - * @param \Magento\Framework\Model\AbstractModel|\Magento\Framework\DataObject $object + * @param AbstractModel|DataObject $object * @return $this */ - protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) + protected function _beforeSave(AbstractModel $object) { /** @var \Magento\Sales\Model\Order\Invoice $object */ if (!$object->getOrderId() && $object->getOrder()) { @@ -50,4 +48,29 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) return parent::_beforeSave($object); } + + /** + * Calculate refunded amount for invoice + * + * @param int $invoiceId + * @param string $filed + * @return float + * @throws \InvalidArgumentException + */ + public function calculateRefundedAmount(int $invoiceId, string $filed): float + { + if (empty($filed)) { + throw new \InvalidArgumentException('The field param must be passed'); + } + + $select = $this->getConnection()->select(); + $select->from( + ['credit_memo' => $this->getTable('sales_creditmemo')], + ['total' => new \Zend_Db_Expr("SUM(credit_memo.{$filed})")] + )->where( + "credit_memo.invoice_id = ?", $invoiceId + ); + + return (float) $this->getConnection()->fetchOne($select); + } } diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertStorefrontOrderShipmentsQtyShippedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertStorefrontOrderShipmentsQtyShippedActionGroup.xml new file mode 100644 index 0000000000000..0c3544f8944ed --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertStorefrontOrderShipmentsQtyShippedActionGroup.xml @@ -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="AssertStorefrontOrderShipmentsQtyShippedActionGroup"> + <annotations> + <description>Verify Customer Order Shipments Qty Shipped</description> + </annotations> + <arguments> + <argument name="expectedQtyShipped" type="string" defaultValue="0"/> + </arguments> + <grabTextFrom selector="{{StorefrontSalesOrderShipmentSection.salesOrderQtyShipped}}" stepKey="grabSalesOrderQtyShipped"/> + <assertEquals stepKey="assertOrderQtyShipped"> + <actualResult type="string">$grabSalesOrderQtyShipped</actualResult> + <expectedResult type="string">{{expectedQtyShipped}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml new file mode 100644 index 0000000000000..d50a262a2f8b2 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml @@ -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="CancelOrder" type="CancelOrder"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml new file mode 100644 index 0000000000000..c874b5a2118db --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateCancelOrder" dataType="CancelOrder" type="create" auth="adminOauth" url="V1/orders/{return}/cancel" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontSalesOrderShipmentSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontSalesOrderShipmentSection.xml new file mode 100644 index 0000000000000..e2e814efb9f02 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontSalesOrderShipmentSection.xml @@ -0,0 +1,14 @@ +<?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="StorefrontSalesOrderShipmentSection"> + <element name="salesOrderQtyShipped" type="text" selector="//td[@data-th='Qty Shipped']"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderShipmentForDecimalQuantityTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderShipmentForDecimalQuantityTest.xml new file mode 100644 index 0000000000000..b086074132e85 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderShipmentForDecimalQuantityTest.xml @@ -0,0 +1,104 @@ +<?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="StorefrontVerifyOrderShipmentForDecimalQuantityTest"> + <annotations> + <title value="Incorrect Quantity Shipped Displayed on order detail page on the front"/> + <stories value="Verify shipment quantity for decimal quantity at frontend order shipment tab"/> + <description value="Verify shipment quantity for decimal quantity at frontend order shipment tab"/> + <features value="Sales"/> + <testCaseId value="MC-39777"/> + <useCaseId value="MC-39353"/> + <severity value="MAJOR"/> + <group value="Sales"/> + </annotations> + <before> + <createData entity="_defaultCategory" stepKey="createSimpleCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createSimpleCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"> + <field key="group_id">1</field> + </createData> + </before> + <after> + <!--Clear Filters--> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderListingFilters"/> + <deleteData createDataKey="createSimpleCategory" stepKey="deletePreReqCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deletePreReqSimpleProduct"/> + <!--Logout from customer account--> + <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomerOne"/> + <waitForPageLoad stepKey="waitLogoutCustomerOne"/> + <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit--> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" /> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <!-- Step2. Update product Advanced Inventory Setting. + Set *Qty Uses Decimals* to *Yes* and *Enable Qty Increments* to *Yes* and *Qty Increments* to *2.14*. --> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/> + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/> + <actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig"> + <argument name="value" value="Yes"/> + </actionGroup> + <actionGroup ref="AdminSetEnableQtyIncrementsActionGroup" stepKey="setEnableQtyIncrements"> + <argument name="value" value="Yes"/> + </actionGroup> + <actionGroup ref="AdminSetQtyIncrementsForProductActionGroup" stepKey="setQtyIncrementsValue"> + <argument name="qty" value="2.14"/> + </actionGroup> + <actionGroup ref="AdminSetMinAllowedQtyForProductActionGroup" stepKey="fillMiniAllowedQty"> + <argument name="qty" value="2.14"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/> + + <!--Step3. Save the product--> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> + <!--Step4. Open *Customer view* (Go to *Store Front*). Open *prod1* page (Find via search and click on product name) --> + <!--Step5. Log in to Storefront as Customer--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser"> + <argument name="Customer" value="$$createSimpleUsCustomer$$"/> + </actionGroup> + <!--Step6. Go to product page--> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> + <!--Step7. Add Product to Shopping Cart--> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!--Step8. Navigate to checkout--> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> + <!--Step9. Click next button to open payment section--> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> + <!--Step10. Click place order--> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + <!--Step11. Go to admin Order page for newly created order--> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> + + <actionGroup ref="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup" stepKey="goToOrderHistoryPage"/> + <!--Step12. Go to Customer Order Shipment Page and Checking the correctness of displayed Qty Shipped --> + <amOnPage url="{{StorefrontCustomerOrderShipmentPage.url({$grabOrderNumber})}}" stepKey="amOnOrderShipmentPage"/> + <waitForPageLoad time="30" stepKey="waitForOrderShipmentsPageLoad"/> + <actionGroup ref="AssertStorefrontOrderShipmentsQtyShippedActionGroup" stepKey="verifyAssertOrderShipments"> + <argument name="expectedQtyShipped" value="2.14"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php index 94346fc1b7a28..f6d7c6fdba60a 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php @@ -17,6 +17,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Class to test Collecting credit memo taxes + */ class TaxTest extends TestCase { /** @@ -44,6 +47,9 @@ class TaxTest extends TestCase */ protected $invoice; + /** + * @inheritdoc + */ protected function setUp(): void { $this->objectManager = new ObjectManager($this); @@ -186,8 +192,10 @@ public function collectDataProvider() 'base_shipping_amount' => 30, 'tax_amount' => 0.82, 'base_tax_amount' => 0.82, - 'invoice' => new MagentoObject( + 'invoice' => $this->createInvoiceMock( [ + 'tax_amount' => 24.33, + 'base_tax_amount' => 24.33, 'shipping_tax_amount' => 2.45, 'base_shipping_tax_amount' => 2.45, 'shipping_discount_tax_compensation_amount' => 0, @@ -275,8 +283,10 @@ public function collectDataProvider() 'base_shipping_amount' => 30, 'tax_amount' => 0.82 * $currencyRatio, 'base_tax_amount' => 0.82, - 'invoice' => new MagentoObject( + 'invoice' => $this->createInvoiceMock( [ + 'tax_amount' => 24.33 * $currencyRatio, + 'base_tax_amount' => 24.33, 'shipping_tax_amount' => 2.45 * $currencyRatio, 'base_shipping_tax_amount' => 2.45, 'shipping_discount_tax_compensation_amount' => 0, @@ -350,8 +360,10 @@ public function collectDataProvider() 'base_shipping_amount' => 30, 'tax_amount' => 1.65, 'base_tax_amount' => 1.65, - 'invoice' => new MagentoObject( + 'invoice' => $this->createInvoiceMock( [ + 'tax_amount' => 11.14, + 'base_tax_amount' => 11.14, 'shipping_tax_amount' => 1.24, 'base_shipping_tax_amount' => 1.24, 'shipping_discount_tax_compensation_amount' => 0, @@ -426,8 +438,10 @@ public function collectDataProvider() 'base_shipping_amount' => 0, 'tax_amount' => 0.82, 'base_tax_amount' => 0.82, - 'invoice' => new MagentoObject( + 'invoice' => $this->createInvoiceMock( [ + 'tax_amount' => 16.09, + 'base_tax_amount' => 16.09, 'shipping_tax_amount' => 1.24, 'base_shipping_tax_amount' => 1.24, 'shipping_discount_tax_compensation_amount' => 0, @@ -507,14 +521,6 @@ public function collectDataProvider() 'base_shipping_amount' => 0, 'tax_amount' => 0.76, 'base_tax_amount' => 0.76, - 'invoice' => new MagentoObject( - [ - 'shipping_tax_amount' => 0, - 'base_shipping_tax_amount' => 0, - 'shipping_discount_tax_compensation_amount' => 0, - 'base_shipping_discount_tax_compensation_amount' => 0, - ] - ), ], ], 'expected_results' => [ @@ -581,8 +587,10 @@ public function collectDataProvider() 'base_grand_total' => 60.82, 'tax_amount' => 0.82, 'base_tax_amount' => 0.82, - 'invoice' => new MagentoObject( + 'invoice' => $this->createInvoiceMock( [ + 'tax_amount' => 16.09, + 'base_tax_amount' => 16.09, 'shipping_tax_amount' => 1.24, 'base_shipping_tax_amount' => 1.24, 'shipping_discount_tax_compensation_amount' => 0, @@ -712,14 +720,6 @@ public function collectDataProvider() 'base_shipping_amount' => 0, 'tax_amount' => 0, 'base_tax_amount' => 0, - 'invoice' => new MagentoObject( - [ - 'shipping_tax_amount' => 0, - 'base_shipping_tax_amount' => 0, - 'shipping_discount_tax_compensation_amount' => 0, - 'base_shipping_discount_tax_compensation_amount' => 0, - ] - ), ], ], 'expected_results' => [ @@ -779,4 +779,40 @@ protected function getCreditmemoItem($creditmemoItemData) $creditmemoItem->setData('qty', $creditmemoItemData['qty']); return $creditmemoItem; } + + /** + * Create invoice mock object + * + * @param array $data + * @return MockObject|Invoice + */ + private function createInvoiceMock(array $data): MockObject + { + /** @var MockObject|Invoice $invoice */ + $invoice = $this->getMockBuilder(Invoice::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->addMethods(['getBaseShippingDiscountTaxCompensationAmount']) + ->onlyMethods([ + 'getTaxAmount', + 'getBaseTaxAmount', + 'getShippingTaxAmount', + 'getBaseShippingTaxAmount', + 'getShippingDiscountTaxCompensationAmount' + ]) + ->getMock(); + + $invoice->method('getTaxAmount')->willReturn($data['tax_amount'] ?? 0); + $invoice->method('getBaseTaxAmount')->willReturn($data['base_tax_amount'] ?? 0); + $invoice->method('getShippingTaxAmount')->willReturn($data['shipping_tax_amount'] ?? 0); + $invoice->method('getBaseShippingTaxAmount')->willReturn($data['base_shipping_tax_amount'] ?? 0); + $invoice->method('getShippingDiscountTaxCompensationAmount') + ->willReturn($data['shipping_discount_tax_compensation_amount'] ?? 0); + $invoice->method('getBaseShippingDiscountTaxCompensationAmount') + ->willReturn($data['base_shipping_discount_tax_compensation_amount'] ?? 0); + + return $invoice; + } } diff --git a/app/code/Magento/Sales/ViewModel/Header/LogoPathResolver.php b/app/code/Magento/Sales/ViewModel/Header/LogoPathResolver.php new file mode 100644 index 0000000000000..c58654e160749 --- /dev/null +++ b/app/code/Magento/Sales/ViewModel/Header/LogoPathResolver.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\ViewModel\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolverInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Sales\Model\Order; +use Magento\Framework\Registry; + +/** + * Class for resolving logo path + */ +class LogoPathResolver implements LogoPathResolverInterface, ArgumentInterface +{ + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * Core registry + * + * @var Registry + */ + private $coreRegistry; + + /** + * @param ScopeConfigInterface $scopeConfig + * @param Registry $registry + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + Registry $registry + ) { + $this->scopeConfig = $scopeConfig; + $this->coreRegistry = $registry; + } + + /** + * Return logo image path + * + * @return string|null + */ + public function getPath(): ?string + { + $path = null; + $storeId = null; + $order = $this->coreRegistry->registry('current_order'); + if ($order instanceof Order) { + $storeId = $order->getStoreId(); + } + $storeLogoPath = $this->scopeConfig->getValue( + 'sales/identity/logo_html', + ScopeInterface::SCOPE_STORE, + $storeId + ); + if ($storeLogoPath !== null) { + $path = 'sales/store/logo_html/' . $storeLogoPath; + } + return $path; + } +} diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index 4410a6fc4a9a2..8a52e65a9f70c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -44,5 +44,10 @@ <block class="Magento\Sales\Block\Order\Info" as="sales.order.print.info" name="sales.order.print.info" template="Magento_Sales::order/info.phtml"/> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/> + <referenceBlock name="logo"> + <arguments> + <argument name="logoPathResolver" xsi:type="object">Magento\Sales\ViewModel\Header\LogoPathResolver</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml index 0021eeede4f2b..317ee419f6d96 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -28,5 +28,10 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/> + <referenceBlock name="logo"> + <arguments> + <argument name="logoPathResolver" xsi:type="object">Magento\Sales\ViewModel\Header\LogoPathResolver</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml index 0272286696e24..e0bb15bc0e7fd 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml @@ -35,5 +35,10 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/> + <referenceBlock name="logo"> + <arguments> + <argument name="logoPathResolver" xsi:type="object">Magento\Sales\ViewModel\Header\LogoPathResolver</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml index 30053b41a96a9..b7940c0d406cc 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml @@ -20,5 +20,10 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/> + <referenceBlock name="logo"> + <arguments> + <argument name="logoPathResolver" xsi:type="object">Magento\Sales\ViewModel\Header\LogoPathResolver</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml b/app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml index 6c7567a8cd14b..d2caa1a2ce935 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml @@ -42,5 +42,5 @@ <td class="col sku" data-th="<?= $block->escapeHtml(__('SKU')) ?>"> <?= /* @noEscape */ $block->prepareSku($block->getSku()) ?> </td> - <td class="col qty" data-th="<?= $block->escapeHtml(__('Qty Shipped')) ?>"><?= (int) $_item->getQty() ?></td> + <td class="col qty" data-th="<?= $block->escapeHtml(__('Qty Shipped')) ?>"><?= (float) $_item->getQty() ?></td> </tr> diff --git a/app/code/Magento/Theme/Block/Html/Header/Logo.php b/app/code/Magento/Theme/Block/Html/Header/Logo.php index 792ee95de4995..3c43e5bfc6fe1 100644 --- a/app/code/Magento/Theme/Block/Html/Header/Logo.php +++ b/app/code/Magento/Theme/Block/Html/Header/Logo.php @@ -6,6 +6,8 @@ namespace Magento\Theme\Block\Html\Header; +use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolverInterface; + /** * Logo page header block * @@ -124,16 +126,16 @@ public function getLogoHeight() */ protected function _getLogoUrl() { - $folderName = \Magento\Config\Model\Config\Backend\Image\Logo::UPLOAD_DIR; - $storeLogoPath = $this->_scopeConfig->getValue( - 'design/header/logo_src', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); - $path = $folderName . '/' . $storeLogoPath; + $path = null; + /** @var LogoPathResolverInterface $logoPathResolver */ + $logoPathResolver = $this->getData('logoPathResolver'); + if ($logoPathResolver instanceof LogoPathResolverInterface) { + $path = $logoPathResolver->getPath(); + } $logoUrl = $this->_urlBuilder ->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA]) . $path; - if ($storeLogoPath !== null && $this->_isFile($path)) { + if ($path !== null && $this->_isFile($path)) { $url = $logoUrl; } elseif ($this->getLogoFile()) { $url = $this->getViewFileUrl($this->getLogoFile()); diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php index 1978362810763..a5095674a4673 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php @@ -7,6 +7,7 @@ namespace Magento\Theme\Test\Unit\Block\Html\Header; +use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolverInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\Read; @@ -25,11 +26,11 @@ public function testGetLogoSrc() { $filesystem = $this->createMock(Filesystem::class); $mediaDirectory = $this->createMock(Read::class); - $scopeConfig = $this->getMockForAbstractClass(ScopeConfigInterface::class); + $logoPathResolver = $this->getMockForAbstractClass(LogoPathResolverInterface::class); $urlBuilder = $this->getMockForAbstractClass(UrlInterface::class); - $scopeConfig->expects($this->once())->method('getValue')->willReturn('default/image.gif'); + $logoPathResolver->expects($this->once())->method('getPath')->willReturn('logo/default/image.gif'); $urlBuilder->expects( $this->once() )->method( @@ -46,7 +47,7 @@ public function testGetLogoSrc() $objectManager = new ObjectManager($this); $arguments = [ - 'scopeConfig' => $scopeConfig, + 'data' => ['logoPathResolver' => $logoPathResolver], 'urlBuilder' => $urlBuilder, 'fileStorageHelper' => $helper, 'filesystem' => $filesystem, diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolver.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolver.php new file mode 100644 index 0000000000000..1a10fe9177320 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolver.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Config\Model\Config\Backend\Image\Logo; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; + +/** + * Class for resolving logo path + */ +class LogoPathResolver implements LogoPathResolverInterface, ArgumentInterface +{ + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + ScopeConfigInterface $scopeConfig + ) { + $this->scopeConfig = $scopeConfig; + } + + /** + * Return logo image path + * + * @return string|null + */ + public function getPath(): ?string + { + $path = null; + $storeLogoPath = $this->scopeConfig->getValue( + 'design/header/logo_src', + ScopeInterface::SCOPE_STORE + ); + if ($storeLogoPath !== null) { + $path = Logo::UPLOAD_DIR . '/' . $storeLogoPath; + } + return $path; + } +} diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolverInterface.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolverInterface.php new file mode 100644 index 0000000000000..3ac8442aa0ea7 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoPathResolverInterface.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +/** + * Interface for resolving logo path + */ +interface LogoPathResolverInterface +{ + /** + * Return logo image path + * + * @return null|string + */ + public function getPath(): ?string; +} diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index bf76933b356c0..f3e57b12150c9 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -51,7 +51,11 @@ </container> </container> <container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content"> - <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"/> + <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"> + <arguments> + <argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument> + </arguments> + </block> </container> </referenceContainer> <referenceContainer name="page.top"> diff --git a/app/code/Magento/UrlRewrite/Model/UrlRewrite.php b/app/code/Magento/UrlRewrite/Model/UrlRewrite.php index 5f29008621c1a..cbefcd4c75597 100644 --- a/app/code/Magento/UrlRewrite/Model/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/Model/UrlRewrite.php @@ -8,7 +8,17 @@ namespace Magento\UrlRewrite\Model; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\EntityManager\EventManager; +use Magento\Framework\Indexer\CacheContext; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; +use Magento\UrlRewrite\Controller\Adminhtml\Url\Rewrite; +use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteService; /** * UrlRewrite model class @@ -27,32 +37,65 @@ * @method UrlRewrite setStoreId($value) * @method UrlRewrite setDescription($value) */ -class UrlRewrite extends \Magento\Framework\Model\AbstractModel +class UrlRewrite extends AbstractModel { /** * @var Json */ private $serializer; + /** + * @var CacheContext|mixed|null + */ + private $cacheContext; + + /** + * @var EventManager|mixed|null + */ + private $eventManager; + + /** + * @var array + */ + private $entityToCacheTagMap; + + /** + * @var UrlFinderInterface + */ + private $urlFinder; + /** * UrlRewrite constructor. * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource - * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection + * @param Context $context + * @param Registry $registry + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection * @param array $data - * @param Json $serializer + * @param Json|null $serializer + * @param CacheContext|null $cacheContext + * @param EventManager|null $eventManager + * @param UrlFinderInterface|null $urlFinder + * @param array $entityToCacheTagMap */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, + Context $context, + Registry $registry, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, array $data = [], - Json $serializer = null - ) { + Json $serializer = null, + CacheContext $cacheContext = null, + EventManager $eventManager = null, + UrlFinderInterface $urlFinder = null, + array $entityToCacheTagMap = [] + ) + { $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->cacheContext = $cacheContext ?: ObjectManager::getInstance()->get(CacheContext::class); + $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(EventManager::class); + $this->urlFinder = $urlFinder ?: ObjectManager::getInstance()->get(UrlFinderInterface::class); + $this->entityToCacheTagMap = $entityToCacheTagMap; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -63,8 +106,8 @@ public function __construct( */ protected function _construct() { - $this->_init(\Magento\UrlRewrite\Model\ResourceModel\UrlRewrite::class); - $this->_collectionName = \Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection::class; + $this->_init(ResourceModel\UrlRewrite::class); + $this->_collectionName = UrlRewriteCollection::class; } /** @@ -92,4 +135,101 @@ public function setMetadata($metadata) } return $this->setData(\Magento\UrlRewrite\Service\V1\Data\UrlRewrite::METADATA, $metadata); } + + /** + * Gets final target UrlRewrite for custom rewrite record + * + * @param string $path + * @param int $storeId + * @return UrlRewriteService|null + */ + private function getFinalTargetUrlRewrite(string $path, int $storeId): ?UrlRewriteService + { + $urlRewriteTarget = $this->urlFinder->findOneByData( + [ + 'request_path' => $path, + 'store_id' => $storeId + ] + ); + + while ( + $urlRewriteTarget && + $urlRewriteTarget->getTargetPath() !== $urlRewriteTarget->getRequestPath() && + $urlRewriteTarget->getRedirectType() > 0 + ) { + $urlRewriteTarget = $this->urlFinder->findOneByData( + [ + 'request_path' => $urlRewriteTarget->getTargetPath(), + 'store_id' => $urlRewriteTarget->getStoreId() + ] + ); + } + + return $urlRewriteTarget; + } + + /** + * Clean the cache for entities affected by current rewrite + */ + public function cleanEntitiesCache() + { + if (!$this->isEmpty()) { + if ($this->getEntityType() === Rewrite::ENTITY_TYPE_CUSTOM) { + $urlRewrite = $this->getFinalTargetUrlRewrite( + $this->getTargetPath(), + (int)$this->getStoreId() + ); + + if ($urlRewrite) { + $this->cleanCacheForEntity($urlRewrite->getEntityType(), (int) $urlRewrite->getEntityId()); + } + + if ($this->getOrigData() && $this->getOrigData('target_path') !== $this->getTargetPath()) { + $origUrlRewrite = $this->getFinalTargetUrlRewrite( + $this->getOrigData('target_path'), + (int)$this->getOrigData('store_id') + ); + + if ($origUrlRewrite) { + $this->cleanCacheForEntity($origUrlRewrite->getEntityType(), (int) $origUrlRewrite->getEntityId()); + } + } + } else { + $this->cleanCacheForEntity($this->getEntityType(), (int) $this->getEntityId()); + } + } + } + + /** + * Clean cache for specified entity type by id + * + * @param string $entityType + * @param int $entityId + */ + private function cleanCacheForEntity(string $entityType, int $entityId) + { + if (array_key_exists($entityType, $this->entityToCacheTagMap)) { + $cacheKey = $this->entityToCacheTagMap[$entityType]; + $this->cacheContext->registerEntities($cacheKey, [$entityId]); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + } + } + + /** + * @inheritdoc + */ + public function afterDelete() + { + $this->_getResource()->addCommitCallback([$this, 'cleanEntitiesCache']); + return parent::afterDelete(); + } + + /** + * @inheritdoc + */ + public function afterSave() + { + $this->_getResource()->addCommitCallback([$this, 'cleanEntitiesCache']); + return parent::afterSave(); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceRangeTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceRangeTest.php new file mode 100644 index 0000000000000..81b08f28431a6 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceRangeTest.php @@ -0,0 +1,175 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\CatalogGraphQl; + +use Magento\GraphQl\GetCustomerAuthenticationHeader; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test class to verify catalog price rule is applied for + * tier prices for different customer groups. + */ +class PriceRangeTest extends GraphQlAbstract +{ + /** + * @var ObjectManager|null + */ + private $objectManager; + + /** + * @var GetCustomerAuthenticationHeader + */ + private $getCustomerAuthenticationHeader; + + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->getCustomerAuthenticationHeader = $this->objectManager->get(GetCustomerAuthenticationHeader::class); + } + + /** + * Test for checking if catalog rule price has been applied for all customer group + * + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoApiDataFixture Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php + */ + public function testCheckIfCatalogRuleIsAppliedForTierPriceForAllGroups(): void + { + $productSku = 'simple'; + $query = $this->getProductSearchQuery($productSku); + + $response = $this->graphQlQuery($query); + + $this->assertNotEmpty($response['products']); + $priceRange = $response['products']['items'][0]['price_range']; + $this->assertEquals(10, $priceRange['minimum_price']['regular_price']['value']); + $this->assertEquals(7.5, $priceRange['minimum_price']['final_price']['value']); + $this->assertEquals(2.5, $priceRange['minimum_price']['discount']['amount_off']); + $this->assertEquals(25, $priceRange['minimum_price']['discount']['percent_off']); + $this->assertEquals(10, $priceRange['maximum_price']['regular_price']['value']); + $this->assertEquals(7.5, $priceRange['maximum_price']['final_price']['value']); + $this->assertEquals(2.5, $priceRange['maximum_price']['discount']['amount_off']); + $this->assertEquals(25, $priceRange['maximum_price']['discount']['percent_off']); + } + + /** + * Test for checking if catalog rule price has been applied for registered customer + * + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group.php + * @magentoApiDataFixture Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group.php + */ + public function testCheckIfCatalogRuleIsAppliedForTierPriceForRegisteredCustomer(): void + { + $productSku = 'simple'; + $query = $this->getProductSearchQuery($productSku); + $response = $this->graphQlQuery( + $query, + [], + '', + $this->getCustomerAuthenticationHeader->execute('customer@example.com', 'password') + ); + + $this->assertNotEmpty($response['products']); + $priceRange = $response['products']['items'][0]['price_range']; + $this->assertEquals(10, $priceRange['minimum_price']['regular_price']['value']); + $this->assertEquals(5, $priceRange['minimum_price']['final_price']['value']); + $this->assertEquals(5, $priceRange['minimum_price']['discount']['amount_off']); + $this->assertEquals(50, $priceRange['minimum_price']['discount']['percent_off']); + $this->assertEquals(10, $priceRange['maximum_price']['regular_price']['value']); + $this->assertEquals(5, $priceRange['maximum_price']['final_price']['value']); + $this->assertEquals(5, $priceRange['maximum_price']['discount']['amount_off']); + $this->assertEquals(50, $priceRange['maximum_price']['discount']['percent_off']); + } + + /** + * Test for checking if catalog rule price has been applied for guest + * + * @magentoApiDataFixture Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group.php + * @magentoApiDataFixture Magento/CatalogRule/_files/catalog_rule_10_off_not_logged.php + */ + public function testCheckIfCatalogRuleIsAppliedForTierPriceForGuest(): void + { + $productSku = 'simple'; + $query = $this->getProductSearchQuery($productSku); + $response = $this->graphQlQuery($query); + + $this->assertNotEmpty($response['products']); + $priceRange = $response['products']['items'][0]['price_range']; + $this->assertEquals(10, $priceRange['minimum_price']['regular_price']['value']); + $this->assertEquals(9, $priceRange['minimum_price']['final_price']['value']); + $this->assertEquals(1, $priceRange['minimum_price']['discount']['amount_off']); + $this->assertEquals(10, $priceRange['minimum_price']['discount']['percent_off']); + $this->assertEquals(10, $priceRange['maximum_price']['regular_price']['value']); + $this->assertEquals(9, $priceRange['maximum_price']['final_price']['value']); + $this->assertEquals(1, $priceRange['maximum_price']['discount']['amount_off']); + $this->assertEquals(10, $priceRange['maximum_price']['discount']['percent_off']); + } + + /** + * Get a query which user filter for product sku and returns price_tiers + * + * @param string $productSku + * @return string + */ + private function getProductSearchQuery(string $productSku): string + { + return <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) { + items { + name + sku + price_range { + minimum_price { + regular_price { + value + currency + } + final_price { + value + currency + } + discount { + amount_off + percent_off + } + } + maximum_price { + regular_price { + value + currency + } + final_price { + value + currency + } + discount { + amount_off + percent_off + } + } + } + price_tiers{ + discount{ + amount_off + percent_off + } + final_price{ + value + } + quantity + } + } + } +} +QUERY; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php index 7aed048f1c4ce..4a4b617d7c28e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php @@ -7,8 +7,14 @@ namespace Magento\GraphQl\UrlRewrite; +use Magento\Framework\Exception\AlreadyExistsException; +use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\UrlRewrite\Model\ResourceModel\UrlRewrite as UrlRewriteResourceModel; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewrite\Model\UrlRewrite as UrlRewriteModel; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteService; /** * Test the GraphQL endpoint's URLResolver query to verify canonical URL's are correctly returned. @@ -20,7 +26,7 @@ class UrlResolverTest extends GraphQlAbstract protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->objectManager = Bootstrap::getObjectManager(); } /** @@ -50,4 +56,175 @@ public function testNonExistentEntityUrlRewrite() ); $this->graphQlQuery($query); } + + /** + * Test for url rewrite to clean cache on rewrites update + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_category.php + * @magentoApiDataFixture Magento/Cms/_files/pages.php + * + * @dataProvider urlRewriteEntitiesDataProvider + * @param string $requestPath + * @throws AlreadyExistsException + */ + public function testUrlRewriteCleansCacheOnChange(string $requestPath) + { + + /** @var UrlRewriteResourceModel $urlRewriteResourceModel */ + $urlRewriteResourceModel = $this->objectManager->create(UrlRewriteResourceModel::class); + $storeId = 1; + $query = function ($requestUrl) { + return <<<QUERY +{ + urlResolver(url:"{$requestUrl}") + { + id + entity_uid + relative_url + type + redirectCode + } +} +QUERY; + }; + + // warming up urlResolver API response cache for entity and validate proper response + $apiResponse = $this->graphQlQuery($query($requestPath)); + $this->assertEquals($requestPath, $apiResponse['urlResolver']['relative_url']); + + $urlRewrite = $this->getUrlRewriteModelByRequestPath($requestPath, $storeId); + + // renaming entity request path and validating that API will not return cached response + $urlRewrite->setRequestPath('test' . $requestPath); + $urlRewriteResourceModel->save($urlRewrite); + $apiResponse = $this->graphQlQuery($query($requestPath)); + $this->assertNull($apiResponse['urlResolver']); + + // rolling back changes + $urlRewrite->setRequestPath($requestPath); + $urlRewriteResourceModel->save($urlRewrite); + } + + public function urlRewriteEntitiesDataProvider(): array + { + return [ + [ + 'simple-product-in-stock.html' + ], + [ + 'category-1.html' + ], + [ + 'page100' + ] + ]; + } + + /** + * Test for custom url rewrite to clean cache on update combinations + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_category.php + * @magentoApiDataFixture Magento/Cms/_files/pages.php + * + * @throws AlreadyExistsException + */ + public function testUrlRewriteCleansCacheForCustomRewrites() + { + + /** @var UrlRewriteResourceModel $urlRewriteResourceModel */ + $urlRewriteResourceModel = $this->objectManager->create(UrlRewriteResourceModel::class); + $storeId = 1; + $query = function ($requestUrl) { + return <<<QUERY +{ + urlResolver(url:"{$requestUrl}") + { + id + entity_uid + relative_url + type + redirectCode + } +} +QUERY; + }; + + $customRequestPath = 'test.html'; + $customSecondRequestPath = 'test2.html'; + $entitiesRequestPaths = [ + 'simple-product-in-stock.html', + 'category-1.html', + 'page100' + ]; + + // create custom url rewrite + $urlRewrite = $this->objectManager->create(UrlRewriteModel::class); + $urlRewrite->setEntityType('custom') + ->setRedirectType(302) + ->setStoreId($storeId) + ->setDescription(null) + ->setIsAutogenerated(0); + + // create second custom url rewrite and target it to previous one to check + // if proper final target url will be resolved + $secondUrlRewrite = $this->objectManager->create(UrlRewriteModel::class); + $secondUrlRewrite->setEntityType('custom') + ->setRedirectType(302) + ->setStoreId($storeId) + ->setRequestPath($customSecondRequestPath) + ->setTargetPath($customRequestPath) + ->setDescription(null) + ->setIsAutogenerated(0); + $urlRewriteResourceModel->save($secondUrlRewrite); + + foreach ($entitiesRequestPaths as $entityRequestPath) { + // updating custom rewrite for each entity + $urlRewrite->setRequestPath($customRequestPath) + ->setTargetPath($entityRequestPath); + $urlRewriteResourceModel->save($urlRewrite); + + // confirm that API returns non-cached response for the first custom rewrite + $apiResponse = $this->graphQlQuery($query($customRequestPath)); + $this->assertEquals($entityRequestPath, $apiResponse['urlResolver']['relative_url']); + + // confirm that API returns non-cached response for the second custom rewrite + $apiResponse = $this->graphQlQuery($query($customSecondRequestPath)); + $this->assertEquals($entityRequestPath, $apiResponse['urlResolver']['relative_url']); + } + + $urlRewriteResourceModel->delete($secondUrlRewrite); + + // delete custom rewrite and validate that API will not return cached response + $urlRewriteResourceModel->delete($urlRewrite); + $apiResponse = $this->graphQlQuery($query($customRequestPath)); + $this->assertNull($apiResponse['urlResolver']); + } + + /** + * Return UrlRewrite model instance by request_path + * + * @param string $requestPath + * @param int $storeId + * @return UrlRewriteModel + */ + private function getUrlRewriteModelByRequestPath(string $requestPath, int $storeId): UrlRewriteModel + { + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + + /** @var UrlRewriteService $urlRewriteService */ + $urlRewriteService = $urlFinder->findOneByData( + [ + 'request_path' => $requestPath, + 'store_id' => $storeId + ] + ); + + /** @var UrlRewriteModel $urlRewrite */ + $urlRewrite = $this->objectManager->create(UrlRewriteModel::class); + $urlRewrite->load($urlRewriteService->getUrlRewriteId()); + + return $urlRewrite; + } + } diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php index 1054706819e95..42d21afae8274 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php @@ -326,7 +326,7 @@ public function updateItemDataProvider(): array 'use_config_backorders' => 0, 'backorders' => Stock::BACKORDERS_NO, ], - 'This product is out of stock.' + 'There are no source items with the in stock status' ], [ [ diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php index 328a85ffd51ad..6d3761fdfcb79 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php @@ -5,34 +5,44 @@ */ namespace Magento\Backend\Block\Widget\Grid; +use Laminas\Stdlib\Parameters; +use Magento\Backend\Block\Template\Context; +use Magento\Framework\Data\Collection; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + /** * @magentoAppArea adminhtml */ -class ExtendedTest extends \PHPUnit\Framework\TestCase +class ExtendedTest extends TestCase { /** - * @var \Magento\Backend\Block\Widget\Grid\Extended + * @var Extended */ protected $_block; /** - * @var \Magento\Framework\View\LayoutInterface + * @var LayoutInterface */ protected $_layoutMock; + /** + * @inheritDoc + */ protected function setUp(): void { parent::setUp(); - $this->_layoutMock = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\View\LayoutInterface::class + $this->_layoutMock = Bootstrap::getObjectManager()->get( + LayoutInterface::class ); - $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Backend\Block\Template\Context::class, + $context = Bootstrap::getObjectManager()->create( + Context::class, ['layout' => $this->_layoutMock] ); $this->_block = $this->_layoutMock->createBlock( - \Magento\Backend\Block\Widget\Grid\Extended::class, + Extended::class, 'grid', ['context' => $context] ); @@ -47,7 +57,7 @@ protected function setUp(): void public function testAddColumnAddsChildToColumnSet() { $this->assertInstanceOf( - \Magento\Backend\Block\Widget\Grid\Column::class, + Column::class, $this->_block->getColumnSet()->getChildBlock('column1') ); $this->assertCount(2, $this->_block->getColumnSet()->getChildNames()); @@ -84,4 +94,32 @@ public function testGetMainButtonsHtmlReturnsEmptyStringIfFiltersArentVisible() $this->_block->setFilterVisibility(false); $this->assertEquals('', $this->_block->getMainButtonsHtml()); } + + /** + * Checks that template does not have redundant div close tag + * + * @return void + */ + public function testExtendedTemplateMarkup(): void + { + $mockCollection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $this->_block->setCollection($mockCollection); + $this->_block->getRequest() + ->setQuery( + Bootstrap::getObjectManager() + ->create( + Parameters::class, + [ + 'values' => [ + 'ajax' => true + ] + ] + ) + ); + $html = $this->_block->getHtml(); + $html = str_replace(["\n", " "], '', $html); + $this->assertStringEndsWith("</table></div>", $html); + } } diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php new file mode 100644 index 0000000000000..6b1ab58035568 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * 'Final Price' model integration tests. + * + * @magentoDbIsolation disabled + */ +class FinalPriceTest extends TestCase +{ + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + } + + /** + * Check minimal and maximal prices are calculated correctly for Bundle product selections with Tier Prices. + * + * @return void + * @magentoDataFixture Magento/Bundle/_files/bundle_product_with_tier_price_selections.php + */ + public function testGetPriceForBundleSelectionsWithTierPrices(): void + { + $priceModel = $this->getPriceModel('bundle_with_tier_price_selections'); + $this->assertEquals(15.0, $priceModel->getMinimalPrice()->getValue()); + $this->assertEquals(45.0, $priceModel->getMaximalPrice()->getValue()); + } + + /** + * Create and retrieve Price Model for provided Product SKU. + * + * @param string $productSku + * @return FinalPrice + */ + private function getPriceModel(string $productSku): FinalPrice + { + $bundleProduct = $this->productRepository->get($productSku); + + return $this->objectManager->create( + FinalPrice::class, + [ + 'saleableItem' => $bundleProduct, + 'quantity' => 0., + ] + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections.php new file mode 100644 index 0000000000000..5ef6daa5d11da --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Bundle\Model\Product\Price; +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Type\AbstractType; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Bundle\Model\PrepareBundleLinks; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/three_simple_products_with_tier_price.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductInterfaceFactory $productFactory */ +$productFactory = $objectManager->get(ProductInterfaceFactory::class); +/** @var PrepareBundleLinks $prepareBundleLinks */ +$prepareBundleLinks = $objectManager->get(PrepareBundleLinks::class); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +$defaultWebsiteId = $storeManager->getWebsite('base')->getId(); + +$bundleProduct = $productFactory->create(); +$bundleProduct->setTypeId(Type::TYPE_BUNDLE) + ->setAttributeSetId($bundleProduct->getDefaultAttributeSetId()) + ->setWebsiteIds([$defaultWebsiteId]) + ->setName('Bundle Product') + ->setSku('bundle_with_tier_price_selections') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ) + ->setSkuType(0) + ->setPriceView(0) + ->setPriceType(Price::PRICE_TYPE_DYNAMIC) + ->setPrice(null) + ->setWeightType(0) + ->setShipmentType(AbstractType::SHIPMENT_TOGETHER); + +$bundleOptionsData = [ + [ + 'title' => 'Option 1', + 'default_title' => 'Option 1', + 'type' => 'select', + 'required' => 1, + ], +]; +$bundleSelectionsData = [ + [ + [ + 'sku' => 'simple_1', + 'selection_qty' => 3, + ], + [ + 'sku' => 'simple_2', + 'selection_qty' => 3, + ], + [ + 'sku' => 'simple_3', + 'selection_qty' => 3, + ], + ] +]; +$bundleProduct = $prepareBundleLinks->execute($bundleProduct, $bundleOptionsData, $bundleSelectionsData); +$productRepository->save($bundleProduct); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections_rollback.php new file mode 100644 index 0000000000000..e8d0ed513e839 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/bundle_product_with_tier_price_selections_rollback.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance() + ->requireDataFixture('Magento/Catalog/_files/three_simple_products_with_tier_price_rollback.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +try { + $product = $productRepository->get('bundle_with_tier_price_selections', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { + //Product already removed +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group.php new file mode 100644 index 0000000000000..35af54d574fd4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; +use Magento\Customer\Model\Group; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$tierPriceFactory = $objectManager->get(ProductTierPriceInterfaceFactory::class); +$tpExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class); +$product = $productRepository->get('simple', false, null, true); +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class)->get('admin'); +$tierPriceExtensionAttributes = $tpExtensionAttributesFactory->create()->setWebsiteId($adminWebsite->getId()); +$pricesForCustomerGroupsInput = [ + [ + 'customer_group_id' => '1', + 'percentage_value'=> null, + 'qty'=> 1, + 'value'=> 20 + ], + [ + 'customer_group_id' => '1', + 'percentage_value'=> null, + 'qty'=> 2, + 'value'=> 30 + ] +]; +$productTierPrices = []; +foreach ($pricesForCustomerGroupsInput as $price) { + $productTierPrices[] = $tierPriceFactory->create( + [ + 'data' => $price + ] + )->setExtensionAttributes($tierPriceExtensionAttributes); +} +$product->setTierPrices($productTierPrices); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group_rollback.php new file mode 100644 index 0000000000000..328c1e229da5c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_logged_in_group_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group.php new file mode 100644 index 0000000000000..cfb89b7de3305 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; +use Magento\Customer\Model\Group; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$tierPriceFactory = $objectManager->get(ProductTierPriceInterfaceFactory::class); +$tpExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class); +$product = $productRepository->get('simple', false, null, true); +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class)->get('admin'); +$tierPriceExtensionAttributes = $tpExtensionAttributesFactory->create()->setWebsiteId($adminWebsite->getId()); +$pricesForCustomerGroupsInput = [ + [ + 'customer_group_id' => Group::NOT_LOGGED_IN_ID, + 'percentage_value'=> null, + 'qty'=> 1, + 'value'=> 50 + ], + [ + 'customer_group_id' => Group::NOT_LOGGED_IN_ID, + 'percentage_value'=> null, + 'qty'=> 2, + 'value'=> 80 + ] +]; +$productTierPrices = []; +foreach ($pricesForCustomerGroupsInput as $price) { + $productTierPrices[] = $tierPriceFactory->create( + [ + 'data' => $price + ] + )->setExtensionAttributes($tierPriceExtensionAttributes); +} +$product->setTierPrices($productTierPrices); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group_rollback.php new file mode 100644 index 0000000000000..328c1e229da5c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_prices_for_not_logged_in_group_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price.php new file mode 100644 index 0000000000000..2b04935e46941 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Customer\Model\Group; +use Magento\Store\Api\Data\WebsiteInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductTierPriceInterfaceFactory $tierPriceFactory */ +$tierPriceFactory = $objectManager->get(ProductTierPriceInterfaceFactory::class); +/** @var ProductTierPriceExtensionFactory $tpExtensionAttributes */ +$tpExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class); + +/** @var WebsiteInterface $adminWebsite */ +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class)->get('admin'); +$tierPriceExtensionAttributes = $tpExtensionAttributesFactory->create() + ->setWebsiteId($adminWebsite->getId()) + ->setPercentageValue(50); + +$tierPrice = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::CUST_GROUP_ALL, + 'qty' => 2, + ], + ] +)->setExtensionAttributes($tierPriceExtensionAttributes); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productNumber = 1; +foreach ([10, 20, 30] as $price) { + /** @var $product Product */ + $product = $objectManager->create(Product::class); + $product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('Simple Product ' . $productNumber) + ->setSku('simple_' . $productNumber) + ->setPrice($price) + ->setWeight(1) + ->setTierPrices([$tierPrice]) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); + + $productRepository->save($product); + $productNumber++; +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price_rollback.php new file mode 100644 index 0000000000000..9dbf7a38371b6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/three_simple_products_with_tier_price_rollback.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +foreach (['simple_1', 'simple_2', 'simple_3'] as $sku) { + try { + $product = $productRepository->get($sku, false, null, true); + $productRepository->delete($product); + } catch (NoSuchEntityException $e) { + //Product already removed + } +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php index dd36f90757398..4d844a7c6f229 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php @@ -108,6 +108,64 @@ public function testExport(): void $this->assertEquals(1, $occurrencesCount); } + /** + * Verify successful export of the product with custom attributes containing json and markup + * + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDbIsolation enabled + * @dataProvider exportWithJsonAndMarkupTextAttributeDataProvider + * @param string $attributeData + * @param string $expectedResult + * @return void + */ + public function testExportWithJsonAndMarkupTextAttribute(string $attributeData, string $expectedResult): void + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); + $product = $productRepository->get('simple2'); + + /** @var \Magento\Eav\Model\Config $eavConfig */ + $eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class); + $eavConfig->clear(); + $attribute = $eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'text_attribute'); + $attribute->setDefaultValue($attributeData); + /** @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface $productAttributeRepository */ + $productAttributeRepository = $objectManager->get(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class); + $productAttributeRepository->save($attribute); + $product->setCustomAttribute('text_attribute', $attribute->getDefaultValue()); + $productRepository->save($product); + + $this->model->setWriter( + $this->objectManager->create( + \Magento\ImportExport\Model\Export\Adapter\Csv::class + ) + ); + $exportData = $this->model->export(); + $this->assertStringContainsString('Simple Product2', $exportData); + $this->assertStringContainsString($expectedResult, $exportData); + } + + /** + * @return array + */ + public function exportWithJsonAndMarkupTextAttributeDataProvider(): array + { + return [ + 'json' => [ + '{"type": "basic", "unit": "inch", "sign": "(\")", "size": "1.5\""}', + '"text_attribute={""type"": ""basic"", ""unit"": ""inch"", ""sign"": ""(\"")"", ""size"": ""1.5\""""}"' + ], + 'markup' => [ + '<div data-content>Element type is basic, measured in inches ' . + '(marked with sign (\")) with size 1.5\", mid-price range</div>', + '"text_attribute=<div data-content>Element type is basic, measured in inches ' . + '(marked with sign (\"")) with size 1.5\"", mid-price range</div>"' + ], + ]; + } + /** * @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data_special_chars.php * @magentoDbIsolation enabled diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index 3ca6754c77767..53e32483ee3d6 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -2344,6 +2344,67 @@ public function testProductWithWrappedAdditionalAttributes() ); } + /** + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @dataProvider importWithJsonAndMarkupTextAttributeDataProvider + * @param string $productSku + * @param string $expectedResult + * @return void + */ + public function testImportWithJsonAndMarkupTextAttribute(string $productSku, string $expectedResult): void + { + // added by _files/product_import_with_json_and_markup_attributes.csv + $this->importedProducts = [ + 'SkuProductWithJson', + 'SkuProductWithMarkup', + ]; + + $importParameters =[ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE => 0 + ]; + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/_files/products_to_import_with_json_and_markup_attributes.csv', + 'directory' => $directory + ] + ); + $this->_model->setParameters($importParameters); + $this->_model->setSource($source); + $errors = $this->_model->validateData(); + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $product = $productRepository->get($productSku); + $this->assertEquals($expectedResult, $product->getData('text_attribute')); + } + + /** + * @return array + */ + public function importWithJsonAndMarkupTextAttributeDataProvider(): array + { + return [ + 'import of attribute with json' => [ + 'SkuProductWithJson', + '{"type": "basic", "unit": "inch", "sign": "(\")", "size": "1.5\""}' + ], + 'import of attribute with markup' => [ + 'SkuProductWithMarkup', + '<div data-content>Element type is basic, measured in inches ' . + '(marked with sign (\")) with size 1.5\", mid-price range</div>' + ], + ]; + } + /** * Import and check data from file. * @@ -3415,4 +3476,25 @@ public function importImagesDataProvider(): array ] ]; } + + /** + * Verify additional images url validation during import. + * + * @magentoDbIsolation enabled + * @return void + */ + public function testImportInvalidAdditionalImages(): void + { + $pathToFile = __DIR__ . '/_files/import_media_additional_images_with_wrong_url.csv'; + $filesystem = BootstrapHelper::getObjectManager()->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create(Csv::class, ['file' => $pathToFile, 'directory' => $directory]); + $errors = $this->_model->setSource($source)->setParameters(['behavior' => Import::BEHAVIOR_APPEND]) + ->validateData(); + $this->assertEquals($errors->getErrorsCount(), 1); + $this->assertEquals( + "Wrong URL/path used for attribute additional_images", + $errors->getErrorByRowNumber(0)[0]->getErrorMessage() + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media.csv index a3e8f8e47ab08..3478512e25028 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media.csv @@ -1,2 +1,2 @@ sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label1,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus -simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg, magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, +simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg,magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv index ed8755a73fcb1..4d2e7234c9362 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv @@ -1,2 +1,2 @@ "sku","store_view_code","additional_images","additional_image_labels" -"simple","fixturestore","magento_additional_image_one.jpg, magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two" +"simple","fixturestore","magento_additional_image_one.jpg,magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_with_wrong_url.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_with_wrong_url.csv new file mode 100644 index 0000000000000..c2b9e4f6fa936 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_with_wrong_url.csv @@ -0,0 +1,2 @@ +sku,product_type,name,price,attribute_set_code,additional_images +simple1,simple,"simple 1",25,Default,"additional_image_one.jpg,additional_image with spaces.jpg" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_existing_images.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_existing_images.csv index a3e8f8e47ab08..3478512e25028 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_existing_images.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_existing_images.csv @@ -1,2 +1,2 @@ sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label1,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus -simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg, magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, +simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg,magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_hidden_images.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_hidden_images.csv index 1c1bebee57578..f54d4b7f401d4 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_hidden_images.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_hidden_images.csv @@ -1,2 +1,2 @@ -sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label1,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus -simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/2015 7:05,10/20/2015 7:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg, magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two","magento_image.jpg,magento_thumbnail.jpg,magento_additional_image_two.jpg",,,,,,, +sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label1,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus +simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product,magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/2015 7:05,10/20/2015 7:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg,magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two","magento_image.jpg,magento_thumbnail.jpg,magento_additional_image_two.jpg",,,,,,, diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_json_and_markup_attributes.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_json_and_markup_attributes.csv new file mode 100644 index 0000000000000..e8372c19c8ff2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_json_and_markup_attributes.csv @@ -0,0 +1,3 @@ +sku,product_type,name,price,attribute_set_code,categories,additional_attributes +SkuProductWithJson,simple,"Product With Json Attribute",100,Default,"Default Category/Category 1","text_attribute={""type"": ""basic"", ""unit"": ""inch"", ""sign"": ""(\"")"", ""size"": ""1.5\""""}" +SkuProductWithMarkup,simple,"Product With Markup Attribute",100,Default,"Default Category/Category 1","text_attribute=<div data-content>Element type is basic, measured in inches (marked with sign (\"")) with size 1.5\"", mid-price range</div>" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_non_existing_image.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_non_existing_image.csv index 8122433a8c9e1..6037ee008a8ec 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_non_existing_image.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_non_existing_image.csv @@ -1,2 +1,2 @@ sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label1,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus -simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,/no/exists/image/magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg, magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, +simple_new,,Default,simple,,base,New Product,,,,1,Taxable Goods,"Catalog, Search",10,,,,new-product,New Product,New Product,New Product ,/no/exists/image/magento_image.jpg,Image Label,magento_small_image.jpg,Small Image Label,magento_thumbnail.jpg,Thumbnail Label,magento_image.jpg,Image Label,10/20/15 07:05,10/20/15 07:05,,,Block after Info Column,,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,0,1,1,0,0,0,1,,,,"magento_additional_image_one.jpg,magento_additional_image_two.jpg","Additional Image Label One,Additional Image Label Two",,,,,,,, diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php new file mode 100644 index 0000000000000..2c31c9a8d688a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** + * Creates simple Catalog Rule with the following data: + * active, applied to all products, without time limits, with 25% off for all customer groups + */ +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\Rule; +use Magento\Customer\Model\GroupManagement; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var $banner Rule */ +$catalogRule = Bootstrap::getObjectManager()->create( + Rule::class +); + +$catalogRule + ->setIsActive(1) + ->setName('Test Catalog Rule With 25 Percent Off') + ->setCustomerGroupIds('0') + ->setDiscountAmount(25) + ->setWebsiteIds([0 => 1]) + ->setSimpleAction('by_percent') + ->setStopRulesProcessing(false) + ->setSortOrder(0) + ->setSubIsEnable(0) + ->setSubDiscountAmount(0) + ->save(); + +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = Bootstrap::getObjectManager() + ->get(IndexBuilder::class); +$indexBuilder->reindexFull(); +sleep(1); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all_rollback.php new file mode 100644 index 0000000000000..73e6bbff46648 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_25_customer_group_all_rollback.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\ResourceModel\Rule; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Rule $catalogRuleResource */ +$catalogRuleResource = $objectManager->create(Rule::class); +$connection = $catalogRuleResource->getConnection(); + +//Retrieve rule id by name +$select = $connection->select(); +$select->from($catalogRuleResource->getMainTable(), 'rule_id'); +$select->where('name = ?', 'Test Catalog Rule With 25 Percent Off'); +$ruleId = $connection->fetchOne($select); + +try { + /** @var CatalogRuleRepositoryInterface $ruleRepository */ + $ruleRepository = $objectManager->create(CatalogRuleRepositoryInterface::class); + $ruleRepository->deleteById($ruleId); +} catch (\Exception $ex) { + //Nothing to remove +} +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); +$indexBuilder->reindexFull(); +sleep(1); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group.php new file mode 100644 index 0000000000000..d583dace85536 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** + * Creates simple Catalog Rule with the following data: + * active, applied to all products, without time limits, with 50% off for registered customer groups + */ +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\Rule; +use Magento\Customer\Model\GroupManagement; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var $banner Rule */ +$catalogRule = Bootstrap::getObjectManager()->create( + Rule::class +); + +$catalogRule + ->setIsActive(1) + ->setName('Test Catalog Rule With 50 Percent Off') + ->setCustomerGroupIds('1') + ->setDiscountAmount(50) + ->setWebsiteIds([0 => 1]) + ->setSimpleAction('by_percent') + ->setStopRulesProcessing(false) + ->setSortOrder(0) + ->setSubIsEnable(0) + ->setSubDiscountAmount(0) + ->save(); + +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = Bootstrap::getObjectManager() + ->get(IndexBuilder::class); +$indexBuilder->reindexFull(); +sleep(1); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group_rollback.php new file mode 100644 index 0000000000000..46df301157b5c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/catalog_rule_50_registered_customer_group_rollback.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\ResourceModel\Rule; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Rule $catalogRuleResource */ +$catalogRuleResource = $objectManager->create(Rule::class); +$connection = $catalogRuleResource->getConnection(); + +//Retrieve rule id by name +$select = $connection->select(); +$select->from($catalogRuleResource->getMainTable(), 'rule_id'); +$select->where('name = ?', 'Test Catalog Rule With 50 Percent Off'); +$ruleId = $connection->fetchOne($select); + +try { + /** @var CatalogRuleRepositoryInterface $ruleRepository */ + $ruleRepository = $objectManager->create(CatalogRuleRepositoryInterface::class); + $ruleRepository->deleteById($ruleId); +} catch (\Exception $ex) { + //Nothing to remove +} +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); +$indexBuilder->reindexFull(); +sleep(1); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/PluginListGeneratorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/PluginListGeneratorTest.php index 1046c678e253a..bda4cdd6cbaa5 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/PluginListGeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/PluginListGeneratorTest.php @@ -23,7 +23,14 @@ class PluginListGeneratorTest extends TestCase /** * Generated plugin list config for frontend scope */ - const CACHE_ID = 'primary|global|frontend|plugin-list'; + const CACHE_ID_FRONTEND = 'primary|global|frontend|plugin-list'; + + /** + * Generated plugin list config for dummy scope + */ + const CACHE_ID_DUMMY = 'primary|global|dummy|plugin-list'; + + private $cacheIds = [self::CACHE_ID_FRONTEND, self::CACHE_ID_DUMMY]; /** * @var PluginListGenerator @@ -90,31 +97,51 @@ protected function setUp(): void */ public function testPluginListConfigGeneration() { - $scopes = ['frontend']; + $scopes = ['global', 'frontend', 'dummy']; + $globalPlugin = 'genericHeaderPlugin'; + $frontendPlugin = 'response-http-page-cache'; $this->model->write($scopes); - $configData = $this->model->load(self::CACHE_ID); - $this->assertNotEmpty($configData[0]); - $this->assertNotEmpty($configData[1]); - $this->assertNotEmpty($configData[2]); - $expected = [ + $configDataFrontend = $this->model->load(self::CACHE_ID_FRONTEND); + $this->assertNotEmpty($configDataFrontend[0]); + $this->assertNotEmpty($configDataFrontend[1]); + $this->assertNotEmpty($configDataFrontend[2]); + $expectedFrontend = [ 1 => [ - 0 => 'genericHeaderPlugin', - 1 => 'response-http-page-cache' + 0 => $globalPlugin, + 1 => $frontendPlugin ] ]; // Here in test is assumed that this class below has 3 plugins. But the amount of plugins and class itself // may vary. If it is changed, please update these assertions. $this->assertArrayHasKey( 'Magento\\Framework\\App\\Response\\Http_sendResponse___self', - $configData[2], + $configDataFrontend[2], 'Processed plugin does not exist in the processed plugins array.' ); $this->assertSame( - $expected, - $configData[2]['Magento\\Framework\\App\\Response\\Http_sendResponse___self'], + $expectedFrontend, + $configDataFrontend[2]['Magento\\Framework\\App\\Response\\Http_sendResponse___self'], 'Plugin configurations are not equal' ); + + $configDataDummy = $this->model->load(self::CACHE_ID_DUMMY); + /** + * Make sure "dummy" scope with no plugins in system should not contain plugins from "frontend" scope + */ + $this->assertNotContains( + $frontendPlugin, + $configDataDummy[2]['Magento\\Framework\\App\\Response\\Http_sendResponse___self'][1], + 'Plugin configurations are not equal. "dummy" scope should not contain plugins from "frontend" scope' + ); + /** + * Make sure "dummy" scope with no plugins in system should contain plugins from "global" scope + */ + $this->assertContains( + $globalPlugin, + $configDataDummy[2]['Magento\\Framework\\App\\Response\\Http_sendResponse___self'][1], + 'Plugin configurations are not equal. "dummy" scope should contain plugins from "global" scope' + ); } /** @@ -137,11 +164,13 @@ private function getCustomDirs(): array */ protected function tearDown(): void { - $filePath = $this->directoryList->getPath(DirectoryList::GENERATED_METADATA) - . '/' . self::CACHE_ID . '.' . 'php'; + foreach ($this->cacheIds as $cacheId) { + $filePath = $this->directoryList->getPath(DirectoryList::GENERATED_METADATA) + . '/' . $cacheId . '.' . 'php'; - if (file_exists($filePath)) { - $this->file->deleteFile($filePath); + if (file_exists($filePath)) { + $this->file->deleteFile($filePath); + } } } } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Hostedpro/ReturnActionTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Hostedpro/ReturnActionTest.php new file mode 100644 index 0000000000000..b3870c69b23f0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Hostedpro/ReturnActionTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Controller\Hostedpro; + +use Magento\TestFramework\TestCase\AbstractController; +use Laminas\Stdlib\Parameters; + +/** + * Tests PayPal HostedPro return controller. + */ +class ReturnActionTest extends AbstractController +{ + /** + * Tests customer redirect on success page after return from PayPal HostedPro payment. + * + * @SuppressWarnings(PHPMD.Superglobals) + */ + public function testReturnRedirect() + { + $redirectUri = 'paypal/hostedpro/return'; + $this->setRequestUri($redirectUri); + $this->getRequest()->setMethod('POST'); + + $this->dispatch($redirectUri); + $this->assertRedirect($this->stringContains('checkout/onepage/success')); + + $this->assertEmpty( + $_SESSION, + 'Session start has to be skipped for current controller' + ); + } + + /** + * Sets REQUEST_URI into request object. + * + * @param string $requestUri + * @return void + */ + private function setRequestUri(string $requestUri) + { + $request = $this->getRequest(); + $reflection = new \ReflectionClass($request); + $property = $reflection->getProperty('requestUri'); + $property->setAccessible(true); + $property->setValue($request, null); + + $request->setServer(new Parameters(['REQUEST_URI' => $requestUri])); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Review/Block/ViewTest.php b/dev/tests/integration/testsuite/Magento/Review/Block/ViewTest.php new file mode 100644 index 0000000000000..74bb31d7cb48d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Review/Block/ViewTest.php @@ -0,0 +1,143 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Review\Block; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Customer\Model\Session; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\Framework\View\LayoutInterface; +use Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\Xpath; +use PHPUnit\Framework\TestCase; + +/** + * Test for displaying product review block. + * + * @magentoAppArea frontend + * @magentoDbIsolation enabled + */ +class ViewTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var Session */ + private $customerSession; + + /** @var CollectionFactory */ + private $collectionFactory; + + /** @var Registry */ + private $registry; + + /** @var View */ + private $block; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->customerSession = $this->objectManager->get(Session::class); + $this->collectionFactory = $this->objectManager->get(CollectionFactory::class); + $this->registry = $this->objectManager->get(Registry::class); + $this->block = $this->objectManager->get(LayoutInterface::class)->createBlock(View::class); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $this->registry->unregister('current_review'); + $this->registry->unregister('current_product'); + $this->registry->unregister('product'); + $this->customerSession->setCustomerId(null); + + parent::tearDown(); + } + + /** + * Test product review block + * + * @magentoDataFixture Magento/Review/_files/product_review_with_rating.php + * + * @return void + * @throws NoSuchEntityException + */ + public function testProductReviewBlock(): void + { + $this->customerSession->setCustomerId(1); + $review = $this->collectionFactory->create()->addCustomerFilter(1)->getFirstItem(); + $this->registerReview($review); + $this->assertNotNull($review->getReviewId()); + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + /** @var ProductInterface $product */ + $product = $productRepository->get('simple', false, null, true); + $this->registerProduct($product); + + $blockHtml = $this->block->setReviewId($review->getReviewId())->toHtml(); + $this->assertEquals( + 1, + Xpath::getElementsCountForXpath( + sprintf("//div[contains(@class, 'details')]/h3[contains(text(), '%s')]", $review->getName()), + $blockHtml + ), + 'Product name wasn\'t found.' + ); + $ratings = $this->block->getRating(); + $this->assertCount(2, $ratings); + $this->assertEquals( + 1, + Xpath::getElementsCountForXpath( + sprintf( + "//a[contains(@class, 'action back')]/span[contains(text(), '%s')]", + __('Back to Product Reviews') + ), + $blockHtml + ), + sprintf('%s button wasn\'t found.', __('Back to Product Reviews')) + ); + } + + /** + * Register the product + * + * @param ProductInterface $product + * @return void + */ + private function registerProduct(ProductInterface $product): void + { + $this->registry->unregister('current_product'); + $this->registry->unregister('product'); + $this->registry->register('current_product', $product); + $this->registry->register('product', $product); + } + + /** + * Register the current review + * + * @param Product $review + * @return void + */ + private function registerReview(Product $review): void + { + $this->registry->unregister('current_review'); + $this->registry->register('current_review', $review); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating.php b/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating.php new file mode 100644 index 0000000000000..47a402ae44fc4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Model\CustomerRegistry; +use Magento\Framework\Registry; +use Magento\Review\Model\Rating; +use Magento\Review\Model\Rating\Option; +use Magento\Review\Model\ResourceModel\Review\Collection; +use Magento\Review\Model\Review; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Bootstrap::getInstance()->loadArea( + FrontNameResolver::AREA_CODE +); +Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var CustomerRegistry $customerRegistry */ +$customerRegistry = $objectManager->create(CustomerRegistry::class); +$customer = $customerRegistry->retrieve(1); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$product = $productRepository->get('simple'); +$storeId = $objectManager->get( + StoreManagerInterface::class +)->getStore()->getId(); + +$review = $objectManager->create( + Review::class, + ['data' => [ + 'customer_id' => $customer->getId(), + 'title' => 'Review Summary', + 'detail' => 'Review text', + 'nickname' => 'Nickname', + ]] +); + +$review + ->setEntityId($review->getEntityIdByCode(Review::ENTITY_PRODUCT_CODE)) + ->setEntityPkValue($product->getId()) + ->setStatusId(Review::STATUS_APPROVED) + ->setStoreId($storeId) + ->setStores([$storeId]) + ->save(); + +$objectManager->get(Registry::class)->register( + 'review_data', + $review +); + +/** @var Collection $ratingCollection */ +$ratingCollection = $objectManager->create( + Rating::class +)->getCollection() + ->setPageSize(2) + ->setCurPage(1); + +foreach ($ratingCollection as $rating) { + $rating->setStores([$storeId])->setIsActive(1)->save(); +} + +foreach ($ratingCollection as $rating) { + $ratingOption = $objectManager + ->create(Option::class) + ->getCollection() + ->setPageSize(1) + ->setCurPage(2) + ->addRatingFilter($rating->getId()) + ->getFirstItem(); + $rating->setReviewId($review->getId()) + ->addOptionVote($ratingOption->getId(), $product->getId()); +} + +$objectManager->get(Registry::class)->register( + 'rating_data', + $ratingCollection->getFirstItem() +); diff --git a/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating_rollback.php b/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating_rollback.php new file mode 100644 index 0000000000000..0931d881a6fdc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Review/_files/product_review_with_rating_rollback.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/LogoTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/LogoTest.php new file mode 100644 index 0000000000000..aadd3ab7b956e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/LogoTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Sales\Block\Order\PrintOrder; + +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\App\State; +use Magento\Theme\Block\Html\Header\Logo; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\ObjectManagerInterface; +use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver as LogoPathResolverDefault; +use Magento\Sales\ViewModel\Header\LogoPathResolver as LogoPathResolverSales; +use \PHPUnit\Framework\TestCase; + +class LogoTest extends TestCase +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var WriteInterface + */ + private $mediaDirectory; + + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $filesystem = $this->objectManager->get(Filesystem::class); + $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->objectManager->get(State::class) + ->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND); + Bootstrap::getInstance() + ->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND); + } + + /** + * @magentoConfigFixture default_store design/header/logo_src default/logo.jpg + * @magentoConfigFixture default_store sales/identity/logo_html default/logo_sales.jpg + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function testGetLogoSrc(): void + { + $host = 'http://localhost/media/'; + $defaultLogoFile= 'logo.jpg'; + $defaultPath = 'logo/default/' . $defaultLogoFile; + $salesLogoFile = 'logo_sales.jpg'; + $salesPath = 'sales/store/logo_html/default/' . $salesLogoFile; + $this->mediaDirectory->writeFile($defaultPath, ''); + $this->mediaDirectory->writeFile($salesPath, ''); + $blockArguments = ['data' => + ['logoPathResolver' => $this->objectManager->get(LogoPathResolverDefault::class)] + ]; + /** @var Logo $block */ + $block = $this->objectManager->create(LayoutInterface::class) + ->createBlock(Logo::class, 'logo', $blockArguments); + $this->assertSame($host . $defaultPath, $block->getLogoSrc()); + $blockArguments = ['data' => + ['logoPathResolver' => $this->objectManager->get(LogoPathResolverSales::class)] + ]; + /** @var Logo $block */ + $block = $this->objectManager->create(LayoutInterface::class) + ->createBlock(Logo::class, 'logo', $blockArguments); + $this->assertSame($host . $salesPath, $block->getLogoSrc()); + $this->mediaDirectory->delete($defaultPath); + $this->mediaDirectory->delete($salesPath); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php index d07ec84b6eddc..b1c7843dfad32 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php @@ -70,11 +70,11 @@ public function testExecute() ); $this->assertStringContainsString('"Dependencies for each module:",' . PHP_EOL, $fileContents); $this->assertStringContainsString( - '"Magento\A",1' . PHP_EOL . '" -- Magento\Framework",2' . PHP_EOL, + 'Magento\A,1' . PHP_EOL . '" -- Magento\Framework",2' . PHP_EOL, $fileContents ); $this->assertStringContainsString( - '"Magento\B",1' . PHP_EOL . '" -- Magento\Framework",2' . PHP_EOL, + 'Magento\B,1' . PHP_EOL . '" -- Magento\Framework",2' . PHP_EOL, $fileContents ); } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/expected/framework-dependencies.csv b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/expected/framework-dependencies.csv index e1c5732b94dcb..9f358f3fa7a25 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/expected/framework-dependencies.csv +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/expected/framework-dependencies.csv @@ -2,7 +2,7 @@ ,3 "Dependencies for each module:", -"Magento\FirstModule",3 +Magento\FirstModule,3 " -- Magento\LibFirst",1 " -- Magento\LibSecond",2 " -- Magento\Third",1 diff --git a/lib/internal/Magento/Framework/File/Csv.php b/lib/internal/Magento/Framework/File/Csv.php index 1b1decdb5327c..e33b38562bf57 100644 --- a/lib/internal/Magento/Framework/File/Csv.php +++ b/lib/internal/Magento/Framework/File/Csv.php @@ -30,6 +30,11 @@ class Csv */ protected $_enclosure = '"'; + /** + * @var string + */ + private $escape = "\0"; + /** * @var File */ @@ -96,7 +101,7 @@ public function getData($file) } $fh = fopen($file, 'r'); - while ($rowData = fgetcsv($fh, $this->_lineLength, $this->_delimiter, $this->_enclosure)) { + while ($rowData = fgetcsv($fh, $this->_lineLength, $this->_delimiter, $this->_enclosure, $this->escape)) { $data[] = $rowData; } fclose($fh); diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index bc08f67228849..7b508942c107d 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -647,7 +647,7 @@ public function fileRead($resource, $length) * @return array|bool|null * @throws FileSystemException */ - public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\') + public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0") { $result = @fgetcsv($resource, $length, $delimiter, $enclosure, $escape); if ($result === null) { @@ -801,7 +801,10 @@ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure } } - $result = @fputcsv($resource, $data, $delimiter, $enclosure); + // Escape symbol is needed to fix known issue in PHP broken fputcsv escaping functionality + // where backslash followed by double quote breaks file consistency + $escape = "\0"; + $result = @fputcsv($resource, $data, $delimiter, $enclosure, $escape); if (!$result) { throw new FileSystemException( new Phrase( diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php b/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php index beeb1e928262c..9f69a38527ab3 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php @@ -642,7 +642,7 @@ public function fileRead($resource, $length) * @return array|bool|null * @throws FileSystemException */ - public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\') + public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0") { $result = @fgetcsv($resource, $length, $delimiter, $enclosure, $escape); if ($result === null) { diff --git a/lib/internal/Magento/Framework/Filesystem/DriverInterface.php b/lib/internal/Magento/Framework/Filesystem/DriverInterface.php index afea4d3bc7b07..706077522c675 100644 --- a/lib/internal/Magento/Framework/Filesystem/DriverInterface.php +++ b/lib/internal/Magento/Framework/Filesystem/DriverInterface.php @@ -276,7 +276,7 @@ public function fileRead($resource, $length); * @return array|bool|null * @throws FileSystemException */ - public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\'); + public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0"); /** * Returns position of read/write pointer diff --git a/lib/internal/Magento/Framework/Filesystem/File/Read.php b/lib/internal/Magento/Framework/Filesystem/File/Read.php index f48e50b7d693d..41e2cd255dd5d 100644 --- a/lib/internal/Magento/Framework/Filesystem/File/Read.php +++ b/lib/internal/Magento/Framework/Filesystem/File/Read.php @@ -124,7 +124,7 @@ public function readLine($length, $ending = null) * @param string $escape [optional] * @return array|bool|null */ - public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\') + public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0") { return $this->driver->fileGetCsv($this->resource, $length, $delimiter, $enclosure, $escape); } diff --git a/lib/internal/Magento/Framework/Filesystem/File/ReadInterface.php b/lib/internal/Magento/Framework/Filesystem/File/ReadInterface.php index e27086709d8b1..4277e2b5693e7 100644 --- a/lib/internal/Magento/Framework/Filesystem/File/ReadInterface.php +++ b/lib/internal/Magento/Framework/Filesystem/File/ReadInterface.php @@ -46,7 +46,7 @@ public function readLine($length, $ending = null); * @param string $escape [optional] * @return array|bool false on end of file */ - public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\'); + public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0"); /** * Returns the current position diff --git a/lib/internal/Magento/Framework/Interception/PluginListGenerator.php b/lib/internal/Magento/Framework/Interception/PluginListGenerator.php index effc291bb883b..8f3a03dd4fc20 100644 --- a/lib/internal/Magento/Framework/Interception/PluginListGenerator.php +++ b/lib/internal/Magento/Framework/Interception/PluginListGenerator.php @@ -227,8 +227,6 @@ public function loadScopedVirtualTypes($scopePriorityScheme, $loadedScopes, $plu $data = $this->reader->read($scopeCode) ?: []; unset($data['preferences']); if (count($data) > 0) { - $inherited = []; - $processed = []; $pluginData = $this->merge($data, $pluginData); foreach ($data as $class => $config) { if (isset($config['type'])) { @@ -236,6 +234,8 @@ public function loadScopedVirtualTypes($scopePriorityScheme, $loadedScopes, $plu } } } + $inherited = []; + $processed = []; $loadedScopes[$scopeCode] = true; } if ($this->isCurrentScope($scopeCode)) { diff --git a/pub/media/customer_address/.htaccess b/pub/media/customer_address/.htaccess new file mode 100644 index 0000000000000..b97408bad3f2e --- /dev/null +++ b/pub/media/customer_address/.htaccess @@ -0,0 +1,7 @@ +<IfVersion < 2.4> + order allow,deny + deny from all +</IfVersion> +<IfVersion >= 2.4> + Require all denied +</IfVersion> From 8b4e8b5c81a0faa6435290ce1607cf707cd1977a Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Wed, 6 Jan 2021 10:27:22 +0200 Subject: [PATCH 50/73] Test refactoring --- ...IdAtAccountCreateWithMultishipmentTest.xml | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) rename app/code/Magento/{Multishipping => Customer}/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml (81%) diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml similarity index 81% rename from app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml rename to app/code/Magento/Customer/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml index efaf4d7dc639d..b04ac0f4727d0 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml @@ -20,18 +20,23 @@ </annotations> <before> <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 1" stepKey="showVatNumberOnStorefrontYes"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> - <argument name="tags" value="config"/> - </actionGroup> - <createData stepKey="category" entity="SimpleSubCategory"/> - <createData stepKey="product1" entity="SimpleProduct"> + <createData entity="SimpleSubCategory" stepKey="category"/> + <createData entity="SimpleProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> </before> + <after> + <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> + <argument name="tags" value="config"/> + </actionGroup> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <deleteData createDataKey="product" stepKey="deleteproduct"/> + </after> <!-- Add product to the cart --> - <amOnPage url="$$product1.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$product.name$$.html" stepKey="goToProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> - <argument name="productName" value="$$product1.name$$"/> + <argument name="productName" value="$$product.name$$"/> </actionGroup> <!-- Check Out with Multiple Addresses --> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> @@ -43,13 +48,5 @@ <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> <!--Check the VAT Number field--> <seeElement selector="{{StorefrontCustomerAddressSection.vatId}}" stepKey="assertVatIdField"/> - <after> - <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> - <argument name="tags" value="config"/> - </actionGroup> - <deleteData stepKey="deleteCategory" createDataKey="category"/> - <deleteData stepKey="deleteProduct1" createDataKey="product1"/> - </after> </test> </tests> From 1f9802ddb6bf67cc9d70d9e468787f1c1e1e27f2 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Wed, 6 Jan 2021 14:37:12 +0200 Subject: [PATCH 51/73] Test refactoring --- .../StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/{Customer => Multishipping}/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml (100%) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml similarity index 100% rename from app/code/Magento/Customer/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml rename to app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml From 5d84e2a8e9ebe9e39b3a7f0a88f583758ff1ce30 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 10 Jan 2021 12:29:50 +0200 Subject: [PATCH 52/73] Added AdminGoToOrderStatusPageActionGroup --- .../Test/Unit/Model/Product/TypeTest.php | 8 ++- .../Model/Product/Type/AbstractType.php | 7 ++- .../Magento/Sales/Model/RtlTextHandler.php | 2 +- .../AdminGoToOrderStatusPageActionGroup.xml | 19 +++++++ ...inCreateOrderStatusDuplicatingCodeTest.xml | 2 +- ...nCreateOrderStatusDuplicatingLabelTest.xml | 2 +- .../Mftf/Test/AdminCreateOrderStatusTest.xml | 2 +- .../AdminUnassignCustomOrderStatusTest.xml | 2 +- ...mOrderStatusNotVisibleOnStorefrontTest.xml | 8 +-- .../Test/Unit/Model/RtlTextHandlerTest.php | 1 + .../Ui/Component/Listing/Column/PriceTest.php | 52 +++++++++++++++++-- .../Ui/Component/Listing/Column/Price.php | 5 +- 12 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php index b7041051591d8..9c4d4ce00b7c0 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php @@ -11,7 +11,6 @@ use Magento\Bundle\Model\Product\Type; use Magento\Bundle\Model\ResourceModel\BundleFactory; use Magento\Bundle\Model\ResourceModel\Option\Collection; -use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor; use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionCollection; use Magento\Bundle\Model\ResourceModel\Selection\CollectionFactory; use Magento\Bundle\Model\Selection; @@ -28,6 +27,7 @@ use Magento\CatalogInventory\Api\StockStateInterface; use Magento\CatalogInventory\Model\StockRegistry; use Magento\CatalogInventory\Model\StockState; +use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor; use Magento\Framework\DataObject; use Magento\Framework\EntityManager\EntityMetadataInterface; use Magento\Framework\EntityManager\MetadataPool; @@ -1548,6 +1548,10 @@ public function testPrepareForCartAdvancedSpecifyProductOptions() ->disableOriginalConstructor() ->getMock(); + $buyRequest->method('getOptions') + ->willReturn([333 => ['type' => 'image/jpeg']]); + $option->method('getId') + ->willReturn(333); $this->parentClass($group, $option, $buyRequest, $product); $product->expects($this->any()) @@ -1556,6 +1560,8 @@ public function testPrepareForCartAdvancedSpecifyProductOptions() $buyRequest->expects($this->once()) ->method('getBundleOption') ->willReturn([0, '', 'str']); + $group->expects($this->once()) + ->method('validateUserValue'); $result = $this->model->prepareForCartAdvanced($buyRequest, $product); $this->assertEquals('Please specify product option(s).', $result); diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index f90b097415661..19f6461d44b6a 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -3,7 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -declare(strict_types=1); namespace Magento\Catalog\Model\Product\Type; @@ -605,7 +604,11 @@ protected function _prepareOptions(\Magento\Framework\DataObject $buyRequest, $p if ($product->getSkipCheckRequiredOption() !== true) { $group->validateUserValue($optionsFromRequest); } elseif ($optionsFromRequest !== null && isset($optionsFromRequest[$option->getId()])) { - $transport->options[$option->getId()] = $optionsFromRequest[$option->getId()]; + if (is_array($optionsFromRequest[$option->getId()])) { + $group->validateUserValue($optionsFromRequest); + } else { + $transport->options[$option->getId()] = $optionsFromRequest[$option->getId()]; + } } } catch (LocalizedException $e) { diff --git a/app/code/Magento/Sales/Model/RtlTextHandler.php b/app/code/Magento/Sales/Model/RtlTextHandler.php index cfb88dc63f58b..b943320e0f897 100644 --- a/app/code/Magento/Sales/Model/RtlTextHandler.php +++ b/app/code/Magento/Sales/Model/RtlTextHandler.php @@ -48,7 +48,7 @@ public function reverseRtlText(string $string): string for ($i = 0; $i < $splitTextAmount; $i++) { if ($this->isRtlText($splitText[$i])) { - for ($j = $i + 1; $j < $splitTextAmount; $j++) { + for ($j = $i; $j < $splitTextAmount; $j++) { $tmp = $this->isRtlText($splitText[$j]) ? $this->stringUtils->strrev($splitText[$j]) : $splitText[$j]; $splitText[$j] = $this->isRtlText($splitText[$i]) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml new file mode 100644 index 0000000000000..a47d9858652e9 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml @@ -0,0 +1,19 @@ +<?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="AdminGoToOrderStatusPageActionGroup"> + <annotations> + <description>Goes to Stores->Order Status->Order Status Page.</description> + </annotations> + + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml index 23dca916781f1..5c61a8b089b97 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index d3cd3e8b8549c..5fdc6c844f45e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index a30040045a4ca..e424fa78362fc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index 226524341efdd..0a533e7c9c767 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -25,7 +25,7 @@ </after> <!--Go to new order status page--> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!--Fill the form and validate save success message--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index a5d210a9765ad..d4928b8c6295f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -47,8 +47,8 @@ </after> <!-- Create order status --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <waitForPageLoad stepKey="waitForOrderStatusPageLoad"/> + <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderStatusPageLoad"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill form and validate message --> @@ -119,8 +119,8 @@ <see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> <!-- Unassign order status --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatus"/> - <waitForPageLoad stepKey="waitForStatusPageLoad"/> + <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStatusPageLoad"/> <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> <argument name="statusCode" value="{{defaultOrderStatus.status}}"/> diff --git a/app/code/Magento/Sales/Test/Unit/Model/RtlTextHandlerTest.php b/app/code/Magento/Sales/Test/Unit/Model/RtlTextHandlerTest.php index 2faeb17dc2395..1a8159dbf4cbb 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/RtlTextHandlerTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/RtlTextHandlerTest.php @@ -62,6 +62,7 @@ public function provideRtlTexts(): array ['Herr Prof. Dr. Gerald Schüler B.A.', false],//German ['نديم مقداد نعمان القحطاني', true],//Arabic ['شهاب الفرحان', true],//Arabic + ['مرحبا ماجنت اثنان', true],//Arabic ['צבר קרליבך', true],//Hebrew ['גורי מייזליש', true],//Hebrew ['اتابک بهشتی', true],//Persian diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php index 4a9061c3f3c5c..449ab230b568d 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php @@ -17,6 +17,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Contains tests for Price class + */ class PriceTest extends TestCase { /** @@ -34,6 +37,9 @@ class PriceTest extends TestCase */ private $storeManagerMock; + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -57,12 +63,20 @@ protected function setUp(): void } /** - * @param $hasCurrency - * @param $dataSource - * @param $currencyCode + * Test for prepareDataSource method + * + * @param bool $hasCurrency + * @param array $dataSource + * @param string $currencyCode + * @param int|null $expectedStoreId * @dataProvider testPrepareDataSourceDataProvider */ - public function testPrepareDataSource($hasCurrency, $dataSource, $currencyCode) + public function testPrepareDataSource( + bool $hasCurrency, + array $dataSource, + string $currencyCode, + ?int $expectedStoreId = null + ): void { $itemName = 'itemName'; $oldItemValue = 'oldItemValue'; @@ -79,6 +93,7 @@ public function testPrepareDataSource($hasCurrency, $dataSource, $currencyCode) ->willReturn($currencyCode); $this->storeManagerMock->expects($hasCurrency ? $this->never() : $this->once()) ->method('getStore') + ->with($expectedStoreId) ->willReturn($store); $store->expects($hasCurrency ? $this->never() : $this->once()) ->method('getBaseCurrency') @@ -98,7 +113,12 @@ public function testPrepareDataSource($hasCurrency, $dataSource, $currencyCode) $this->assertEquals($newItemValue, $dataSource['data']['items'][0][$itemName]); } - public function testPrepareDataSourceDataProvider() + /** + * Provider for testPrepareDataSource + * + * @return array + */ + public function testPrepareDataSourceDataProvider(): array { $dataSource1 = [ 'data' => [ @@ -119,9 +139,31 @@ public function testPrepareDataSourceDataProvider() ] ] ]; + $dataSource3 = [ + 'data' => [ + 'items' => [ + [ + 'itemName' => 'oldItemValue', + 'store_id' => '2' + ] + ] + ] + ]; + $dataSource4 = [ + 'data' => [ + 'items' => [ + [ + 'itemName' => 'oldItemValue', + 'store_id' => 'abc' + ] + ] + ] + ]; return [ [true, $dataSource1, 'US'], [false, $dataSource2, 'SAR'], + [false, $dataSource3, 'SAR', 2], + [false, $dataSource4, 'SAR'], ]; } } diff --git a/app/code/Magento/Sales/Ui/Component/Listing/Column/Price.php b/app/code/Magento/Sales/Ui/Component/Listing/Column/Price.php index 4ffb6f98447c7..cc323730f14b4 100644 --- a/app/code/Magento/Sales/Ui/Component/Listing/Column/Price.php +++ b/app/code/Magento/Sales/Ui/Component/Listing/Column/Price.php @@ -10,6 +10,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Ui\Component\Listing\Columns\Column; use Magento\Framework\Pricing\PriceCurrencyInterface; @@ -77,8 +78,10 @@ public function prepareDataSource(array $dataSource) foreach ($dataSource['data']['items'] as & $item) { $currencyCode = isset($item['base_currency_code']) ? $item['base_currency_code'] : null; if (!$currencyCode) { + $storeId = isset($item['store_id']) && (int)$item['store_id'] !== 0 ? $item['store_id'] : + $this->context->getFilterParam('store_id', Store::DEFAULT_STORE_ID); $store = $this->storeManager->getStore( - $this->context->getFilterParam('store_id', \Magento\Store\Model\Store::DEFAULT_STORE_ID) + $storeId ); $currencyCode = $store->getBaseCurrency()->getCurrencyCode(); } From 0693f46deb01d05c17c1df4e7ddb4e23e02edd7f Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 10 Jan 2021 12:40:12 +0200 Subject: [PATCH 53/73] updated with AdminClickInsertWidgetActionGroup --- .../Test/CatalogProductListCheckWidgetOrderTest.xml | 2 +- .../Test/AdminAddVariableToWYSIWYGBlockTest.xml | 6 +++--- .../Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 13 ++++++------- ...minAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 5 ++--- ...AddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml | 4 ++-- ...dgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml | 4 ++-- ...idgetToWYSIWYGWithCatalogProductLinkTypeTest.xml | 6 +++--- ...idgetToWYSIWYGWithCatalogProductListTypeTest.xml | 4 ++-- ...oWYSIWYGWithRecentlyComparedProductsTypeTest.xml | 4 ++-- ...tToWYSIWYGWithRecentlyViewedProductsTypeTest.xml | 4 ++-- .../Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 8 ++++---- .../VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml | 6 +++--- .../Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml | 7 +++---- .../Test/Mftf/Test/NewProductsListWidgetTest.xml | 2 +- .../Test/Mftf/Test/ProductsListWidgetTest.xml | 2 +- 15 files changed, 37 insertions(+), 40 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml index 1d5e369d50e1d..062c4c398e189 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml @@ -70,7 +70,7 @@ <click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" /> <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="waitForCategoryVisible" /> <click selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="selectCategory" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> <!--Save cms page and go to Storefront--> <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/> <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 963844710dd7f..71b2e7f772131 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -110,9 +110,9 @@ <waitForElementVisible selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="waitForBlockTitle" /> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForPageLoad stepKey="waitForPageLoad10" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad10"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index 9e28e81c2696d..aca38e97dbe1a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -40,9 +40,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> @@ -62,9 +62,9 @@ </actionGroup> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading2" /> - <waitForPageLoad stepKey="waitForPageLoad6" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad6"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> @@ -85,4 +85,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index a599d22eab298..bcb1cf2e2c3e5 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -48,8 +48,8 @@ <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> <wait time="3" stepKey="waitForInsertWidgetClickable"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideoutCloses" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> @@ -70,4 +70,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index 1c9d7b38a40a4..bb915ea73256d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -51,8 +51,8 @@ <scrollTo selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="scrollToBlockIdentifier" /> <click selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="selectPreCreateBlock" /> <waitForElementNotVisible selector="{{WidgetSection.SelectBlockTitle}}" stepKey="waitForSlideoutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitingForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitingForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 4f78f6bcce5e0..e58b66f1bbb8d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -49,8 +49,8 @@ <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="expandWait" /> <click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCreateCategory" /> <waitForElementNotVisible selector="{{WidgetSection.SelectCategoryTitle}}" stepKey="waitForSlideoutCloses1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses2" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses2"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 4ee5b0d263d40..6825d4b21a089 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -55,9 +55,9 @@ <waitForLoadingMaskToDisappear stepKey="waitLoadingMask" /> <click selector="{{WidgetSection.PreCreateProduct('$$createPreReqProduct.name$$')}}" stepKey="selectPreProduct" /> <waitForElementNotVisible selector="{{WidgetSection.SelectProductTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitLoadingMask1" /> - <waitForPageLoad stepKey="wait6" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitLoadingMask1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 6c36913cbb593..721b8cda325e3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -79,8 +79,8 @@ <click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam3"/> <fillField selector="{{WidgetSection.RuleParamInput('3','2')}}" userInput="1" stepKey="fillMinPrice"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForPageLoad stepKey="wait6" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 440f63403c519..2315262f69c3b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -51,8 +51,8 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Compared Products Grid Template" stepKey="selectTemplate" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 226292e6cdea4..27a8b596513a7 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -50,8 +50,8 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Viewed Products Grid Template" stepKey="selectTemplate" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index c0e6a9cbd793d..4167c81a12fb4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -90,8 +90,8 @@ <waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct2"/> <click selector="{{WidgetSection.PreCreateProduct('$$product2.name$$')}}" stepKey="selectProduct2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton"/> - <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/> <waitForPageLoad stepKey="waitForSaveComplete"/> <actionGroup ref="CompareTwoProductsOrder" stepKey="compareProductOrders1"> @@ -125,8 +125,8 @@ <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1_1"/> <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct2_2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts1"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton1"/> - <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget1"/> <waitForPageLoad stepKey="waitForSaveComplete1"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index 03e3097dbd720..c3a38470a5c8f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -73,9 +73,9 @@ <scrollTo selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="scrollToBlockIdentifier" /> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForPageLoad stepKey="waitForPageLoad5" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 0fa16d275d6f4..961c8c8cb391e 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -42,9 +42,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSaveTemplate"/> <waitForPageLoad stepKey="waitForPageLoad10" /> <click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" /> @@ -59,4 +59,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index 04218c76a4b7b..be5c58f412860 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -44,7 +44,7 @@ <waitForPageLoad stepKey="waitForWidgetOptions"/> <selectOption selector="{{WidgetSection.DisplayType}}" userInput="New products" stepKey="selectDisplayType"/> <fillField selector="{{WidgetSection.NoOfProductToDisplay}}" userInput="100" stepKey="fillNoOfProductToDisplay"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_newDefaultCmsPage.identifier}}" stepKey="fillPageUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveCmsPage"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml index 593b0df3f3a02..660176896950f 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml @@ -51,7 +51,7 @@ <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}" stepKey="clickCategoryToEditInitial"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyRuleParameter"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn"/> <click selector="{{CmsNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/> <waitForPageLoad stepKey="waitForCmsList2"/> From b628917ef6386078b2c71e6ab61672433e26fc8f Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 10 Jan 2021 16:24:18 +0200 Subject: [PATCH 54/73] corrected typo --- .../Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml | 2 +- .../Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml | 2 +- .../Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml | 2 +- .../AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index 5fdc6c844f45e..84bda226c9512 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index e424fa78362fc..f4ad885429189 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index 0a533e7c9c767..0224bca9d96ac 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -25,7 +25,7 @@ </after> <!--Go to new order status page--> - <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!--Fill the form and validate save success message--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index d4928b8c6295f..861a5a5bf42df 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -47,7 +47,7 @@ </after> <!-- Create order status --> - <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderStatusPageLoad"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> @@ -119,7 +119,7 @@ <see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> <!-- Unassign order status --> - <actionGroup name="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStatusPageLoad"/> <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> From 4f4b98aed68992d1c1ae3850274ebf877bd6fcb8 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 20:58:39 +0530 Subject: [PATCH 55/73] Update README.md --- app/code/Magento/WebapiAsync/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/WebapiAsync/README.md b/app/code/Magento/WebapiAsync/README.md index 36b092c938fa3..f24ec19b3eb3b 100644 --- a/app/code/Magento/WebapiAsync/README.md +++ b/app/code/Magento/WebapiAsync/README.md @@ -1,25 +1,25 @@ # Magento_WebapiAsync module -**Magento_WebapiAsync** module extends Webapi extension and provide functional to process asynchronous requests. +Magento_WebapiAsync module extends Webapi extension and provide functional to process asynchronous requests. -**Magento_WebapiAsync** module handles asynchronous requests, schedule, publish and consume bulk operations from a queue. +Magento_WebapiAsync module handles asynchronous requests, schedule, publish and consume bulk operations from a queue. ## Installation details -Before installing this module, note that the **Magento_WebapiAsync** is dependent on the following modules: +Before installing this module, note that the Magento_WebapiAsync is dependent on the following modules: - Magento_AsynchronousOperations - Magento_Customer - Magento_User - Magento_Webapi -Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure `Code/` - the directory that contains Remote service reader configuration files. -For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility From 54d95d0dd537d03777677d608b46d0f44a99d606 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 20:59:15 +0530 Subject: [PATCH 56/73] Update README.md --- app/code/Magento/WebapiSecurity/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/WebapiSecurity/README.md b/app/code/Magento/WebapiSecurity/README.md index 954ec10d3dc60..61bf8fd1cd1e3 100644 --- a/app/code/Magento/WebapiSecurity/README.md +++ b/app/code/Magento/WebapiSecurity/README.md @@ -1,6 +1,6 @@ # Magento_WebapiSecurity module -The **Magento_WebapiSecurity** module enables access management of some Web API resources. +The Magento_WebapiSecurity module enables access management of some Web API resources. If checkbox enabled in backend through: `Stores -> Configuration -> Services -> Magento Web API -> Web Api Security` then the security of all the services outlined in `app/code/Magento/WebapiSecurity/etc/di.xml` would be loosened. You may modify this list to customize which services should follow this behavior. @@ -8,8 +8,8 @@ By loosening the security, these services would allow access anonymously (by any ## Installation details -Before installing this module, note that the **Magento_WebapiSecurity** is dependent on the following modules: +Before installing this module, note that the Magento_WebapiSecurity is dependent on the following modules: - `Magento_Webapi` -Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). From 447f3c6cae9e9d1b4b97b5850d138bf6e0b02723 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:00:38 +0530 Subject: [PATCH 57/73] Update README.md --- app/code/Magento/Weee/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index 0e846694523a9..516f442d23315 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -1,12 +1,12 @@ # Magento_Weee module -The **Magento_Weee** module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. +The Magento_Weee module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. -This module extends the existing functionality of **Magento_Tax**. +This module extends the existing functionality of Magento_Tax. -The **Magento_Weee** module includes the following: +The Magento_Weee module includes the following: - Ability to add different number of fixed product taxes to product. They are treated as a product attribute. - Configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed. @@ -14,9 +14,9 @@ The **Magento_Weee** module includes the following: ## Installation details -The **Magento_Weee** module can be installed automatically (using native Magento install mechanism) without any additional actions. +The Magento_Weee module can be installed automatically (using native Magento install mechanism) without any additional actions. -Before installing this module, note that the **Magento_Weee** is dependent on the following modules: +Before installing this module, note that the Magento_Weee is dependent on the following modules: - Magento_Catalog - Magento_Checkout @@ -26,19 +26,19 @@ Before installing this module, note that the **Magento_Weee** is dependent on th - Magento_Store - Magento_Tax -Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure `Pricing/` - directory that contain tax adjustment. -For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility -Extension developers can interact with the **Magento_Weee** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Weee module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Weee** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Weee module. ### Layouts @@ -84,7 +84,7 @@ This module introduces the following layouts and layout handles in the directori - `sales_order_printinvoice` - `sales_order_view` -For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -96,4 +96,4 @@ You can extend a customer form and widgets using the configuration files located - `widget_recently_compared` - `widget_recently_viewed` -For information about a UI component in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +For information about a UI component, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). From f5fde08d6962184cea558ce97f06dacb767aebf5 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:01:28 +0530 Subject: [PATCH 58/73] Update README.md --- app/code/Magento/WeeeGraphQl/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/WeeeGraphQl/README.md b/app/code/Magento/WeeeGraphQl/README.md index 81ee1236f00a2..b1f44619785c4 100644 --- a/app/code/Magento/WeeeGraphQl/README.md +++ b/app/code/Magento/WeeeGraphQl/README.md @@ -1,22 +1,22 @@ # Magento_WeeeGraphQl module -The **Magento_WeeeGraphQl** module provides type information for the GraphQl module to generate wee tax fields for the catalog and product information endpoints. +The Magento_WeeeGraphQl module provides type information for the GraphQl module to generate wee tax fields for the catalog and product information endpoints. -The **Magento_WeeeGraphQl** module extends **Magento_GraphQl** and **Magento_Weee** modules. This module provides type and resolver information for GraphQL API. +The Magento_WeeeGraphQl module extends Magento_GraphQl and Magento_Weee modules. This module provides type and resolver information for GraphQL API. ## Installation details -Before installing this module, note that the **Magento_WeeeGraphQl** is dependent on the following modules: +Before installing this module, note that the Magento_WeeeGraphQl is dependent on the following modules: - `Magento_CatalogGraphQl` - `Magento_Store` - `Magento_Tax` - `Magento_Weee` -For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the **Magento_WeeeGraphQl** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_WeeeGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_WeeeGraphQl** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WeeeGraphQl module. From 7728961a7d8a5dee0ce6f3567e3f6dd768ade793 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:02:27 +0530 Subject: [PATCH 59/73] Update README.md --- app/code/Magento/Widget/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Widget/README.md b/app/code/Magento/Widget/README.md index 8c06ee4c30fa9..0d51c6732ec58 100644 --- a/app/code/Magento/Widget/README.md +++ b/app/code/Magento/Widget/README.md @@ -1,28 +1,28 @@ # Magento_Widget module -The **Magento_Widget** module allows Magento application to be extended with custom widget blocks. +The Magento_Widget module allows Magento application to be extended with custom widget blocks. ## Installation details -Before installing this module, note that the **Magento_Widget** is dependent on the following modules: +Before installing this module, note that the Magento_Widget is dependent on the following modules: - Magento_Catalog - Magento_Cms - Magento_Store -Before disabling or uninstalling this module, please consider the following dependencies: +Before disabling or uninstalling this module, note the following dependencies: - Magento_CatalogWidget - Magento_CurrencySymbol - Magento_Newsletter -Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the **Magento_Widget** module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Widget module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the **Magento_Widget** module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Widget module. ### Layouts @@ -38,4 +38,4 @@ This module introduces the following layouts and layout handles in the directori - `default` - `print` -For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). From 354d3f6c07ee7f192ae14a3d40b1507045f045b6 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:03:31 +0530 Subject: [PATCH 60/73] Update README.md --- app/code/Magento/Wishlist/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Wishlist/README.md b/app/code/Magento/Wishlist/README.md index 66e0d90d5f0b2..fef81ccacf000 100644 --- a/app/code/Magento/Wishlist/README.md +++ b/app/code/Magento/Wishlist/README.md @@ -1,28 +1,28 @@ # Magento_Wishlist module -The **Magento_Wishlist** module implements the Wishlist functionality. +The Magento_Wishlist module implements the Wishlist functionality. This module allows customers to create a list of products that they can add to their shopping cart to be purchased at a later date, or share with friends. ## Installation details -Before installing this module, note that the **Magento_Wishlist** is dependent on the following modules: +Before installing this module, note that the Magento_Wishlist is dependent on the following modules: - Magento_Captcha - Magento_Catalog - Magento_Customer -Before disabling or uninstalling this module, please consider the following dependencies: +Before disabling or uninstalling this module, note the following dependencies: - Magento_WishlistAnalytics -Please find here [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure `Pricing/` - the directory that contain solutions for configurable and downloadable product price. -For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility @@ -56,7 +56,7 @@ The module dispatches the following events: - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). - `item` is an item object (`\Magento\Wishlist\Model\Item` class). -For information about the event system in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). +For information about the event, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -86,7 +86,7 @@ This module introduces the following layouts and layout handles in the directori - `wishlist_index_share` - `wishlist_shared_index.xml` -For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -97,4 +97,4 @@ You can extend a customer form and widgets using the configuration files located - `widget_recently_compared` - `widget_recently_viewed` -For information about a UI component in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +For information about a UI component, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). From 6c1e76eece3b822165a87e20bdf177c68a8f0612 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:03:59 +0530 Subject: [PATCH 61/73] Update README.md --- app/code/Magento/WishlistAnalytics/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/WishlistAnalytics/README.md b/app/code/Magento/WishlistAnalytics/README.md index 5bbd19416ac82..c932397e0803a 100644 --- a/app/code/Magento/WishlistAnalytics/README.md +++ b/app/code/Magento/WishlistAnalytics/README.md @@ -1,12 +1,12 @@ # Magento_WishlistAnalytics module -The **Magento_WishlistAnalytics** module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). +The Magento_WishlistAnalytics module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). ## Installation details -Before installing this module, note that the **Magento_WishlistAnalytics** is dependent on the following modules: +Before installing this module, note that the Magento_WishlistAnalytics is dependent on the following modules: - Magento_Analytics - Magento_Wishlist -For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). From 13f32b63cb06459f11718d734c96fc5541548e4e Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:04:49 +0530 Subject: [PATCH 62/73] Update README.md --- app/code/Magento/WishlistGraphQl/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/WishlistGraphQl/README.md b/app/code/Magento/WishlistGraphQl/README.md index 7f2ba3dfa44b4..c635417f3a6ec 100644 --- a/app/code/Magento/WishlistGraphQl/README.md +++ b/app/code/Magento/WishlistGraphQl/README.md @@ -1,12 +1,12 @@ # Magento_WishlistGraphQl module -The **Magento_WishlistGraphQl** module adds, removes, and updates products on the wishlist. +The Magento_WishlistGraphQl module adds, removes, and updates products on the wishlist. -The **Magento_WishlistGraphQl** module extends **Magento_GraphQl** and **Magento_Wishlist** modules. This module provides type and resolver information for GraphQL API. +The Magento_WishlistGraphQl module extends Magento_GraphQl and Magento_Wishlist modules. This module provides type and resolver information for GraphQL API. ## Installation details -Before installing this module, note that the **Magento_WishlistGraphQl** is dependent on the following modules: +Before installing this module, note that the Magento_WishlistGraphQl is dependent on the following modules: - Magento_Catalog - Magento_Checkout @@ -19,7 +19,7 @@ Before installing this module, note that the **Magento_WishlistGraphQl** is depe - Magento_Sales - Magento_Store -For information about enabling or disabling a module in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility @@ -29,7 +29,7 @@ Extension developers can interact with the Magento_WishlistGraphQl module. For m ## Additional information -For more information about the **Magento_WishlistGraphQl** [Queries](#queries) and [Mutations](#mutations) see below: +For more information about the Magento_WishlistGraphQl [Queries](#queries) and [Mutations](#mutations) see below: ### Queries {#queries} From 0b09f8ce5dc8bd5d381a8041b09770a0f44270aa Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:06:25 +0530 Subject: [PATCH 63/73] Update README.md --- app/code/Magento/WebapiAsync/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/WebapiAsync/README.md b/app/code/Magento/WebapiAsync/README.md index f24ec19b3eb3b..96f82d8b6e493 100644 --- a/app/code/Magento/WebapiAsync/README.md +++ b/app/code/Magento/WebapiAsync/README.md @@ -13,7 +13,7 @@ Before installing this module, note that the Magento_WebapiAsync is dependent on - Magento_User - Magento_Webapi -Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure From c95fee989c7e22e868d0d3a2b84f613881ffa975 Mon Sep 17 00:00:00 2001 From: chiranjeevi <52098385+chiranjeevi-cj@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:06:48 +0530 Subject: [PATCH 64/73] Update README.md --- app/code/Magento/WebapiSecurity/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/WebapiSecurity/README.md b/app/code/Magento/WebapiSecurity/README.md index 61bf8fd1cd1e3..a355112536a00 100644 --- a/app/code/Magento/WebapiSecurity/README.md +++ b/app/code/Magento/WebapiSecurity/README.md @@ -12,4 +12,4 @@ Before installing this module, note that the Magento_WebapiSecurity is dependent - `Magento_Webapi` -Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). From d099df94da8f8fb3626151b71b94aed26df1987d Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 12 Jan 2021 10:47:19 +0200 Subject: [PATCH 65/73] 30667 - in progress --- ...letterSubscriptionDisabledForStoreViewAtRegistrationTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml index e49948e9d2aa8..bc273d84aaf34 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml @@ -21,11 +21,9 @@ </annotations> <before> <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 0" stepKey="disableSubscriptionForStore"/> - <magentoCLI command="cache:clean config" stepKey="cleanCache"/> </before> <after> <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 1" stepKey="enableSubscriptionForStore"/> - <magentoCLI command="cache:clean config" stepKey="cleanCacheAgain"/> </after> <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> From cb793f8ac24ebabbafb104b52e8acbf8ddccd20e Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 12 Jan 2021 17:40:00 +0200 Subject: [PATCH 66/73] change the comment to prevent BIC Co-authored-by: Gabriel da Gama <gabriel@gabrielgama.com.br> --- .../Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 18f5b91348191..36b1edc304306 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -187,7 +187,7 @@ <fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="fillPhone" /> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNextBtn"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> From cbc6beaa982e9430765365d35701a956c3bb363f Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 12 Jan 2021 17:41:30 +0200 Subject: [PATCH 67/73] Refactoring for BC --- .../Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 18f5b91348191..36b1edc304306 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -187,7 +187,7 @@ <fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="fillPhone" /> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNextBtn"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> From 195b7551de937ba347345ea18524e3b9550a9cc1 Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Tue, 5 Jan 2021 16:53:22 -0600 Subject: [PATCH 68/73] MC-40296: MFTF test failing randomly AdminValidateLastReviewDateForReviewsByProductsReportTest - Skipping the risky test for random failure --- ...minValidateLastReviewDateForReviewsByProductsReportTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml index 3405314f24f78..8b75a0f608548 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml @@ -17,6 +17,9 @@ <severity value="MAJOR"/> <useCaseId value="MC-39737"/> <testCaseId value="MC-39838"/> + <skip> + <issueId value="MQE-2288" /> + </skip> </annotations> <before> <!--Step1. Login as admin--> From a24dce44ce86c4a1981de0c15235eca911c0d8f8 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Wed, 13 Jan 2021 11:50:34 +0200 Subject: [PATCH 69/73] Test case id has been updated. --- ...StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml index b04ac0f4727d0..f1c3898cb5af7 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml @@ -15,7 +15,7 @@ <title value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> <description value="'VAT Number' field should be available at create account page if 'Show VAT Number on Storefront' is Yes"/> <severity value="MAJOR"/> - <testCaseId value="MC-40016"/> + <testCaseId value="MC-40397"/> <group value="Multishipment"/> </annotations> <before> From 8ae0c79c375bcad0863e5885847222411f985c6c Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 13 Jan 2021 18:38:19 +0200 Subject: [PATCH 70/73] fixing conflicts --- ...dminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 6729f07825dce..7b89492cbb574 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -84,17 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/> -<<<<<<< HEAD - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories"/> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> ->>>>>>> 2.4-develop <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> From 9366f356a81c526ca1c144936aa7d9cb8856a2f0 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 14 Jan 2021 09:06:57 +0200 Subject: [PATCH 71/73] added missed stepKeys --- .../Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml | 2 ++ ...ductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml | 2 ++ ...leProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 2 ++ ...pleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml | 2 ++ ...impleProductWithRegularPriceInStockWithCustomOptionsTest.xml | 2 ++ .../AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml | 2 ++ 6 files changed, 12 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index c82bcc519ef80..45a5f8592b0e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -144,6 +144,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 50fe488e0c57c..3d7af3c330564 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -124,6 +124,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 7faeba9bceb4f..0e83ea4655483 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -124,6 +124,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 2ca367d72383c..1af8ff3265047 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -122,6 +122,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductRegularPrice325InStock.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 154f60151ab5f..6066a02110f13 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -142,6 +142,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductRegularPriceCustomOptions.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see customizable options are Required --> <seeElement selector="{{StorefrontProductInfoMainSection.requiredCustomSelect(simpleProductCustomizableOption.title)}}" stepKey="verifyFirstCustomOptionIsRequired"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 7b89492cbb574..881105ad2ddae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -121,6 +121,8 @@ <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> <argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> From 19068e39340d106d578849a1ed740f2dd5d9723b Mon Sep 17 00:00:00 2001 From: Vitaliy Prokopoov <v.prokopov@atwix.com> Date: Wed, 27 Jan 2021 13:28:05 +0200 Subject: [PATCH 72/73] Removed laminas/laminas-config from config.json --- composer.json | 1 - composer.lock | 767 ++------------------------------------------------ 2 files changed, 28 insertions(+), 740 deletions(-) diff --git a/composer.json b/composer.json index 6aa9355cec7b1..592e8011f87a7 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,6 @@ "guzzlehttp/guzzle": "^6.3.3", "laminas/laminas-captcha": "^2.7.1", "laminas/laminas-code": "~3.4.1", - "laminas/laminas-config": "^2.6.0", "laminas/laminas-console": "^2.6.0", "laminas/laminas-crypt": "^2.6.0", "laminas/laminas-db": "^2.8.2", diff --git a/composer.lock b/composer.lock index b0b15f4e13f6c..9d4714d839cb3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ac6fc13ba98a815bce589d300d28012c", + "content-hash": "21ff6e393caf4795598a8dc663f4fe69", "packages": [ { "name": "aws/aws-sdk-php", @@ -291,20 +291,6 @@ "ssl", "tls" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-08-23T12:54:47+00:00" }, { @@ -385,20 +371,6 @@ "dependency", "package" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-10-30T21:31:58+00:00" }, { @@ -460,20 +432,6 @@ "validation", "versioning" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-09-27T13:13:07+00:00" }, { @@ -534,20 +492,6 @@ "spdx", "validator" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-07-15T15:35:07+00:00" }, { @@ -592,20 +536,6 @@ "Xdebug", "performance" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-10-24T12:39:10+00:00" }, { @@ -1184,45 +1114,49 @@ }, { "name": "laminas/laminas-config", - "version": "2.6.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config.git", - "reference": "71ba6d5dd703196ce66b25abc4d772edb094dae1" + "reference": "0bce6f5abab41dc673196741883b19018a2b5994" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config/zipball/71ba6d5dd703196ce66b25abc4d772edb094dae1", - "reference": "71ba6d5dd703196ce66b25abc4d772edb094dae1", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/0bce6f5abab41dc673196741883b19018a2b5994", + "reference": "0bce6f5abab41dc673196741883b19018a2b5994", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "ext-json": "*", + "laminas/laminas-stdlib": "^2.7.7 || ^3.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ^8.0", + "psr/container": "^1.0" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" }, "replace": { - "zendframework/zend-config": "self.version" + "zendframework/zend-config": "^3.3.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "laminas/laminas-filter": "^2.6", - "laminas/laminas-i18n": "^2.5", - "laminas/laminas-json": "^2.6.1", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "phpunit/phpunit": "~4.0" + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-filter": "^2.7.2", + "laminas/laminas-i18n": "^2.10.3", + "laminas/laminas-servicemanager": "^3.4.1", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^8.5.8" }, "suggest": { - "laminas/laminas-filter": "Laminas\\Filter component", - "laminas/laminas-i18n": "Laminas\\I18n component", - "laminas/laminas-json": "Laminas\\Json to use the Json reader or writer classes", - "laminas/laminas-servicemanager": "Laminas\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", + "laminas/laminas-i18n": "^2.7.4; install if you want to use the Translator processor", + "laminas/laminas-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" + "dev-master": "3.4.x-dev", + "dev-develop": "3.5.x-dev" } }, "autoload": { @@ -1240,7 +1174,7 @@ "config", "laminas" ], - "time": "2019-12-31T16:30:04+00:00" + "time": "2020-08-25T11:56:37+00:00" }, { "name": "laminas/laminas-console", @@ -1692,12 +1626,6 @@ "events", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-25T11:10:44+00:00" }, { @@ -1765,12 +1693,6 @@ "feed", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-18T13:45:04+00:00" }, { @@ -1922,12 +1844,6 @@ "form", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-07-14T13:53:27+00:00" }, { @@ -1980,12 +1896,6 @@ "http client", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-18T17:11:58+00:00" }, { @@ -2121,12 +2031,6 @@ "i18n", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-24T13:14:32+00:00" }, { @@ -2432,12 +2336,6 @@ "laminas", "mail" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-12T14:51:33+00:00" }, { @@ -2610,12 +2508,6 @@ "laminas", "modulemanager" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-25T09:29:22+00:00" }, { @@ -3002,12 +2894,6 @@ "laminas", "session" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-31T15:33:31+00:00" }, { @@ -3115,12 +3001,6 @@ "laminas", "stdlib" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-25T09:08:16+00:00" }, { @@ -3218,12 +3098,6 @@ "laminas", "uri" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-31T20:20:07+00:00" }, { @@ -3442,12 +3316,6 @@ "laminas", "zf" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-09-14T14:23:00+00:00" }, { @@ -3533,12 +3401,6 @@ "sftp", "storage" ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], "time": "2020-08-23T07:39:11+00:00" }, { @@ -3674,16 +3536,6 @@ } ], "description": "Mime-type detection for Flysystem", - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], "time": "2020-10-18T11:50:25+00:00" }, { @@ -3921,16 +3773,6 @@ "logging", "psr-3" ], - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ], "time": "2020-07-23T08:35:51+00:00" }, { @@ -4402,20 +4244,6 @@ "x.509", "x509" ], - "funding": [ - { - "url": "https://github.com/terrafrost", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpseclib", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", - "type": "tidelift" - } - ], "time": "2020-09-08T04:24:43+00:00" }, { @@ -4825,16 +4653,6 @@ "parser", "validator" ], - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], "time": "2020-08-25T06:56:57+00:00" }, { @@ -4951,20 +4769,6 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T11:50:19+00:00" }, { @@ -5013,20 +4817,6 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -5093,20 +4883,6 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T11:50:19+00:00" }, { @@ -5169,20 +4945,6 @@ "interoperability", "standards" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-06T13:19:58+00:00" }, { @@ -5228,20 +4990,6 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -5286,20 +5034,6 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -5362,20 +5096,6 @@ "polyfill", "portable" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5446,20 +5166,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5527,20 +5233,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5604,20 +5296,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5677,20 +5355,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5753,20 +5417,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5833,20 +5483,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -5891,20 +5527,6 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T11:50:19+00:00" }, { @@ -5967,20 +5589,6 @@ "interoperability", "standards" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-09-07T11:33:47+00:00" }, { @@ -6175,12 +5783,6 @@ "safe writer", "webimpress" ], - "funding": [ - { - "url": "https://github.com/michalbundyra", - "type": "github" - } - ], "time": "2020-08-25T07:21:11+00:00" }, { @@ -6233,12 +5835,6 @@ "api", "graphql" ], - "funding": [ - { - "url": "https://opencollective.com/webonyx-graphql-php", - "type": "open_collective" - } - ], "time": "2020-07-02T05:49:25+00:00" }, { @@ -6755,12 +6351,6 @@ "functional testing", "unit testing" ], - "funding": [ - { - "url": "https://opencollective.com/codeception", - "type": "open_collective" - } - ], "time": "2020-11-03T17:34:51+00:00" }, { @@ -7335,20 +6925,6 @@ "redis", "xcache" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" - } - ], "time": "2020-07-07T18:54:01+00:00" }, { @@ -7472,20 +7048,6 @@ "constructor", "instantiate" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -7639,12 +7201,6 @@ } ], "description": "A tool to automatically fix PHP code style", - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], "time": "2020-10-27T22:44:27+00:00" }, { @@ -8705,12 +8261,6 @@ "object", "object graph" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], "time": "2020-06-29T13:22:24+00:00" }, { @@ -9362,12 +8912,6 @@ "phpmd", "pmd" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", - "type": "tidelift" - } - ], "time": "2020-09-23T22:06:32+00:00" }, { @@ -9423,16 +8967,6 @@ "php", "type" ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], "time": "2020-07-20T17:29:33+00:00" }, { @@ -9602,12 +9136,6 @@ "testing", "xunit" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-05-23T08:02:54+00:00" }, { @@ -9658,12 +9186,6 @@ "filesystem", "iterator" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:57:25+00:00" }, { @@ -9717,12 +9239,6 @@ "keywords": [ "process" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:58:55+00:00" }, { @@ -9772,12 +9288,6 @@ "keywords": [ "template" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T05:33:50+00:00" }, { @@ -9876,12 +9386,6 @@ "keywords": [ "tokenizer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "abandoned": true, "time": "2020-08-04T08:28:15+00:00" }, @@ -10065,12 +9569,6 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:08:54+00:00" }, { @@ -10116,12 +9614,6 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:30:19+00:00" }, { @@ -10186,12 +9678,6 @@ "compare", "equality" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T15:49:45+00:00" }, { @@ -10248,12 +9734,6 @@ "unidiff", "unified diff" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:10:38+00:00" }, { @@ -10307,12 +9787,6 @@ "environment", "hhvm" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:52:38+00:00" }, { @@ -10380,12 +9854,6 @@ "export", "exporter" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:24:23+00:00" }, { @@ -10534,12 +10002,6 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:12:34+00:00" }, { @@ -10585,12 +10047,6 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:14:26+00:00" }, { @@ -10695,12 +10151,6 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:17:30+00:00" }, { @@ -10746,12 +10196,6 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T06:45:17+00:00" }, { @@ -10798,12 +10242,6 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:18:59+00:00" }, { @@ -10847,12 +10285,6 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T06:39:44+00:00" }, { @@ -11036,20 +10468,6 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -11120,20 +10538,6 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-27T10:11:13+00:00" }, { @@ -11184,20 +10588,6 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-09-07T11:33:47+00:00" }, { @@ -11254,20 +10644,6 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -11326,20 +10702,6 @@ "mime", "mime-type" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -11391,20 +10753,6 @@ "configuration", "options" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -11456,20 +10804,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -11515,20 +10849,6 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:01:57+00:00" }, { @@ -11587,20 +10907,6 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-24T12:03:25+00:00" }, { @@ -11816,12 +11122,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], "time": "2020-07-12T23:59:07+00:00" }, { @@ -11884,16 +11184,6 @@ "env", "environment" ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], "time": "2020-07-14T17:54:18+00:00" }, { @@ -11901,12 +11191,12 @@ "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", + "url": "https://github.com/webmozarts/assert.git", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, @@ -12007,6 +11297,5 @@ "ext-zip": "*", "lib-libxml": "*" }, - "platform-dev": [], - "plugin-api-version": "1.1.0" + "platform-dev": [] } From ca650138f6c13be0b85db968db22360fb2559c17 Mon Sep 17 00:00:00 2001 From: Vitaliy Prokopoov <v.prokopov@atwix.com> Date: Wed, 27 Jan 2021 13:35:26 +0200 Subject: [PATCH 73/73] Revert "Merge branch '2.4-develop' into 31082-remove-laminas-config-dependency" This reverts commit bab87d7f1cd509b5382e02213ac342e3457aa152, reversing changes made to 19068e39340d106d578849a1ed740f2dd5d9723b. --- .../App/Action/Plugin/Authentication.php | 3 +- .../Controller/Adminhtml/Auth/Login.php | 7 +- ...tNameIsNotOnProductMainPageActionGroup.xml | 21 ---- ...ateProductAttributeFromProductPageTest.xml | 16 +-- ...CustomOptionsSuiteAndImportOptionsTest.xml | 14 +-- ...nCreateVirtualProductWithTierPriceTest.xml | 15 +-- ...rifyDataOverridingOnStoreViewLevelTest.xml | 31 ++--- ...rifyDataOverridingOnStoreViewLevelTest.xml | 20 ++-- ...dminUpdateSimpleProductTieredPriceTest.xml | 54 ++++----- ...RegularPriceInStockDisabledProductTest.xml | 14 +-- ...PriceInStockNotVisibleIndividuallyTest.xml | 15 +-- ...ceInStockVisibleInCatalogAndSearchTest.xml | 54 ++++----- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 63 +++++----- ...larPriceInStockVisibleInSearchOnlyTest.xml | 53 ++++----- ...gularPriceInStockWithCustomOptionsTest.xml | 36 +++--- ...eProductWithRegularPriceOutOfStockTest.xml | 49 ++++---- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 14 +-- ...iceOutOfStockVisibleInCategoryOnlyTest.xml | 14 +-- ...PriceOutOfStockVisibleInSearchOnlyTest.xml | 14 +-- ...eInStockVisibleInCategoryAndSearchTest.xml | 14 +-- ...tOfStockVisibleInCategoryAndSearchTest.xml | 15 +-- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 14 +-- ...tOfStockVisibleInCategoryAndSearchTest.xml | 15 +-- ...MinimalQueryLengthForCatalogSearchTest.xml | 14 +-- ...CatalogProductListCheckWidgetOrderTest.xml | 2 +- ...heckoutProceedToPaymentStepActionGroup.xml | 20 ---- ...sNotAffectedStartedCheckoutProcessTest.xml | 4 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 4 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 4 +- ...tomerUsingNonExistentCustomerGroupTest.xml | 4 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 4 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 4 +- .../AdminAddVariableToWYSIWYGBlockTest.xml | 6 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 13 ++- ...WidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 5 +- ...getToWYSIWYGWithCMSStaticBlockTypeTest.xml | 4 +- ...WYSIWYGWithCatalogCategoryLinkTypeTest.xml | 4 +- ...oWYSIWYGWithCatalogProductLinkTypeTest.xml | 6 +- ...oWYSIWYGWithCatalogProductListTypeTest.xml | 4 +- ...YGWithRecentlyComparedProductsTypeTest.xml | 4 +- ...IWYGWithRecentlyViewedProductsTypeTest.xml | 4 +- ...CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 8 +- ...ifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml | 6 +- .../Magento/Customer/Block/Form/Register.php | 3 +- .../StorefrontCustomerAddressSection.xml | 1 - ...StorefrontCheckTaxAddingValidVATIdTest.xml | 4 +- .../frontend/templates/form/register.phtml | 17 --- ...dableProductLinkAfterPartialRefundTest.xml | 4 +- ...IdAtAccountCreateWithMultishipmentTest.xml | 52 --------- .../AdminAddWidgetToWYSIWYGNewsletterTest.xml | 7 +- ...DisabledForStoreViewAtRegistrationTest.xml | 32 ----- .../AdminGoToOrdersReportPageActionGroup.xml | 18 --- ...inCanceledOrdersInOrderSalesReportTest.xml | 101 ---------------- .../CancelOrdersInOrderSalesReportTest.xml | 7 +- ...viewDateForReviewsByProductsReportTest.xml | 3 - .../AdminGoToOrderStatusPageActionGroup.xml | 19 --- .../Sales/Test/Mftf/Data/CancelOrderData.xml | 17 --- .../Sales/Test/Mftf/Data/HoldOrderData.xml | 17 --- .../Test/Mftf/Metadata/CancelOrderMeta.xml | 17 --- .../Test/Mftf/Metadata/HoldOrderMeta.xml | 17 --- ...dminCheckingCreditMemoUpdateTotalsTest.xml | 51 +++----- ...inCreateOrderStatusDuplicatingCodeTest.xml | 2 +- ...nCreateOrderStatusDuplicatingLabelTest.xml | 2 +- .../Mftf/Test/AdminCreateOrderStatusTest.xml | 2 +- .../AdminOrdersReleaseInUnholdStatusTest.xml | 49 ++++---- .../AdminUnassignCustomOrderStatusTest.xml | 2 +- ...mOrderStatusNotVisibleOnStorefrontTest.xml | 8 +- .../Model/Resolver/OrderTotal.php | 3 +- .../AdminNavigateWhileUserExpiredTest.xml | 3 +- .../User/Controller/Adminhtml/User/Save.php | 2 +- app/code/Magento/WebapiAsync/README.md | 29 +---- app/code/Magento/WebapiSecurity/README.md | 17 +-- app/code/Magento/Weee/README.md | 109 +++--------------- app/code/Magento/WeeeGraphQl/README.md | 24 +--- app/code/Magento/Widget/README.md | 42 +------ .../Mftf/Test/NewProductsListWidgetTest.xml | 2 +- .../Test/Mftf/Test/ProductsListWidgetTest.xml | 2 +- app/code/Magento/Wishlist/README.md | 102 +--------------- app/code/Magento/WishlistAnalytics/README.md | 11 +- app/code/Magento/WishlistGraphQl/README.md | 44 +------ .../Mview/Test/Unit/View/SubscriptionTest.php | 60 +++------- .../Framework/Mview/View/Subscription.php | 88 +++++--------- 82 files changed, 410 insertions(+), 1269 deletions(-) delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml delete mode 100644 app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml delete mode 100644 app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml delete mode 100644 app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml delete mode 100644 app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 519db00d6439d..4b25e9921e404 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -225,8 +225,7 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt // Checks, whether secret key is required for admin access or request uri is explicitly set if ($this->_url->useSecretKey()) { - $requestParts = explode('/', trim($request->getRequestUri(), '/'), 2); - $requestUri = $this->_url->getUrl(array_pop($requestParts)); + $requestUri = $this->_url->getUrl('*/*/*', ['_current' => true]); } elseif ($request) { $requestUri = $request->getRequestUri(); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php index 16be2cf1343eb..1de77c810f316 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php @@ -49,10 +49,11 @@ public function execute() } $requestUrl = $this->getRequest()->getUri(); - if (!$requestUrl->isValid()) { - return $this->getRedirect($this->getUrl('*')); + $backendUrl = $this->getUrl('*'); + // redirect according to rewrite rule + if ($requestUrl != $backendUrl) { + return $this->getRedirect($backendUrl); } - return $this->resultPageFactory->create(); } diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml deleted file mode 100644 index ccda16f37085f..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?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="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup"> - <annotations> - <description>Validates that the provided Product Name is NOT present on a Storefront page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <waitForPageLoad stepKey="waitForTheProductPageToLoad"/> - <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 100d4bdef5f48..37a4bc613f65d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -55,7 +55,7 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> <argument name="stockStatus" value="In Stock"/> - </actionGroup> + </actionGroup> <!-- Create New Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> @@ -128,14 +128,10 @@ <!--Verify Product Attribute present in search page --> <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> - <argument name="phrase" value="{{ProductAttributeOption8.value}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> - <argument name="productName" value="{{SimpleProduct.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index e12394cbcb512..3141db87f6976 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -125,15 +125,11 @@ <!-- Verify customer see created virtual product with custom options suite and import options(from above step) on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(virtualProductCustomImportOptions.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{virtualProductCustomImportOptions.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> - <argument name="productName" value="{{virtualProductCustomImportOptions.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductCustomImportOptions.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductCustomImportOptions.name}}" stepKey="seeVirtualProductName"/> <click selector="{{StorefrontQuickSearchResultsSection.productLink}}" stepKey="openSearchedProduct"/> <!-- Verify we see created virtual product with custom options suite and import options on the storefront page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index e4cacba0224a7..f2840758d59a6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -102,16 +102,11 @@ <!-- Verify customer see created virtual product with tier price(from above step) on storefront page and is searchable by sku --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{virtualProductBigQty.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> - <argument name="productName" value="{{virtualProductBigQty.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductBigQty.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductName"/> <grabTextFrom selector="{{StorefrontQuickSearchResultsSection.asLowAsLabel}}" stepKey="tierPriceTextOnStorefrontPage"/> <assertEquals stepKey="assertTierPriceTextOnCategoryPage"> <expectedResult type="string">As low as ${{tierPriceOnVirtualProduct.price}}</expectedResult> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 9e5fd6261ee0e..70d6932f6fc17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -71,31 +71,20 @@ <!--Verify customer see default simple product name on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeDefaultProductName"> - <argument name="productName" value="$$initialSimpleProduct.name$$"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="$$initialSimpleProduct.name$$" stepKey="seeDefaultProductName"/> <!--Verify customer see simple product with updated name on magento storefront page under store view section --> <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForPageLoad stepKey="waitForStoreSwitcherLoad"/> <click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/> - - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch"> - <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeUpdatedSimpleProductName"> - <argument name="productName" value="{{simpleProductDataOverriding.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/> + <waitForPageLoad stepKey="waitForSearchTextBoxLoad"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/> + <waitForPageLoad stepKey="waitForTextSearchLoad"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDataOverriding.name}}" stepKey="seeUpdatedSimpleProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index 26380bd2861d4..f9c90b1190611 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -69,24 +69,20 @@ <!-- Verify customer see simple product with updated price on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> <see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPage"/> <!-- Verify customer see simple product with updated price on magento storefront page under store view section --> <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForPageLoad stepKey="waitForStoreSwitcherLoad"/> <click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch"> - <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/> + <waitForPageLoad stepKey="waitForSearchTextBoxLoad"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/> + <waitForPageLoad stepKey="waitForTextSearchLoad"/> <see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPageUnderStoreViewSection"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 321f83161e945..420a0604f0382 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -68,10 +68,10 @@ <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="fillSimpleProductWeight"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="selectProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -112,6 +112,7 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/> @@ -122,42 +123,31 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductTierPrice300InStock.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductTierPrice300InStock.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductTierPrice300InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductTierPrice300InStock.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductTierPrice300InStock.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductTierPrice300InStock.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductTierPrice300InStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName"> - <argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductTierPrice300InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index ab0fcea919af0..9cae9cc3f1f42 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -81,14 +81,10 @@ <!--Verify customer don't see updated simple product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(simpleProductDisabled.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductDisabled.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage"> - <argument name="productName" value="{{simpleProductDisabled.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDisabled.name}}" stepKey="dontSeeProductNameOnStorefrontPage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 52f550248819e..aad946dced83c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -89,6 +89,7 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> @@ -97,14 +98,10 @@ <!--Verify customer don't see updated simple product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"> - <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index bdb56af340e7b..9cb326ca6d804 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -89,6 +89,7 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -102,42 +103,31 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductRegularPrice245InStock.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductRegularPrice245InStock.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice245InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductRegularPrice245InStock.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductRegularPrice245InStock.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductRegularPrice245InStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeSimpleProductNameOnStorefrontPage"> - <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice245InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStorefrontPage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 08c4245147a2d..38c0a7449210c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -36,11 +36,11 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> - <argument name="productSku" value="$initialSimpleProduct.sku$"/> - </actionGroup> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> + </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> @@ -74,8 +74,8 @@ <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/> <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillProductSku"/> <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> <!-- Verify customer see updated simple product in the product form page --> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/> @@ -84,11 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -102,41 +103,31 @@ <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductRegularPrice32501InStock.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductRegularPrice32501InStock.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> - <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="dontSeeProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 6f5f3488b1da4..4ce3af5991235 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -89,6 +89,7 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -100,41 +101,31 @@ <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductRegularPrice325InStock.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductRegularPrice325InStock.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice325InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice325InStock.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductRegularPrice325InStock.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductRegularPrice325InStock.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductRegularPrice325InStock.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductRegularPrice325InStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName"> - <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice325InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 6066a02110f13..2316e36eb0b9c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -121,29 +121,23 @@ <seeInField selector="{{AdminProductCustomizableOptionsSection.fillOptionValueSku(simpleProductCustomizableOption.title,'0')}}" userInput="{{simpleProductCustomizableOption.option_0_sku}}" stepKey="seeOptionSku"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductRegularPriceCustomOptions.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductRegularPriceCustomOptions.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductRegularPriceCustomOptions.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPriceCustomOptions.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPriceCustomOptions.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPriceCustomOptions.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductRegularPriceCustomOptions.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductRegularPriceCustomOptions.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductRegularPriceCustomOptions.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer see customizable options are Required --> <seeElement selector="{{StorefrontProductInfoMainSection.requiredCustomSelect(simpleProductCustomizableOption.title)}}" stepKey="verifyFirstCustomOptionIsRequired"/> @@ -163,7 +157,7 @@ <seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeYouAddedSimpleprod4ToYourShoppingCartSuccessSaveMessage"/> <seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> - <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.storefront_new_cartprice}}" stepKey="seeProductPriceInMiniCart"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 0d1d83efefa5d..dcec3e3f8bd50 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -89,6 +89,7 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> @@ -99,41 +100,31 @@ <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/> - </actionGroup> - + <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> - <argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> - <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductRegularPrice32503OutOfStock.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> - <argument name="phrase" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> - <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 39ecb8c3bfd01..f4375ad499dfd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -116,15 +116,11 @@ <!-- Verify customer don't see updated virtual product link on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductSkuOnStorefrontPage"> - <argument name="phrase" value="{{updateVirtualProductRegularPrice.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> - <argument name="productName" value="{{updateVirtualProductRegularPrice.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice.sku}}" stepKey="fillVirtualProductSkuOnStorefrontPage"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="dontSeeVirtualProductName"/> <!-- Verify customer see updated virtual product in category page --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 1c23d2cd59f39..343326547254a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -122,14 +122,10 @@ <!--Verify customer don't see updated virtual product link(from above step) on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> - <argument name="productName" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index c738a589946c0..0d6a1c87c62fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -100,15 +100,11 @@ <!--Verify customer don't see updated virtual product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice99OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"> - <argument name="productName" value="{{updateVirtualProductRegularPrice99OutOfStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"/> <!--Verify customer don't see updated virtual product link on category page --> <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.name$$)}}" stepKey="openCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index da43d12ab7983..f423cd6c77807 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -112,15 +112,11 @@ <!-- Verify customer see updated virtual product on the magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualProductSpecialPrice.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> - <argument name="productName" value="{{updateVirtualProductSpecialPrice.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPrice.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductName"/> <!--Verify customer see updated virtual product with special price(from above step) on product storefront page by url key --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index df2e7f530158f..78a15ee7eb195 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -130,15 +130,10 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductNameOnStorefrontPage"> - <argument name="productName" value="{{updateVirtualProductSpecialPriceOutOfStock.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductNameOnStorefrontPage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 6d21178bbfa01..f64e628c0edb9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -146,14 +146,10 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductWithTierPriceInStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualProductTierPriceInStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> - <argument name="productName" value="{{updateVirtualProductWithTierPriceInStock.name}}"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductTierPriceInStock.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="dontSeeVirtualProductName"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index ded8f7d03029e..6e835f2e5e98b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -146,15 +146,10 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualTierPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> - <argument name="phrase" value="{{updateVirtualTierPriceOutOfStock.sku}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> - <argument name="productName" value="{{updateVirtualTierPriceOutOfStock.name}}"/> - </actionGroup> - + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualTierPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> </test> </tests> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml index 8b9b78b67bc75..d6a5aa8b93572 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml @@ -38,14 +38,10 @@ <comment userInput="Go to Storefront and search for product" stepKey="searchProdUsingMinQueryLength"/> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> <comment userInput="Quick search by single character and avoid using ES stopwords" stepKey="commentQuickSearch"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> - <argument name="phrase" value="B"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> - <argument name="productName" value="$$createProduct.name$$"/> - </actionGroup> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="B" stepKey="fillAttribute"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInCategoryPage"/> </test> </tests> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml index 062c4c398e189..1d5e369d50e1d 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml @@ -70,7 +70,7 @@ <click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" /> <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="waitForCategoryVisible" /> <click selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="selectCategory" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> <!--Save cms page and go to Storefront--> <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/> <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml deleted file mode 100644 index a55db2b92e9c3..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?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="StorefrontGuestCheckoutProceedToPaymentStepActionGroup"> - <annotations> - <description>Clicks next on Checkout Shipping step. Waits for Payment step</description> - </annotations> - - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded" after="clickNext"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index 259934503ec0e..ffbd6152af80b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -67,8 +67,8 @@ <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> <!-- Click Next button --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Payment step is opened --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index b3c5174605575..3d7f8e1dcfed4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -69,8 +69,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 929943dcfde52..8fcb8211c4625 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -64,8 +64,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(DE_Address_Berlin_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <!-- Change the address --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml index 78c4d3301e746..6b1d3a7ba66aa 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml @@ -79,8 +79,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 36ce5a87c9974..c7b1c441f1978 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -63,8 +63,8 @@ </actionGroup> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 5c13f9bbeb489..73a2e4757e954 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -187,8 +187,8 @@ <fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="fillPhone" /> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNextBtn"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNextBtn"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 71b2e7f772131..963844710dd7f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -110,9 +110,9 @@ <waitForElementVisible selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="waitForBlockTitle" /> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad10"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <waitForPageLoad stepKey="waitForPageLoad10" /> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index aca38e97dbe1a..9e28e81c2696d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -40,9 +40,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> @@ -62,9 +62,9 @@ </actionGroup> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading2"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad6"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading2" /> + <waitForPageLoad stepKey="waitForPageLoad6" /> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> @@ -85,3 +85,4 @@ </after> </test> </tests> + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index bcb1cf2e2c3e5..a599d22eab298 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -48,8 +48,8 @@ <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> <wait time="3" stepKey="waitForInsertWidgetClickable"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideoutCloses" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> @@ -70,3 +70,4 @@ </after> </test> </tests> + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index bb915ea73256d..1c9d7b38a40a4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -51,8 +51,8 @@ <scrollTo selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="scrollToBlockIdentifier" /> <click selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="selectPreCreateBlock" /> <waitForElementNotVisible selector="{{WidgetSection.SelectBlockTitle}}" stepKey="waitForSlideoutCloses" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitingForLoading"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitingForLoading" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index e58b66f1bbb8d..4f78f6bcce5e0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -49,8 +49,8 @@ <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="expandWait" /> <click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCreateCategory" /> <waitForElementNotVisible selector="{{WidgetSection.SelectCategoryTitle}}" stepKey="waitForSlideoutCloses1" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses2"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses2" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 6825d4b21a089..4ee5b0d263d40 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -55,9 +55,9 @@ <waitForLoadingMaskToDisappear stepKey="waitLoadingMask" /> <click selector="{{WidgetSection.PreCreateProduct('$$createPreReqProduct.name$$')}}" stepKey="selectPreProduct" /> <waitForElementNotVisible selector="{{WidgetSection.SelectProductTitle}}" stepKey="waitForSlideOutCloses" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitLoadingMask1"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitLoadingMask1" /> + <waitForPageLoad stepKey="wait6" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 721b8cda325e3..6c36913cbb593 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -79,8 +79,8 @@ <click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam3"/> <fillField selector="{{WidgetSection.RuleParamInput('3','2')}}" userInput="1" stepKey="fillMinPrice"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForPageLoad stepKey="wait6" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 2315262f69c3b..440f63403c519 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -51,8 +51,8 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Compared Products Grid Template" stepKey="selectTemplate" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 27a8b596513a7..226292e6cdea4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -50,8 +50,8 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Viewed Products Grid Template" stepKey="selectTemplate" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index 4167c81a12fb4..c0e6a9cbd793d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -90,8 +90,8 @@ <waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct2"/> <click selector="{{WidgetSection.PreCreateProduct('$$product2.name$$')}}" stepKey="selectProduct2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton"/> + <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/> <waitForPageLoad stepKey="waitForSaveComplete"/> <actionGroup ref="CompareTwoProductsOrder" stepKey="compareProductOrders1"> @@ -125,8 +125,8 @@ <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1_1"/> <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct2_2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts1"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton1"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton1"/> + <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget1"/> <waitForPageLoad stepKey="waitForSaveComplete1"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index c3a38470a5c8f..03e3097dbd720 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -73,9 +73,9 @@ <scrollTo selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="scrollToBlockIdentifier" /> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <waitForPageLoad stepKey="waitForPageLoad5" /> <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index 006deed601274..d6d0d9c494c11 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -9,7 +9,6 @@ use Magento\Customer\Model\AccountManagement; use Magento\Framework\App\ObjectManager; use Magento\Newsletter\Model\Config; -use Magento\Store\Model\ScopeInterface; /** * Customer register form block @@ -185,7 +184,7 @@ public function getRegion() public function isNewsletterEnabled() { return $this->_moduleManager->isOutputEnabled('Magento_Newsletter') - && $this->newsLetterConfig->isActive(ScopeInterface::SCOPE_STORE); + && $this->newsLetterConfig->isActive(); } /** diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml index 533a1d91b9c77..c1e0ac6573be7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml @@ -19,7 +19,6 @@ <element name="stateProvinceFill" type="input" selector="#region"/> <element name="zip" type="input" selector="#zip"/> <element name="country" type="select" selector="#country"/> - <element name="vatId" type="input" selector="#vat_id"/> <element name="saveAddress" type="button" selector="[data-action='save-address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 28ae33ff7f56b..5a75d5d272295 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -87,8 +87,8 @@ <!--Proceed to checkout--> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/> <!-- Click next button to open payment section --> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml index 1d25a601c5523..5e58f94683ec1 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml @@ -131,23 +131,6 @@ $formData = $block->getFormData(); </div> </div> - <?php if ($addressHelper->isVatAttributeVisible()): ?> - <?php $_vatidValidationClass = $addressHelper->getAttributeValidationClass('vat_id'); ?> - <div class="field taxvat"> - <label class="label" for="vat_id"> - <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?></span> - </label> - <div class="control"> - <input type="text" - name="vat_id" - value="<?= $escaper->escapeHtmlAttr($formData->getVatId()) ?>" - title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?>" - class="input-text <?= $escaper->escapeHtmlAttr($_vatidValidationClass) ?>" - id="vat_id"> - </div> - </div> - <?php endif; ?> - <div class="field country required"> <label for="country" class="label"> <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('country_id') ?></span> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml index 3a1eb63a96ae1..0d37c353052ec 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml @@ -70,8 +70,8 @@ <comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/> <waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/> <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> - <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml deleted file mode 100644 index f1c3898cb5af7..0000000000000 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?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="StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest"> - <annotations> - <features value="Multishipment"/> - <stories value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> - <title value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> - <description value="'VAT Number' field should be available at create account page if 'Show VAT Number on Storefront' is Yes"/> - <severity value="MAJOR"/> - <testCaseId value="MC-40397"/> - <group value="Multishipment"/> - </annotations> - <before> - <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 1" stepKey="showVatNumberOnStorefrontYes"/> - <createData entity="SimpleSubCategory" stepKey="category"/> - <createData entity="SimpleProduct" stepKey="product"> - <requiredEntity createDataKey="category"/> - </createData> - </before> - <after> - <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> - <argument name="tags" value="config"/> - </actionGroup> - <deleteData createDataKey="category" stepKey="deleteCategory"/> - <deleteData createDataKey="product" stepKey="deleteproduct"/> - </after> - <!-- Add product to the cart --> - <amOnPage url="$$product.name$$.html" stepKey="goToProductPage"/> - <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> - <argument name="productName" value="$$product.name$$"/> - </actionGroup> - <!-- Check Out with Multiple Addresses --> - <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> - <waitForElementVisible selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="waitMultipleAddressShippingButton"/> - <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> - <!--Create an account--> - <waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="waitCreateAnAccountButton"/> - <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickOnCreateAnAccountButton"/> - <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> - <!--Check the VAT Number field--> - <seeElement selector="{{StorefrontCustomerAddressSection.vatId}}" stepKey="assertVatIdField"/> - </test> -</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 961c8c8cb391e..0fa16d275d6f4 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -42,9 +42,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSaveTemplate"/> <waitForPageLoad stepKey="waitForPageLoad10" /> <click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" /> @@ -59,3 +59,4 @@ </after> </test> </tests> + diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml deleted file mode 100644 index bc273d84aaf34..0000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?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="StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest"> - <annotations> - <features value="Newsletter"/> - <stories value="Disabled Newsletter Subscription for store View"/> - <title value="Disabled Newsletter Subscription for store View"/> - <description value="Option to subscribe should not be displayed at registration form if it is switched off for current store"/> - <severity value="AVERAGE"/> - <group value="newsletter"/> - <group value="configuration"/> - <testCaseId value="MC-*"/> - </annotations> - <before> - <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 0" stepKey="disableSubscriptionForStore"/> - </before> - <after> - <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 1" stepKey="enableSubscriptionForStore"/> - </after> - <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="checkNoSubscriptionOption"/> - </test> -</tests> diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml deleted file mode 100644 index b8f117a0de4bc..0000000000000 --- a/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?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="AdminGoToOrdersReportPageActionGroup"> - <annotations> - <description>Redirects to the Orders Report page</description> - </annotations> - - <amOnPage url="{{OrdersReportPage.url}}" stepKey="goToOrdersReportPage"/> - <waitForPageLoad stepKey="waitForOrdersReportPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml deleted file mode 100644 index e56d2b5bcbe6e..0000000000000 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?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="AdminCanceledOrdersInOrderSalesReportTest"> - <annotations> - <features value="Reports"/> - <stories value="Order Sales Report includes canceled orders"/> - <group value="reports"/> - <title value="Canceled orders in order sales report"/> - <description value="Verify canceling of orders in order sales report"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-95960"/> - <useCaseId value="MAGETWO-95823"/> - </annotations> - - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - - <createData entity="_defaultCategory" stepKey="createCategory"/> - <createData entity="SimpleProduct" stepKey="createSimpleProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - - <createData entity="CustomerCart" stepKey="createCustomerCartOne"> - <requiredEntity createDataKey="createCustomer"/> - </createData> - <createData entity="CustomerCartItem" stepKey="addCartItemOne"> - <requiredEntity createDataKey="createCustomerCartOne"/> - <requiredEntity createDataKey="createSimpleProduct"/> - </createData> - <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> - <requiredEntity createDataKey="createCustomerCartOne"/> - </createData> - <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> - <requiredEntity createDataKey="createCustomerCartOne"/> - </updateData> - <createData entity="Invoice" stepKey="invoiceOrderOne"> - <requiredEntity createDataKey="createCustomerCartOne"/> - </createData> - <createData entity="Shipment" stepKey="shipOrderOne"> - <requiredEntity createDataKey="createCustomerCartOne"/> - </createData> - - <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> - <requiredEntity createDataKey="createCustomer"/> - </createData> - <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> - <requiredEntity createDataKey="createCustomerCartTwo"/> - <requiredEntity createDataKey="createSimpleProduct"/> - </createData> - <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> - <requiredEntity createDataKey="createCustomerCartTwo"/> - </createData> - <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> - <requiredEntity createDataKey="createCustomerCartTwo"/> - </updateData> - <createData entity="CancelOrder" stepKey="cancelOrderTwo"> - <requiredEntity createDataKey="createCustomerCartTwo"/> - </createData> - </before> - - <after> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - - <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage1"/> - <generateDate stepKey="generateEndDate" date="+0 day" format="m/d/Y"/> - <generateDate stepKey="generateStartDate" date="-1 day" format="m/d/Y"/> - <actionGroup ref="GenerateOrderReportForNotCancelActionGroup" stepKey="generateReportAfterCancelOrderBefore"> - <argument name="orderFromDate" value="$generateStartDate"/> - <argument name="orderToDate" value="$generateEndDate"/> - <argument name="statuses" value="['closed', 'complete', 'fraud', 'holded', 'payment_review', 'paypal_canceled_reversal', 'paypal_reversed', 'processing']"/> - </actionGroup> - <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCountBefore"/> - <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersSpecified"/> - - <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage2"/> - <actionGroup ref="GenerateOrderReportActionGroup" stepKey="generateReportAfterCancelOrder"> - <argument name="orderFromDate" value="$generateStartDate"/> - <argument name="orderToDate" value="$generateEndDate"/> - </actionGroup> - <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCount"/> - <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersAny"/> - - <assertEquals stepKey="assertEquals"> - <actualResult type="string">{$grabCanceledOrdersAny}</actualResult> - <expectedResult type="string">{$grabCanceledOrdersSpecified}</expectedResult> - </assertEquals> - </test> -</tests> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 54d3059f24532..6e9e8e800e076 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -7,19 +7,16 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="CancelOrdersInOrderSalesReportTest" deprecated="Use AdminCanceledOrdersInOrderSalesReportTest instead"> + <test name="CancelOrdersInOrderSalesReportTest"> <annotations> <features value="Reports"/> <stories value="Order Sales Report includes canceled orders"/> <group value="reports"/> - <title value="DEPRECATED. Canceled orders in order sales report"/> + <title value="Canceled orders in order sales report"/> <description value="Verify canceling of orders in order sales report"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-95960"/> <useCaseId value="MAGETWO-95823"/> - <skip> - <issueId value="DEPRECATED">Use AdminCanceledOrdersInOrderSalesReportTest instead</issueId> - </skip> </annotations> <before> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml index 8b75a0f608548..3405314f24f78 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml @@ -17,9 +17,6 @@ <severity value="MAJOR"/> <useCaseId value="MC-39737"/> <testCaseId value="MC-39838"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <!--Step1. Login as admin--> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml deleted file mode 100644 index a47d9858652e9..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?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="AdminGoToOrderStatusPageActionGroup"> - <annotations> - <description>Goes to Stores->Order Status->Order Status Page.</description> - </annotations> - - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <waitForPageLoad stepKey="waitForPageLoaded"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml deleted file mode 100644 index d50a262a2f8b2..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?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="CancelOrder" type="CancelOrder"> - <var key="quote_id" entityKey="return" entityType="CustomerCart"/> - </entity> - -</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml deleted file mode 100644 index 35b72f31f59ac..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?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="HoldOrder" type="HoldOrder"> - <var key="quote_id" entityKey="return" entityType="CustomerCart"/> - </entity> - -</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml deleted file mode 100644 index c874b5a2118db..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="CreateCancelOrder" dataType="CancelOrder" type="create" auth="adminOauth" url="V1/orders/{return}/cancel" method="POST"> - <contentType>application/json</contentType> - <object key="cartItem" dataType="CartItem"> - <field key="quote_id">string</field> - </object> - </operation> -</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml deleted file mode 100644 index 66036419815fb..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="CreateHoldOrder" dataType="HoldOrder" type="create" auth="adminOauth" url="V1/orders/{return}/hold" method="POST"> - <contentType>application/json</contentType> - <object key="cartItem" dataType="CartItem"> - <field key="quote_id">string</field> - </object> - </operation> -</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 03dd8b28a624f..37a4782ce2e73 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -20,61 +20,44 @@ <group value="sales"/> </annotations> <before> + <!--Create product--> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - + <!--Create customer--> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> - - <createData entity="CustomerCart" stepKey="createCustomerCart"> - <requiredEntity createDataKey="createCustomer"/> - </createData> - - <createData entity="CustomerCartItem" stepKey="addCartItem"> - <requiredEntity createDataKey="createCustomerCart"/> - <requiredEntity createDataKey="createSimpleProduct"/> - </createData> - - <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> - <requiredEntity createDataKey="createCustomerCart"/> - </createData> - - <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> - <requiredEntity createDataKey="createCustomerCart"/> - </updateData> - - <createData entity="Invoice" stepKey="invoiceOrderOne"> - <requiredEntity createDataKey="createCustomerCart"/> - </createData> - + <!--Login to admin page--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> + <!--Delete simple product--> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <!--Delete customer--> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderId"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="submitInvoice"/> - - <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> - <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> - <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="getOrderId"/> - <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> - <argument name="orderId" value="{$getOrderId}"/> + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> </actionGroup> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <!--Create invoice--> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> + <!--Submit invoice--> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> + <!--Create Credit Memo--> <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> <actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateCreditMemoTotals"/> <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> + <!--Go to Credit Memo tab--> <click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemosTab"/> <waitForPageLoad stepKey="waitForCreditMemosGridToLoad"/> + <!--Check refunded total --> <see selector="{{AdminOrderCreditMemosTabSection.gridRow('1')}}" userInput="$123" stepKey="seeCreditMemoInGrid"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml index 5c61a8b089b97..23dca916781f1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index 84bda226c9512..d3cd3e8b8549c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index f4ad885429189..a30040045a4ca 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -26,7 +26,7 @@ </after> <!-- Go to new order status page --> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml index e0576f94347cf..d2ded1cc73d2b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml @@ -21,56 +21,53 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <createData entity="CustomerCart" stepKey="createCustomerCart"> - <requiredEntity createDataKey="createCustomer"/> - </createData> - <createData entity="CustomerCartItem" stepKey="addCartItemOne"> - <requiredEntity createDataKey="createCustomerCart"/> - <requiredEntity createDataKey="createProduct"/> - </createData> - <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> - <requiredEntity createDataKey="createCustomerCart"/> - </createData> - <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> - <requiredEntity createDataKey="createCustomerCart"/> - </updateData> - <createData entity="HoldOrder" stepKey="holdOrder"> - <requiredEntity createDataKey="createCustomerCart"/> - </createData> </before> <after> + <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createFirstOrder"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="pushButtonHold"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForHold"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeHoldMessage"/> + <!-- Create order --> + <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> + <argument name="product" value="$$createProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> + <actualResult type="const">$getOrderId</actualResult> + </assertNotEmpty> + + <!-- Hold Order --> + <click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="pushButtonHold"/> + <waitForPageLoad stepKey="waitForHold"/> + <see userInput="You put the order on hold." stepKey="seeHoldMessage"/> + <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> - <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> + + <!-- Select Mass Action according to dataset: Unhold --> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="actionUnold"> <argument name="action" value="Unhold"/> - <argument name="orderId" value="$grabOrderId"/> + <argument name="orderId" value="$getOrderId"/> </actionGroup> <see userInput="1 order(s) have been released from on hold status." stepKey="assertOrderReleaseSuccessMessage"/> + <!--Assert order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="{$grabOrderId}"/> + <argument name="orderId" value="{$getOrderId}"/> <argument name="orderStatus" value="Pending"/> </actionGroup> - <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Pending" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index 0224bca9d96ac..226524341efdd 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -25,7 +25,7 @@ </after> <!--Go to new order status page--> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!--Fill the form and validate save success message--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index 861a5a5bf42df..a5d210a9765ad 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -47,8 +47,8 @@ </after> <!-- Create order status --> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderStatusPageLoad"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <waitForPageLoad stepKey="waitForOrderStatusPageLoad"/> <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> <!-- Fill form and validate message --> @@ -119,8 +119,8 @@ <see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> <!-- Unassign order status --> - <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStatusPageLoad"/> + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatus"/> + <waitForPageLoad stepKey="waitForStatusPageLoad"/> <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> <argument name="statusCode" value="{{defaultOrderStatus.status}}"/> diff --git a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php index d767cfd32cdb9..ab3ace45f336c 100644 --- a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php +++ b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php @@ -60,8 +60,7 @@ public function resolve( ], 'taxes' => $this->getAppliedShippingTaxesDetails($order), 'discounts' => $this->getShippingDiscountDetails($order), - ], - 'model' => $order + ] ]; } diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml index c7bfdd8bb9e98..dc88ad9d2cbf1 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml @@ -48,8 +48,7 @@ <wait time="120" stepKey="waitForUserToExpire"/> <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomers"/> <!-- Confirm that user is logged out --> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAdminLoginUrl"/> - <seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/> + <seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/> <!-- Delete created user --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Save.php b/app/code/Magento/User/Controller/Adminhtml/User/Save.php index 72024a85bef13..521c09f7b7707 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Save.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Save.php @@ -105,7 +105,7 @@ public function execute() $this->getSecurityCookie()->setLogoutReasonCookie( \Magento\Security\Model\AdminSessionsManager::LOGOUT_REASON_USER_LOCKED ); - $this->_redirect('*'); + $this->_redirect('adminhtml/*/'); } catch (NotificationExceptionInterface $exception) { $this->messageManager->addErrorMessage($exception->getMessage()); } catch (\Magento\Framework\Exception\AuthenticationException $e) { diff --git a/app/code/Magento/WebapiAsync/README.md b/app/code/Magento/WebapiAsync/README.md index 96f82d8b6e493..ed57634e77caf 100644 --- a/app/code/Magento/WebapiAsync/README.md +++ b/app/code/Magento/WebapiAsync/README.md @@ -1,28 +1,3 @@ -# Magento_WebapiAsync module +# WebapiAsync -Magento_WebapiAsync module extends Webapi extension and provide functional to process asynchronous requests. - -Magento_WebapiAsync module handles asynchronous requests, schedule, publish and consume bulk operations from a queue. - -## Installation details - -Before installing this module, note that the Magento_WebapiAsync is dependent on the following modules: - -- Magento_AsynchronousOperations -- Magento_Customer -- Magento_User -- Magento_Webapi - -For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Structure - -`Code/` - the directory that contains Remote service reader configuration files. - -For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). - -## Extensibility - -Extension developers can interact with the Magento_WebapiAsync module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WebapiAsync module. +**WebapiAsync** Extends Webapi extension and provide functional to process asynchronous requests. It handle asynchronous requests, schedule, publish and consum bulk operations from queue. diff --git a/app/code/Magento/WebapiSecurity/README.md b/app/code/Magento/WebapiSecurity/README.md index a355112536a00..ec5f84d1d14fa 100644 --- a/app/code/Magento/WebapiSecurity/README.md +++ b/app/code/Magento/WebapiSecurity/README.md @@ -1,15 +1,6 @@ -# Magento_WebapiSecurity module - -The Magento_WebapiSecurity module enables access management of some Web API resources. - -If checkbox enabled in backend through: `Stores -> Configuration -> Services -> Magento Web API -> Web Api Security` then the security of all the services outlined in `app/code/Magento/WebapiSecurity/etc/di.xml` would be loosened. You may modify this list to customize which services should follow this behavior. +# WebapiSecurity +**WebapiSecurity** enables access management of some Web API resources. +If checkbox is enabled in backend through: Stores -> Configuration -> Services -> Magento Web API -> Web Api Security +then the security of all of the services outlined in app/code/Magento/WebapiSecurity/etc/di.xml would be loosened. You may modify this list to customize which services should follow this behavior. By loosening the security, these services would allow access anonymously (by anyone). - -## Installation details - -Before installing this module, note that the Magento_WebapiSecurity is dependent on the following modules: - -- `Magento_Webapi` - -For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index 516f442d23315..ef433ec4c96f9 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -1,99 +1,26 @@ -# Magento_Weee module - +# Overview The Magento_Weee module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. - -Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. - -This module extends the existing functionality of Magento_Tax. +Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. This module extends the existing functionality of Magento_Tax. The Magento_Weee module includes the following: -- Ability to add different number of fixed product taxes to product. They are treated as a product attribute. -- Configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed. -- A new line item in the totals section. - -## Installation details - -The Magento_Weee module can be installed automatically (using native Magento install mechanism) without any additional actions. - -Before installing this module, note that the Magento_Weee is dependent on the following modules: - -- Magento_Catalog -- Magento_Checkout -- Magento_Customer -- Magento_Quote -- Magento_Sales -- Magento_Store -- Magento_Tax - -Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Structure - -`Pricing/` - directory that contain tax adjustment. - -For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). - -## Extensibility - -Extension developers can interact with the Magento_Weee module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Weee module. - -### Layouts - -This module introduces the following layouts and layout handles in the directories: - -- `view/adminhtml/layout`: - - `catalog_product_form` - - `sales_creditmemo_item_price` - - `sales_invoice_item_price` - - `sales_order_create_item_price` - - `sales_order_creditmemo_new` - - `sales_order_creditmemo_updateqty` - - `sales_order_creditmemo_view` - - `sales_order_invoice_new` - - `sales_order_invoice_updateqty` - - `sales_order_invoice_view` - - `sales_order_item_price` - - `sales_order_view` - -- `view/base/layout`: - - `catalog_product_prices` - -- `view/frantend/layout`: - - `checkout_cart_index` - - `checkout_index_index` - - `checkout_item_price_renderers` - - `default` - - `sales_email_item_price` - - `sales_email_order_creditmemo_items` - - `sales_email_order_invoice_items` - - `sales_email_order_items` - - `sales_guest_creditmemo` - - `sales_guest_invoice` - - `sales_guest_print` - - `sales_guest_printcreditmemo` - - `sales_guest_printinvoice` - - `sales_guest_view` - - `sales_order_creditmemo` - - `sales_order_invoice` - - `sales_order_item_price` - - `sales_order_print` - - `sales_order_printcreditmemo` - - `sales_order_printinvoice` - - `sales_order_view` - -For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +* ability to add different number of fixed product taxes to product. They are treated as a product attribute; +* configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; +* a new line item in the totals section. -### UI components +# System requirements +The Magento_Weee module does not have any specific system requirements. -You can extend a customer form and widgets using the configuration files located in the directories +## Install +Magento_Weee module can be installed automatically (using native Magento install mechanism) without any additional actions -- `view/adminhtml/ui_component`: - - `product_attribute_add_form` -- `view/frontend/ui_component`: - - `widget_recently_compared` - - `widget_recently_viewed` +## Uninstall +Magento installation with existing products with FPT: +* Disable FPT on the backend +* Remove all products with FPT +* Remove all FPT attributes from attribute sets +* Delete all FPT attributes +* Remove module directory from the code base -For information about a UI component, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +New Magento installation: +* Can be removed without additional actions diff --git a/app/code/Magento/WeeeGraphQl/README.md b/app/code/Magento/WeeeGraphQl/README.md index b1f44619785c4..b44771513d562 100644 --- a/app/code/Magento/WeeeGraphQl/README.md +++ b/app/code/Magento/WeeeGraphQl/README.md @@ -1,22 +1,4 @@ -# Magento_WeeeGraphQl module +# WeeeGraphQl -The Magento_WeeeGraphQl module provides type information for the GraphQl module to generate wee tax fields for the catalog and product information endpoints. - -The Magento_WeeeGraphQl module extends Magento_GraphQl and Magento_Weee modules. This module provides type and resolver information for GraphQL API. - -## Installation details - -Before installing this module, note that the Magento_WeeeGraphQl is dependent on the following modules: - -- `Magento_CatalogGraphQl` -- `Magento_Store` -- `Magento_Tax` -- `Magento_Weee` - -For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Extensibility - -Extension developers can interact with the Magento_WeeeGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WeeeGraphQl module. +**WeeeGraphQl** provides type information for the GraphQl module +to generate wee tax fields for catalog and product information endpoints. diff --git a/app/code/Magento/Widget/README.md b/app/code/Magento/Widget/README.md index 0d51c6732ec58..4d70d3b6838e0 100644 --- a/app/code/Magento/Widget/README.md +++ b/app/code/Magento/Widget/README.md @@ -1,41 +1 @@ -# Magento_Widget module - -The Magento_Widget module allows Magento application to be extended with custom widget blocks. - -## Installation details - -Before installing this module, note that the Magento_Widget is dependent on the following modules: - -- Magento_Catalog -- Magento_Cms -- Magento_Store - -Before disabling or uninstalling this module, note the following dependencies: - -- Magento_CatalogWidget -- Magento_CurrencySymbol -- Magento_Newsletter - -Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Extensibility - -Extension developers can interact with the Magento_Widget module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Widget module. - -### Layouts - -This module introduces the following layouts and layout handles in the directories: - -- `view/adminhtml/layout`: - - `adminhtml_widget_index` - - `adminhtml_widget_instance_block` - - `adminhtml_widget_instance_edit` - - `adminhtml_widget_instance_index` - - `adminhtml_widget_loadoptions` -- `view/frantend/layout`: - - `default` - - `print` - -For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). +The Widget module allows Magento application to be extended with custom widget blocks. \ No newline at end of file diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index dea2f6d1f80d6..ef9093667d479 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -44,7 +44,7 @@ <waitForPageLoad stepKey="waitForWidgetOptions"/> <selectOption selector="{{WidgetSection.DisplayType}}" userInput="New products" stepKey="selectDisplayType"/> <fillField selector="{{WidgetSection.NoOfProductToDisplay}}" userInput="100" stepKey="fillNoOfProductToDisplay"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_newDefaultCmsPage.identifier}}" stepKey="fillPageUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveCmsPage"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml index d1c0626689a40..e9fcdf436d90b 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml @@ -51,7 +51,7 @@ <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}" stepKey="clickCategoryToEditInitial"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyRuleParameter"/> - <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn"/> <click selector="{{CmsNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/> <waitForPageLoad stepKey="waitForCmsList2"/> diff --git a/app/code/Magento/Wishlist/README.md b/app/code/Magento/Wishlist/README.md index fef81ccacf000..1caed125814e7 100644 --- a/app/code/Magento/Wishlist/README.md +++ b/app/code/Magento/Wishlist/README.md @@ -1,100 +1,2 @@ -# Magento_Wishlist module - -The Magento_Wishlist module implements the Wishlist functionality. - -This module allows customers to create a list of products that they can add to their shopping cart to be purchased at a later date, or share with friends. - -## Installation details - -Before installing this module, note that the Magento_Wishlist is dependent on the following modules: - -- Magento_Captcha -- Magento_Catalog -- Magento_Customer - -Before disabling or uninstalling this module, note the following dependencies: - -- Magento_WishlistAnalytics - -Refer to [how to enable or disable modules in Magento 2](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Structure - -`Pricing/` - the directory that contain solutions for configurable and downloadable product price. - -For information about a typical file structure of a module, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). - -## Extensibility - -Extension developers can interact with the Magento_Wishlist module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Wishlist module. - -### Events - -The module dispatches the following events: - -- `product_option_renderer_init` event in the `\Magento\Wishlist\Block\Customer\Wishlist\Item\Options::_construct()` method. Parameters: - - `block` is a Wishlist block customer items (`\Magento\Wishlist\Block\Customer\Wishlist\Item\Options` class). -- `rss_wishlist_xml_callback` event in the `\Magento\Wishlist\Model\Rss\Wishlist::getRssData()` method. Parameters: - - `$args` is a array of product object (`\Magento\Catalog\Model\Product` class). -- `wishlist_add_item` event in the `\Magento\Wishlist\Model\Wishlist::addItem()` method. Parameters: - - `item` is an item object (`\Magento\Wishlist\Model\Item` class). -- `wishlist_add_product` event in the `\Magento\Wishlist\Controller\Index\Add::execute()` method. Parameters: - - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). - - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). - - `item` is an item object (`\Magento\Wishlist\Model\Item` class). -- `wishlist_item_collection_products_after_load` event in the `\Magento\Wishlist\Model\ResourceModel\Item\Collection::_assignProducts()` method. Parameters: - - `product_collection` is a product collection object (`\Magento\Catalog\Model\ResourceModel\Product\Collection` class). -- `wishlist_items_renewed` event in the `\Magento\Wishlist\Helper\Data::calculate()` method. -- `wishlist_product_add_after` event in the `\Magento\Wishlist\Model\Wishlist::addNewItem()` method. Parameters: - - `items` is an array of item object (`\Magento\Wishlist\Model\Item` class). -- `wishlist_share` event in the `\Magento\Wishlist\Controller\Index\Send::execute()` method. Parameters: - - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). -- `wishlist_update_item` event in the `\Magento\Wishlist\Controller\Index\UpdateItemOptions::execute()` method. Parameters: - - `wishlist` is a Wishlist object (`\Magento\Wishlist\Model\Wishlist` class). - - `product` is a product object (`\Magento\Catalog\Api\Data\ProductInterface` class). - - `item` is an item object (`\Magento\Wishlist\Model\Item` class). - -For information about the event, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). - -### Layouts - -This module introduces the following layouts and layout handles in the directories: - -- `view/adminhtml/layout`: - - `customer_index_wishlist` -- `view/base/layout`: - - `catalog_product_prices` -- `view/frantend/layout`: - - `catalog_category_view` - - `catalog_product_view` - - `catalogsearch_advanced_result` - - `checkout_cart_index` - - `checkout_cart_item_renderers` - - `customer_account` - - `default` - - `wishlist_email_items` - - `wishlist_email_rss` - - `wishlist_index_configure` - - `wishlist_index_configure_type_bundle` - - `wishlist_index_configure_type_configurable` - - `wishlist_index_configure_type_downloadable` - - `wishlist_index_configure_type_grouped` - - `wishlist_index_configure_type_simple` - - `wishlist_index_index` - - `wishlist_index_share` - - `wishlist_shared_index.xml` - -For more information about a layout, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). - -### UI components - -You can extend a customer form and widgets using the configuration files located in the directories -- `view/base/ui_component`: - - `customer_form` -- `view/frontend/ui_component`: - - `widget_recently_compared` - - `widget_recently_viewed` - -For information about a UI component, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). +The Magento_Wishlist implements the Wishlist functionality. +This allows customers to create a list of products that they can add to their shopping cart to be purchased at a later date, or share with friends. diff --git a/app/code/Magento/WishlistAnalytics/README.md b/app/code/Magento/WishlistAnalytics/README.md index c932397e0803a..275acf0796286 100644 --- a/app/code/Magento/WishlistAnalytics/README.md +++ b/app/code/Magento/WishlistAnalytics/README.md @@ -1,12 +1,3 @@ # Magento_WishlistAnalytics module -The Magento_WishlistAnalytics module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). - -## Installation details - -Before installing this module, note that the Magento_WishlistAnalytics is dependent on the following modules: - -- Magento_Analytics -- Magento_Wishlist - -For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). +The Magento_WishlistAnalytics module configures data definitions for a data collection related to the Wishlist module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). diff --git a/app/code/Magento/WishlistGraphQl/README.md b/app/code/Magento/WishlistGraphQl/README.md index c635417f3a6ec..9121593e6a759 100644 --- a/app/code/Magento/WishlistGraphQl/README.md +++ b/app/code/Magento/WishlistGraphQl/README.md @@ -1,42 +1,4 @@ -# Magento_WishlistGraphQl module +# WishlistGraphQl -The Magento_WishlistGraphQl module adds, removes, and updates products on the wishlist. - -The Magento_WishlistGraphQl module extends Magento_GraphQl and Magento_Wishlist modules. This module provides type and resolver information for GraphQL API. - -## Installation details - -Before installing this module, note that the Magento_WishlistGraphQl is dependent on the following modules: - -- Magento_Catalog -- Magento_Checkout -- Magento_Customer -- Magento_CustomerGraphQl -- Magento_Directory -- Magento_GiftMessage -- Magento_GraphQl -- Magento_Quote -- Magento_Sales -- Magento_Store - -For information about enabling or disabling a module, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). - -## Extensibility - -Extension developers can interact with the Magento_WishlistGraphQl module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). - -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_WishlistGraphQl module. - -## Additional information - -For more information about the Magento_WishlistGraphQl [Queries](#queries) and [Mutations](#mutations) see below: - -### Queries {#queries} - -- [`wishlist`](https://devdocs.magento.com/guides/v2.4/graphql/queries/wishlist.html) - -### Mutations {#mutations} - -- [`addProductsToWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/add-products-to-wishlist.html) -- [`removeProductsFromWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/remove-products-from-wishlist.html) -- [`updateProductsInWishlist`](https://devdocs.magento.com/guides/v2.4/graphql/mutations/update-products-in-wishlist.html) +**WishlistGraphQl** provides type information for the GraphQl module +to generate wishlist fields. diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index ef55c71b06281..3f3c326beb5a5 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -207,7 +207,7 @@ public function testCreate() ->method('getColumnName') ->willReturn('entity_id'); - $this->viewMock->expects($this->atLeastOnce()) + $this->viewMock->expects($this->exactly(3)) ->method('getChangelog') ->willReturn($changelogMock); @@ -243,23 +243,20 @@ public function testCreate() $otherViewMock->expects($this->exactly(1)) ->method('getId') ->willReturn('other_id'); - $otherViewMock->expects($this->exactly(4)) + $otherViewMock->expects($this->exactly(1)) ->method('getSubscriptions') - ->willReturn( - [ - $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], - 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] - ] - ); - $otherViewMock->expects($this->atLeastOnce()) + ->willReturn([['name' => $this->tableName], ['name' => 'otherTableName']]); + $otherViewMock->expects($this->exactly(3)) ->method('getChangelog') ->willReturn($otherChangelogMock); $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); + $this->viewMock->expects($this->never()) + ->method('getSubscriptions'); - $this->viewCollectionMock->expects($this->once()) + $this->viewCollectionMock->expects($this->exactly(1)) ->method('getViewsByStateMode') ->with(StateInterface::MODE_ENABLED) ->willReturn([$this->viewMock, $otherViewMock]); @@ -271,16 +268,6 @@ public function testCreate() $this->connectionMock->expects($this->exactly(3)) ->method('createTrigger') ->with($triggerMock); - - $this->viewMock->expects($this->exactly(3)) - ->method('getSubscriptions') - ->willReturn( - [ - $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], - 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] - ] - ); - $this->model->create(); } @@ -332,24 +319,21 @@ public function testRemove() true, [] ); - $otherViewMock->expects($this->atLeastOnce()) + $otherViewMock->expects($this->exactly(1)) ->method('getId') ->willReturn('other_id'); - $otherViewMock->expects($this->atLeastOnce()) + $otherViewMock->expects($this->exactly(1)) + ->method('getSubscriptions') + ->willReturn([['name' => $this->tableName], ['name' => 'otherTableName']]); + $otherViewMock->expects($this->exactly(3)) ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->atLeastOnce()) + $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); - $otherViewMock->expects($this->atLeastOnce()) - ->method('getSubscriptions') - ->willReturn( - [ - $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], - 'otherTableName' => ['name' => 'otherTableName', 'column' => 'columnName'] - ] - ); + $this->viewMock->expects($this->never()) + ->method('getSubscriptions'); $this->viewCollectionMock->expects($this->exactly(1)) ->method('getViewsByStateMode') @@ -427,18 +411,6 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ->method('getColumnName') ->willReturn('entity_id'); - $this->viewMock->expects($this->once()) - ->method('getSubscriptions') - ->willReturn( - [ - $this->tableName => ['name' => $this->tableName, 'column' => 'columnName'], - 'cataloginventory_stock_item' => ['name' => 'otherTableName', 'column' => 'columnName'] - ] - ); - $this->viewMock->expects($this->atLeastOnce()) - ->method('getChangeLog') - ->willReturn($otherChangelogMock); - $model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, @@ -453,7 +425,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void $method = new \ReflectionMethod($model, 'buildStatement'); $method->setAccessible(true); - $statement = $method->invoke($model, Trigger::EVENT_UPDATE, $this->viewMock); + $statement = $method->invoke($model, Trigger::EVENT_UPDATE, $otherChangelogMock); $this->assertStringNotContainsString($ignoredColumnName, $statement); $this->assertStringContainsString($notIgnoredColumnName, $statement); diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 03a3bf9615ced..17e4dede4cbf8 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -8,31 +8,29 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Trigger; -use Magento\Framework\DB\Ddl\TriggerFactory; use Magento\Framework\Mview\Config; -use Magento\Framework\Mview\ViewInterface; +use Magento\Framework\Mview\View\StateInterface; /** - * Mview subscription. + * Class Subscription for handling partial indexation triggers */ class Subscription implements SubscriptionInterface { /** * Database connection * - * @var AdapterInterface + * @var \Magento\Framework\DB\Adapter\AdapterInterface */ protected $connection; /** - * @var TriggerFactory + * @var \Magento\Framework\DB\Ddl\TriggerFactory */ protected $triggerFactory; /** - * @var CollectionInterface + * @var \Magento\Framework\Mview\View\CollectionInterface */ protected $viewCollection; @@ -64,7 +62,7 @@ class Subscription implements SubscriptionInterface * * @var array */ - private $ignoredUpdateColumns; + private $ignoredUpdateColumns = []; /** * List of columns that can be updated in a specific subscribed table @@ -76,7 +74,6 @@ class Subscription implements SubscriptionInterface * @var Resource */ protected $resource; - /** * @var Config */ @@ -84,9 +81,9 @@ class Subscription implements SubscriptionInterface /** * @param ResourceConnection $resource - * @param TriggerFactory $triggerFactory - * @param CollectionInterface $viewCollection - * @param ViewInterface $view + * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory + * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection + * @param \Magento\Framework\Mview\ViewInterface $view * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns @@ -95,9 +92,9 @@ class Subscription implements SubscriptionInterface */ public function __construct( ResourceConnection $resource, - TriggerFactory $triggerFactory, - CollectionInterface $viewCollection, - ViewInterface $view, + \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory, + \Magento\Framework\Mview\View\CollectionInterface $viewCollection, + \Magento\Framework\Mview\ViewInterface $view, $tableName, $columnName, $ignoredUpdateColumns = [], @@ -117,9 +114,9 @@ public function __construct( } /** - * Create subscription + * Create subsciption * - * @return SubscriptionInterface + * @return \Magento\Framework\Mview\View\SubscriptionInterface */ public function create() { @@ -132,12 +129,12 @@ public function create() ->setEvent($event) ->setTable($this->resource->getTableName($this->tableName)); - $trigger->addStatement($this->buildStatement($event, $this->getView())); + $trigger->addStatement($this->buildStatement($event, $this->getView()->getChangelog())); // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - /** @var ViewInterface $view */ - $trigger->addStatement($this->buildStatement($event, $view)); + /** @var \Magento\Framework\Mview\ViewInterface $view */ + $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); } $this->connection->dropTrigger($trigger->getName()); @@ -150,7 +147,7 @@ public function create() /** * Remove subscription * - * @return SubscriptionInterface + * @return \Magento\Framework\Mview\View\SubscriptionInterface */ public function remove() { @@ -165,8 +162,8 @@ public function remove() // Add statements for linked views foreach ($this->getLinkedViews() as $view) { - /** @var ViewInterface $view */ - $trigger->addStatement($this->buildStatement($event, $view)); + /** @var \Magento\Framework\Mview\ViewInterface $view */ + $trigger->addStatement($this->buildStatement($event, $view->getChangelog())); } $this->connection->dropTrigger($trigger->getName()); @@ -191,7 +188,7 @@ protected function getLinkedViews() $viewList = $this->viewCollection->getViewsByStateMode(StateInterface::MODE_ENABLED); foreach ($viewList as $view) { - /** @var ViewInterface $view */ + /** @var \Magento\Framework\Mview\ViewInterface $view */ // Skip the current view if ($view->getId() == $this->getView()->getId()) { continue; @@ -211,14 +208,13 @@ protected function getLinkedViews() /** * Prepare columns for trigger statement. Should be protected in order to serve new approach * - * @param ViewInterface $view + * @param ChangelogInterface $changelog * @param string $event * @return array * @throws \Exception */ - protected function prepareColumns(ViewInterface $view, string $event): array + protected function prepareColumns(ChangelogInterface $changelog, string $event): array { - $changelog = $view->getChangelog(); $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; $subscriptionData = $this->mviewConfig->getView($changelog->getViewId())['subscriptions'][$this->getTableName()]; $columns = [ @@ -226,7 +222,7 @@ protected function prepareColumns(ViewInterface $view, string $event): array 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) ], 'column_values' => [ - 'entity_id' => $this->getEntityColumn($prefix, $view) + 'entity_id' => $this->getEntityColumn($prefix) ] ]; @@ -245,14 +241,12 @@ protected function prepareColumns(ViewInterface $view, string $event): array * Build trigger statement for INSERT, UPDATE, DELETE events * * @param string $event - * @param ViewInterface $view + * @param \Magento\Framework\Mview\View\ChangelogInterface $changelog * @return string */ - protected function buildStatement(string $event, ViewInterface $view): string + protected function buildStatement($event, $changelog) { $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; - $changelog = $view->getChangelog(); - switch ($event) { case Trigger::EVENT_UPDATE: $tableName = $this->resource->getTableName($this->getTableName()); @@ -285,14 +279,13 @@ protected function buildStatement(string $event, ViewInterface $view): string } break; } - $columns = $this->prepareColumns($view, $event); - + $columns = $this->prepareColumns($changelog, $event); return sprintf( $trigger, $this->getProcessor()->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - implode(', ', $columns['column_names']), - implode(', ', $columns['column_values']) + implode(", " , $columns['column_names']), + implode(", ", $columns['column_values']) ); } @@ -319,28 +312,11 @@ private function getProcessor(): AdditionalColumnProcessorInterface /** * @param string $prefix - * @param ViewInterface $view - * @return string - */ - public function getEntityColumn(string $prefix, ViewInterface $view): string - { - return $prefix . $this->connection->quoteIdentifier($this->getSubscriptionColumn($view)); - } - - /** - * Returns subscription column name by view - * - * @param ViewInterface $view * @return string */ - private function getSubscriptionColumn(ViewInterface $view): string + public function getEntityColumn(string $prefix): string { - $subscriptions = $view->getSubscriptions(); - if (!isset($subscriptions[$this->getTableName()]['column'])) { - throw new \RuntimeException(sprintf('Column name for view with id "%s" doesn\'t exist', $view->getId())); - } - - return $subscriptions[$this->getTableName()]['column']; + return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); } /** @@ -362,7 +338,7 @@ private function getAfterEventTriggerName($event) /** * Retrieve View related to subscription * - * @return ViewInterface + * @return \Magento\Framework\Mview\ViewInterface * @codeCoverageIgnore */ public function getView()