From dcc6381a921ee5225e46ef05b6d9e2386e663a1c Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Mon, 13 Apr 2020 11:23:49 -0400 Subject: [PATCH 001/490] Added super_group extension attribute to Magento\Quote\Api\Data\ProductOptionInterface to allow user to send associated product quantities when adding to cart via REST API Added a 'grouped' cartItemProcessors to the Magento\Quote\Model\Quote\Item\Repository to reformat the super_group extension attribute into a format that is compatible with buy request --- .../Api/Data/GroupedItemQtyInterface.php | 33 +++++++++ .../Model/Quote/Item/CartItemProcessor.php | 70 +++++++++++++++++++ .../Model/Quote/Item/GroupedItemQty.php | 48 +++++++++++++ app/code/Magento/GroupedProduct/etc/di.xml | 9 +++ .../etc/extension_attributes.xml | 4 ++ 5 files changed, 164 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php create mode 100644 app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php create mode 100644 app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php new file mode 100644 index 0000000000000..dc7cf50168419 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php @@ -0,0 +1,33 @@ +objectFactory = $objectFactory; + } + + /** + * @param CartItemInterface $cartItem + * + * @return \Magento\Framework\DataObject|null + */ + public function convertToBuyRequest(CartItemInterface $cartItem) + { + $productOption = $cartItem->getProductOption(); + if ($productOption instanceof ProductOptionInterface && $productOption->getExtensionAttributes()) { + $superGroup = $productOption->getExtensionAttributes()->getSuperGroup(); + if (is_array($superGroup)) { + $requestData = []; + + /** @var GroupedItemQty $item */ + foreach ($superGroup as $item) { + if (!isset($requestData['super_group'])) { + $requestData['super_group'] = []; + } + + $requestData['super_group'][$item->getProductId()] = $item->getQty(); + } + + if (!empty($requestData)) { + return $this->objectFactory->create($requestData); + } + } + } + + return null; + } + + /** + * @param CartItemInterface $cartItem + * + * @return CartItemInterface + */ + public function processOptions(CartItemInterface $cartItem) + { + return $cartItem; + } +} diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php new file mode 100644 index 0000000000000..55b978b60fd6d --- /dev/null +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php @@ -0,0 +1,48 @@ +setData(self::PRODUCT_ID, $value); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getProductId() + { + return $this->getData(self::PRODUCT_ID); + } + + /** + * {@inheritdoc} + */ + public function setQty($qty) + { + $this->setData(self::QTY, $qty); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getQty() + { + return (int)$this->getData(self::QTY); + } +} \ No newline at end of file diff --git a/app/code/Magento/GroupedProduct/etc/di.xml b/app/code/Magento/GroupedProduct/etc/di.xml index 43678d0ad7a82..71ce81947383b 100644 --- a/app/code/Magento/GroupedProduct/etc/di.xml +++ b/app/code/Magento/GroupedProduct/etc/di.xml @@ -6,6 +6,8 @@ */ --> + + @@ -105,4 +107,11 @@ + + + + Magento\GroupedProduct\Model\Quote\Item\CartItemProcessor\Proxy + + + diff --git a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml index 14ff9821025c4..55a41babc4ace 100644 --- a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml +++ b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml @@ -9,4 +9,8 @@ + + + + From de1f6262870dd84dddac687377b8edca59f266a0 Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Tue, 14 Apr 2020 01:29:58 -0400 Subject: [PATCH 002/490] In Magento\GroupedProduct\Model\Quote\Item\CartItemProcessor updated the var to be private --- .../GroupedProduct/Model/Quote/Item/CartItemProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 9862bf5d23246..fa4abdfcba3b6 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -15,7 +15,7 @@ class CartItemProcessor implements CartItemProcessorInterface /** * @var ObjectFactory */ - protected $objectFactory; + private $objectFactory; /** * CartItemProcessor constructor. From 8d2c2804038efd2f6fdd5690d62a6f180440c71b Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Sat, 18 Apr 2020 20:26:56 -0400 Subject: [PATCH 003/490] Added copyright notices, end blank lines, extension attributes getter/setter, and method descriptions in GroupedItemQtyInterface, GroupedItemQty, and CartItemProcessor --- .../Api/Data/GroupedItemQtyInterface.php | 33 ++++++++++- .../Model/Quote/Item/CartItemProcessor.php | 13 ++++- .../Model/Quote/Item/GroupedItemQty.php | 55 +++++++++++++++++-- 3 files changed, 91 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php index dc7cf50168419..5be44abc5b2c0 100644 --- a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php @@ -1,33 +1,60 @@ getData(self::QTY); } -} \ No newline at end of file + + /** + * Set extension attributes + * + * @param GroupedItemQtyExtensionInterface $extensionAttributes + * + * @return $this + */ + public function setExtensionAttributes(GroupedItemQtyExtensionInterface $extensionAttributes) + { + $this->_setExtensionAttributes($extensionAttributes); + + return $this; + } + + /** + * Get extension attributes + * + * @return GroupedItemQtyExtensionInterface|null + */ + public function getExtensionAttributes() + { + return $this->_getExtensionAttributes(); + } +} From e9fa0a8baa9672796a7a99a51b3586f802dcded2 Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Sun, 19 Apr 2020 07:33:21 -0400 Subject: [PATCH 004/490] Added in missing method short descriptions in GroupedItemQtyInterface and CartItemProcessor --- .../GroupedProduct/Api/Data/GroupedItemQtyInterface.php | 4 ++++ .../GroupedProduct/Model/Quote/Item/CartItemProcessor.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php index 5be44abc5b2c0..8f656a7e0c634 100644 --- a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php @@ -45,6 +45,8 @@ public function setQty($qty); public function getQty(); /** + * Set extension attributes + * * @param \Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface $extensionAttributes * * @return $this @@ -54,6 +56,8 @@ public function setExtensionAttributes( ); /** + * Get extension attributes + * * @return \Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface|null */ public function getExtensionAttributes(); diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 1b265d294c92a..2de744ce59804 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -34,7 +34,6 @@ public function __construct(ObjectFactory $objectFactory) } /** - * * Converts the super_group request data into the same format as native frontend add-to-cart * * @param CartItemInterface $cartItem From d5160db59db56b85bcfaf4938b035c94a574bb0d Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Sun, 19 Apr 2020 11:20:49 -0400 Subject: [PATCH 005/490] Chopped down long class description to be less than 120 chars --- .../GroupedProduct/Model/Quote/Item/CartItemProcessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 2de744ce59804..1138bed2b123d 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -12,7 +12,8 @@ use Magento\Quote\Model\Quote\Item\CartItemProcessorInterface; /** - * A class that converts the Grouped Product super group, as received over RESTful API, into the format needed within the buy request + * A class that converts the Grouped Product super group, as received over RESTful API, + * into the format needed within the buy request * * Class \Magento\GroupedProduct\Model\Quote\Item\CartItemProcessor */ From fb9f52daa532b4020a9cb5a805ab1e2df87560d5 Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Mon, 29 Jun 2020 18:05:14 -0300 Subject: [PATCH 006/490] Fix for communication.xml Handlers merging processs --- .../Framework/Communication/Config/Reader/XmlReader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php index 3c5e9ca2539dc..7a6463a323580 100644 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php +++ b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php @@ -16,7 +16,8 @@ class XmlReader extends \Magento\Framework\Config\Reader\Filesystem * @var array */ protected $_idAttributes = [ - '/config/topic' => 'name' + '/config/topic' => 'name', + '/config/topic/handler' => 'name' ]; /** From aa12503923ac994873724ecaa759e1eb14b318dc Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Wed, 8 Jul 2020 10:44:26 +0100 Subject: [PATCH 007/490] Add warning to deadlock cron retrier to log any future failures for investigation Change key for cron_schedule to cover all queries currently run, ensuring range is on the end of the key Refactor cron locking to remove UPDATE+JOIN which causes shared locks on the join followed by exclusive locks for the update, which can deadlock, to instead use an explicit full exclusive lock on all entries using forUpdate Implement cleanup of jobs that were running but did not complete and did not error, which can occur if PHP crashes or is killed, or database is restored from backup or migrated to staging environments --- .../Magento/Cron/Model/DeadlockRetrier.php | 15 ++++++++ .../Cron/Model/ResourceModel/Schedule.php | 36 +++++++++++++------ .../Observer/ProcessCronQueueObserver.php | 30 ++++++++++++++++ .../Test/Unit/Model/DeadlockRetrierTest.php | 13 ++++++- .../Observer/ProcessCronQueueObserverTest.php | 26 +++++++++++--- app/code/Magento/Cron/etc/db_schema.xml | 6 ++-- 6 files changed, 107 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Cron/Model/DeadlockRetrier.php b/app/code/Magento/Cron/Model/DeadlockRetrier.php index 15497910a089b..63f7453c8df3c 100644 --- a/app/code/Magento/Cron/Model/DeadlockRetrier.php +++ b/app/code/Magento/Cron/Model/DeadlockRetrier.php @@ -17,6 +17,20 @@ */ class DeadlockRetrier implements DeadlockRetrierInterface { + /** + * @var \Psr\Log\LoggerInterface + */ + private $logger; + + /** + * @param \Psr\Log\LoggerInterface $logger + */ + public function __construct( + \Psr\Log\LoggerInterface $logger + ) { + $this->logger = $logger; + } + /** * @inheritdoc */ @@ -30,6 +44,7 @@ public function execute(callable $callback, AdapterInterface $connection) try { return $callback(); } catch (DeadlockException $e) { + $this->logger->warning(sprintf("Deadlock detected in cron cleanup: %s", $e->getMessage())); continue; } } diff --git a/app/code/Magento/Cron/Model/ResourceModel/Schedule.php b/app/code/Magento/Cron/Model/ResourceModel/Schedule.php index 25ebaec5582c9..120e0ce6432c5 100644 --- a/app/code/Magento/Cron/Model/ResourceModel/Schedule.php +++ b/app/code/Magento/Cron/Model/ResourceModel/Schedule.php @@ -65,31 +65,47 @@ public function trySetJobStatusAtomic($scheduleId, $newStatus, $currentStatus) public function trySetJobUniqueStatusAtomic($scheduleId, $newStatus, $currentStatus) { $connection = $this->getConnection(); + $connection->beginTransaction(); // this condition added to avoid cron jobs locking after incorrect termination of running job $match = $connection->quoteInto( 'existing.job_code = current.job_code ' . - 'AND (existing.executed_at > UTC_TIMESTAMP() - INTERVAL 1 DAY OR existing.executed_at IS NULL) ' . - 'AND existing.status = ?', + 'AND existing.status = ? ' . + 'AND (existing.executed_at > UTC_TIMESTAMP() - INTERVAL 1 DAY OR existing.executed_at IS NULL)', $newStatus ); + // Select and lock all related schedules - this prevents deadlock in case cron overlaps and two jobs of + // the same code attempt to lock at the same time, and force them to serialize $selectIfUnlocked = $connection->select() + ->from( + ['current' => $this->getTable('cron_schedule')], + [] + ) ->joinLeft( ['existing' => $this->getTable('cron_schedule')], $match, - ['status' => new \Zend_Db_Expr($connection->quote($newStatus))] + ['existing.schedule_id'] ) ->where('current.schedule_id = ?', $scheduleId) ->where('current.status = ?', $currentStatus) - ->where('existing.schedule_id IS NULL'); - - $update = $connection->updateFromSelect($selectIfUnlocked, ['current' => $this->getTable('cron_schedule')]); - $result = $connection->query($update)->rowCount(); + ->forUpdate(true); - if ($result == 1) { - return true; + $scheduleId = $connection->fetchOne($selectIfUnlocked); + if (!empty($scheduleId)) { + // Existing running schedule found + $connection->commit(); + return false; } - return false; + + // Mark our schedule as running + $connection->update( + $this->getTable('cron_schedule'), + ['status' => new \Zend_Db_Expr($connection->quote($newStatus))], + ['schedule_id = ?' => $scheduleId] + ); + + $connection->commit(); + return true; } } diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index acffba02eb461..a6a8f77c039d8 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -550,6 +550,7 @@ private function cleanupJobs($groupId, $currentTime) ); $this->cleanupDisabledJobs($groupId); + $this->cleanupRunningJobs($groupId); $historySuccess = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_SUCCESS); $historyFailure = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_FAILURE); @@ -696,6 +697,35 @@ private function cleanupDisabledJobs($groupId) } } + /** + * Cleanup jobs that were left in a running state due to an unexpected stop + * + * @param string $groupId + * @return void + */ + private function cleanupRunningJobs($groupId) + { + $scheduleResource = $this->_scheduleFactory->create()->getResource(); + $connection = $scheduleResource->getConnection(); + + $jobs = $this->_config->getJobs(); + + $connection->update( + $scheduleResource->getMainTable(), + [ + 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, + 'messages' => 'Time out' + ], + $connection->quoteInto( + 'status = ? ' . + 'AND job_code IN (?) ' . + 'AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', + \Magento\Cron\Model\Schedule::STATUS_RUNNING, + array_keys($jobs[$groupId]) + ) + ); + } + /** * Get cron expression of cron job. * diff --git a/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php b/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php index 60eaa091a761f..36e4537383aa6 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php @@ -13,6 +13,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\DeadlockException; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase { @@ -27,6 +28,11 @@ class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase */ private $adapterMock; + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + /** * @var AbstractModel|MockObject */ @@ -38,8 +44,9 @@ class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { $this->adapterMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->modelMock = $this->createMock(AbstractModel::class); - $this->retrier = new DeadlockRetrier(); + $this->retrier = new DeadlockRetrier($this->loggerMock); } /** @@ -75,6 +82,8 @@ public function testRetry(): void $this->modelMock->expects($this->exactly(DeadlockRetrierInterface::MAX_RETRIES)) ->method('getId') ->willThrowException(new DeadlockException()); + $this->loggerMock->expects($this->exactly(DeadlockRetrierInterface::MAX_RETRIES - 1)) + ->method('warning'); $this->retrier->execute( function () { @@ -95,6 +104,8 @@ public function testRetrySecond(): void $this->modelMock->expects($this->at(1)) ->method('getId') ->willReturn(2); + $this->loggerMock->expects($this->once()) + ->method('warning'); $this->retrier->execute( function () { diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index e1e28ff6f06a3..9414680ce0e45 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1047,8 +1047,8 @@ public function testMissedJobsCleanedInTime() $this->scheduleCollectionMock->expects($this->any())->method('load')->willReturnSelf(); $scheduleMock->expects($this->any())->method('getCollection')->willReturn($this->scheduleCollectionMock); - $scheduleMock->expects($this->exactly(9))->method('getResource')->willReturn($this->scheduleResourceMock); - $this->scheduleFactoryMock->expects($this->exactly(10))->method('create')->willReturn($scheduleMock); + $scheduleMock->expects($this->exactly(10))->method('getResource')->willReturn($this->scheduleResourceMock); + $this->scheduleFactoryMock->expects($this->exactly(11))->method('create')->willReturn($scheduleMock); $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); @@ -1078,11 +1078,29 @@ public function testMissedJobsCleanedInTime() ) ->willReturn(1); - $this->scheduleResourceMock->expects($this->exactly(5)) + $connectionMock->expects($this->once()) + ->method('quoteInto') + ->with( + 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', + ['test_job1'], + 'running' + ) + ->willReturn(''); + + $connectionMock->expects($this->once()) + ->method('update') + ->with( + $tableName, + ['status' => 'error', 'messages' => 'Time out'], + '' + ) + ->willReturn(0); + + $this->scheduleResourceMock->expects($this->exactly(6)) ->method('getTable') ->with($tableName) ->willReturn($tableName); - $this->scheduleResourceMock->expects($this->exactly(14)) + $this->scheduleResourceMock->expects($this->exactly(15)) ->method('getConnection') ->willReturn($connectionMock); diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index f26b6feea3b3b..527cdbcc5fb86 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -21,12 +21,10 @@ - + + - - - From 2806d48437a7504bb0fcf2890717016c8c1b1949 Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Wed, 8 Jul 2020 14:22:18 +0300 Subject: [PATCH 008/490] Add DB schema --- app/code/Magento/Catalog/etc/db_schema.xml | 25 +++++++++++++++++++ .../Catalog/etc/db_schema_whitelist.json | 23 ++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index a0aa48fb76b13..bde69cbb5d1ff 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -547,6 +547,8 @@ default="0" comment="Product ID"/> + @@ -558,6 +560,8 @@ referenceColumn="entity_id" onDelete="CASCADE"/> + @@ -573,6 +577,27 @@ + + + + + + + + + + + + + + + +
Date: Wed, 8 Jul 2020 18:58:11 +0300 Subject: [PATCH 009/490] add list_id during comparing products --- .../Magento/Catalog/Model/CompareList.php | 24 +++ .../Model/Product/Compare/AddToList.php | 137 ++++++++++++++++++ .../Model/Product/Compare/ListCompare.php | 10 ++ .../Model/ResourceModel/CompareList.php | 23 +++ 4 files changed, 194 insertions(+) create mode 100644 app/code/Magento/Catalog/Model/CompareList.php create mode 100644 app/code/Magento/Catalog/Model/Product/Compare/AddToList.php create mode 100644 app/code/Magento/Catalog/Model/ResourceModel/CompareList.php diff --git a/app/code/Magento/Catalog/Model/CompareList.php b/app/code/Magento/Catalog/Model/CompareList.php new file mode 100644 index 0000000000000..363266d0ce233 --- /dev/null +++ b/app/code/Magento/Catalog/Model/CompareList.php @@ -0,0 +1,24 @@ +_init(\Magento\Catalog\Model\ResourceModel\CompareList::class); + } +} diff --git a/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php b/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php new file mode 100644 index 0000000000000..5331f92b02ee7 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php @@ -0,0 +1,137 @@ +compareListFactory = $compareListFactory; + $this->compareList = $compareList; + $this->compareListResource = $compareListResource; + $this->customerSession = $customerSession; + $this->customerVisitor = $customerVisitor; + } + + /** + * Get list_id + * + * @return int + */ + public function execute() + { + if ($this->customerSession->isLoggedIn()) { + return $this->getListIdByCustomerId(); + } + + return $this->getListIdByVisitorId(); + } + + /** + * Get list_id for visitor + * + * @return int + */ + private function getListIdByVisitorId() + { + + $visitorId = $this->customerVisitor->getId(); + $compareListModel = $this->compareListFactory->create(); + $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); + if ($compareListId = $compareListModel->getId()) { + return (int)$compareListId; + } + + return $this->createCompareList($visitorId, null); + } + + /** + * Get list_id for logged customers + * + * @return int + */ + private function getListIdByCustomerId() + { + $customerId = $this->customerSession->getCustomerId(); + $compareListModel = $this->compareListFactory->create(); + $this->compareListResource->load($compareListModel, $customerId, 'customer_id'); + + if ($compareListId = $compareListModel->getId()) { + return (int)$compareListId; + } + + return $this->createCompareList(0, $customerId); + } + + /** + * Create new compare list + * + * @param $visitorId + * @param $customerId + * + * @return int + */ + private function createCompareList($visitorId, $customerId) + { + /* @var $compareList CompareList */ + $compareList = $this->compareListFactory->create(); + $compareList->setVisitorId($visitorId); + $compareList->setCustomerId($customerId); + $compareList->save(); + + return (int)$compareList->getId(); + } +} diff --git a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php index 9ccb86441812c..71015c87832bd 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php @@ -60,6 +60,11 @@ class ListCompare extends \Magento\Framework\DataObject */ private $productRepository; + /** + * @var AddToList + */ + private $addToCompareList; + /** * Constructor * @@ -68,6 +73,7 @@ class ListCompare extends \Magento\Framework\DataObject * @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Visitor $customerVisitor + * @param \Magento\Catalog\Model\Product\Compare\AddToList * @param array $data * @param ProductRepository|null $productRepository */ @@ -77,6 +83,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Visitor $customerVisitor, + \Magento\Catalog\Model\Product\Compare\AddToList $addToList, array $data = [], ProductRepository $productRepository = null ) { @@ -85,6 +92,7 @@ public function __construct( $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_customerSession = $customerSession; $this->_customerVisitor = $customerVisitor; + $this->addToCompareList = $addToList; $this->productRepository = $productRepository ?: ObjectManager::getInstance()->create(ProductRepository::class); parent::__construct($data); } @@ -102,9 +110,11 @@ public function addProduct($product) $item = $this->_compareItemFactory->create(); $this->_addVisitorToItem($item); $item->loadByProduct($product); + $listId = $this->addToCompareList->execute(); if (!$item->getId() && $this->productExists($product)) { $item->addProductData($product); + $item->setListId($listId); $item->save(); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php b/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php new file mode 100644 index 0000000000000..c7ff5e4963214 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php @@ -0,0 +1,23 @@ +_init('catalog_compare_list', 'list_id'); + } +} From 2fe99e93914d4b2c2a548c97ef34dca391f64ddb Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Thu, 16 Jul 2020 15:37:02 +0300 Subject: [PATCH 010/490] set customer for compare list during login --- .../Model/Product/Compare/AddToList.php | 19 ++++++++++++++- .../ResourceModel/Product/Compare/Item.php | 23 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php b/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php index 5331f92b02ee7..686e3d4edd89a 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php @@ -80,6 +80,24 @@ public function execute() return $this->getListIdByVisitorId(); } + /** + * Set customer from visitor + */ + public function setCustomerFromVisitor() + { + $customerId = $this->customerSession->getCustomerId(); + + if (!$customerId) { + return $this; + } + + $visitorId = $this->customerVisitor->getId(); + $compareListModel = $this->compareListFactory->create(); + $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); + $compareListModel->setCustomerId($customerId); + $compareListModel->save(); + } + /** * Get list_id for visitor * @@ -87,7 +105,6 @@ public function execute() */ private function getListIdByVisitorId() { - $visitorId = $this->customerVisitor->getId(); $compareListModel = $this->compareListFactory->create(); $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php index 7eb0552e355fc..60b3f5c71c92f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php @@ -5,6 +5,9 @@ */ namespace Magento\Catalog\Model\ResourceModel\Product\Compare; +use Magento\Catalog\Model\Product\Compare\AddToList; +use Magento\Framework\Model\ResourceModel\Db\Context; + /** * Catalog compare item resource model * @@ -12,6 +15,11 @@ */ class Item extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { + /** + * @var AddToList + */ + private $compareList; + /** * Initialize connection * @@ -22,6 +30,20 @@ protected function _construct() $this->_init('catalog_compare_item', 'catalog_compare_item_id'); } + /** + * @param AddToList $addToList + * @param Context $context + * @param null $connectionName + */ + public function __construct( + AddToList $addToList, + Context $context, + $connectionName = null + ) { + $this->compareList = $addToList; + parent::__construct($context, $connectionName); + } + /** * Load object by product * @@ -213,6 +235,7 @@ public function updateCustomerFromVisitor($object) $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $itemId) ); } + $this->compareList->setCustomerFromVisitor(); } return $this; From b0b72b0f8486ca119015e84b7786dfab13d2e475 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Thu, 16 Jul 2020 14:53:52 +0100 Subject: [PATCH 011/490] Higher cardinality first after tested shown still no deadlocks --- app/code/Magento/Cron/etc/db_schema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index 527cdbcc5fb86..72b1428756898 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -21,9 +21,9 @@ - - + +
From 1fd3c5b6fd372fa9196e4175ac7d04175b93e4eb Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Wed, 12 Aug 2020 17:22:50 +0300 Subject: [PATCH 012/490] changes based on review --- .../{AddToList.php => CompareList.php} | 76 ++++--------------- .../Model/Product/Compare/ListCompare.php | 12 +-- .../ResourceModel/Product/Compare/Item.php | 47 ++++++++++-- 3 files changed, 62 insertions(+), 73 deletions(-) rename app/code/Magento/Catalog/Model/Product/Compare/{AddToList.php => CompareList.php} (55%) diff --git a/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php b/app/code/Magento/Catalog/Model/Product/Compare/CompareList.php similarity index 55% rename from app/code/Magento/Catalog/Model/Product/Compare/AddToList.php rename to app/code/Magento/Catalog/Model/Product/Compare/CompareList.php index 686e3d4edd89a..5fab205bbdabe 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/AddToList.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/CompareList.php @@ -8,104 +8,59 @@ namespace Magento\Catalog\Model\Product\Compare; -use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareList as CatalogCompareList; use Magento\Catalog\Model\CompareListFactory; use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; -use Magento\Customer\Model\Session; -use Magento\Customer\Model\Visitor; -class AddToList +class CompareList { /** * @var CompareListFactory */ private $compareListFactory; - /** - * @var CompareList - */ - private $compareList; - /** * @var CompareListResource */ private $compareListResource; - /** - * Customer session - * - * @var Session - */ - private $customerSession; - - /** - * Customer visitor - * - * @var Visitor - */ - private $customerVisitor; - /** * @param CompareListFactory $compareListFactory - * @param CompareList $compareList * @param CompareListResource $compareListResource - * @param Session $customerSession - * @param Visitor $customerVisitor */ public function __construct( CompareListFactory $compareListFactory, - CompareList $compareList, - CompareListResource $compareListResource, - Session $customerSession, - Visitor $customerVisitor + CompareListResource $compareListResource ) { $this->compareListFactory = $compareListFactory; - $this->compareList = $compareList; $this->compareListResource = $compareListResource; - $this->customerSession = $customerSession; - $this->customerVisitor = $customerVisitor; } /** * Get list_id * + * @param Item $item + * * @return int */ - public function execute() - { - if ($this->customerSession->isLoggedIn()) { - return $this->getListIdByCustomerId(); - } - - return $this->getListIdByVisitorId(); - } - - /** - * Set customer from visitor - */ - public function setCustomerFromVisitor() + public function getListId(Item $item) { - $customerId = $this->customerSession->getCustomerId(); - - if (!$customerId) { - return $this; + if ($customerId = $item->getCustomerId()) { + return $this->getListIdByCustomerId($customerId); } - $visitorId = $this->customerVisitor->getId(); - $compareListModel = $this->compareListFactory->create(); - $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); - $compareListModel->setCustomerId($customerId); - $compareListModel->save(); + return $this->getListIdByVisitorId($item->getVisitorId()); } /** * Get list_id for visitor * + * @param $visitorId + * * @return int */ - private function getListIdByVisitorId() + private function getListIdByVisitorId($visitorId) { - $visitorId = $this->customerVisitor->getId(); $compareListModel = $this->compareListFactory->create(); $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); if ($compareListId = $compareListModel->getId()) { @@ -118,11 +73,12 @@ private function getListIdByVisitorId() /** * Get list_id for logged customers * + * @param $customerId + * * @return int */ - private function getListIdByCustomerId() + private function getListIdByCustomerId($customerId) { - $customerId = $this->customerSession->getCustomerId(); $compareListModel = $this->compareListFactory->create(); $this->compareListResource->load($compareListModel, $customerId, 'customer_id'); @@ -143,7 +99,7 @@ private function getListIdByCustomerId() */ private function createCompareList($visitorId, $customerId) { - /* @var $compareList CompareList */ + /* @var $compareList CatalogCompareList */ $compareList = $this->compareListFactory->create(); $compareList->setVisitorId($visitorId); $compareList->setCustomerId($customerId); diff --git a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php index 71015c87832bd..7c2ad694132b9 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php @@ -61,9 +61,9 @@ class ListCompare extends \Magento\Framework\DataObject private $productRepository; /** - * @var AddToList + * @var CompareList */ - private $addToCompareList; + private $compareList; /** * Constructor @@ -73,7 +73,7 @@ class ListCompare extends \Magento\Framework\DataObject * @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Visitor $customerVisitor - * @param \Magento\Catalog\Model\Product\Compare\AddToList + * @param \Magento\Catalog\Model\Product\Compare\CompareList * @param array $data * @param ProductRepository|null $productRepository */ @@ -83,7 +83,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Visitor $customerVisitor, - \Magento\Catalog\Model\Product\Compare\AddToList $addToList, + \Magento\Catalog\Model\Product\Compare\CompareList $addToList, array $data = [], ProductRepository $productRepository = null ) { @@ -92,7 +92,7 @@ public function __construct( $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_customerSession = $customerSession; $this->_customerVisitor = $customerVisitor; - $this->addToCompareList = $addToList; + $this->compareList = $addToList; $this->productRepository = $productRepository ?: ObjectManager::getInstance()->create(ProductRepository::class); parent::__construct($data); } @@ -110,7 +110,7 @@ public function addProduct($product) $item = $this->_compareItemFactory->create(); $this->_addVisitorToItem($item); $item->loadByProduct($product); - $listId = $this->addToCompareList->execute(); + $listId = $this->compareList->getListId($item); if (!$item->getId() && $this->productExists($product)) { $item->addProductData($product); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php index 60b3f5c71c92f..e6ef21e2c8448 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php @@ -5,7 +5,8 @@ */ namespace Magento\Catalog\Model\ResourceModel\Product\Compare; -use Magento\Catalog\Model\Product\Compare\AddToList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; use Magento\Framework\Model\ResourceModel\Db\Context; /** @@ -16,9 +17,14 @@ class Item extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { /** - * @var AddToList + * @var CompareListFactory */ - private $compareList; + private $compareListFactory; + + /** + * @var CompareListResource + */ + private $compareListResource; /** * Initialize connection @@ -31,16 +37,19 @@ protected function _construct() } /** - * @param AddToList $addToList + * @param CompareListFactory $compareListFactory + * @param CompareListResource $compareListResource * @param Context $context * @param null $connectionName */ public function __construct( - AddToList $addToList, + CompareListFactory $compareListFactory, + CompareListResource $compareListResource, Context $context, $connectionName = null ) { - $this->compareList = $addToList; + $this->compareListFactory = $compareListFactory; + $this->compareListResource = $compareListResource; parent::__construct($context, $connectionName); } @@ -235,7 +244,7 @@ public function updateCustomerFromVisitor($object) $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $itemId) ); } - $this->compareList->setCustomerFromVisitor(); + $this->setCustomerFromVisitor($object); } return $this; @@ -265,4 +274,28 @@ public function clearItems($visitorId = null, $customerId = null) $this->getConnection()->delete($this->getMainTable(), $where); return $this; } + + /** + * Set customer from visitor in catalog_compare_list table + * + * @param \Magento\Catalog\Model\Product\Compare\Item $item + * + * @return $this + */ + private function setCustomerFromVisitor($item) + { + $customerId = $item->getCustomerId(); + + if (!$customerId) { + return $this; + } + + $visitorId = $item->getVisitorId(); + $compareListModel = $this->compareListFactory->create(); + $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); + $compareListModel->setCustomerId($customerId); + $compareListModel->save(); + + return $this; + } } From 330c2001bfcd60422c46508eab7c4218f7fa9f92 Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Wed, 12 Aug 2020 17:48:37 +0300 Subject: [PATCH 013/490] started working on compared list graphql modules --- .../Model/Resolver/AddItemsToCompareList.php | 40 +++ .../Resolver/AssignCompareListToCustomer.php | 39 +++ .../Model/Resolver/CompareList.php | 41 +++ .../Model/Resolver/CustomerCompareList.php | 252 ++++++++++++++++++ .../Resolver/RemoveItemsFromCompareList.php | 40 +++ .../Magento/CompareListGraphQl/composer.json | 24 ++ .../Magento/CompareListGraphQl/etc/module.xml | 18 ++ .../CompareListGraphQl/etc/schema.graphqls | 37 +++ .../CompareListGraphQl/registration.php | 14 + 9 files changed, 505 insertions(+) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php create mode 100644 app/code/Magento/CompareListGraphQl/composer.json create mode 100644 app/code/Magento/CompareListGraphQl/etc/module.xml create mode 100644 app/code/Magento/CompareListGraphQl/etc/schema.graphqls create mode 100644 app/code/Magento/CompareListGraphQl/registration.php diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php new file mode 100644 index 0000000000000..279119b29a93b --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php @@ -0,0 +1,40 @@ +itemCollectionFactory = $itemCollectionFactory; + $this->catalogProductVisibility = $catalogProductVisibility; + $this->catalogConfig = $catalogConfig; + $this->compareProduct = $compareHelper; + $this->priceProviderPool = $priceProviderPool; + $this->discount = $discount; + } + + /** + * Get customer compare list + * + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return Value|mixed|void + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + /** @var StoreInterface $store */ + $store = $context->getExtensionAttributes()->getStore(); + + return [ + 'list_id' => 1, + 'items' => $this->getComparableItems($context, $store), + 'attributes' => $this->getComparableAttributes($context) + ]; + } + + /** + * Get comparable items + * + * @param ContextInterface $context + * @param StoreInterface $store + * + * @return array + */ + private function getComparableItems(ContextInterface $context, StoreInterface $store) + { + $items = []; + foreach ($this->getCollectionComparableItems($context) as $item) { + /** @var Product $item */ + $items[] = [ + 'productId' => $item->getId(), + 'name' => $item->getName(), + 'sku' => $item->getSku(), + 'priceRange' => [ + 'minimum_price' => $this->getMinimumProductPrice($item, $store), + 'maximum_price' => $this->getMinimumProductPrice($item, $store) + ], + 'canonical_url' => $item->getUrlKey(), + 'images' => [ + 'url' => [ + 'model' => $item, + 'image_type' => 'image', + 'label' => $item->getImageLabel() + ], + ], + ]; + } + + return $items; + } + + /** + * Get comparable attributes + * + * @param ContextInterface $context + * + * @return array + */ + private function getComparableAttributes(ContextInterface $context): array + { + $attributes = []; + $itemsCollection = $this->getCollectionComparableItems($context); + foreach ($itemsCollection->getComparableAttributes() as $item) { + $attributes[] = [ + 'code' => $item->getAttributeCode(), + 'title' => $item->getStoreLabel() + ]; + } + + return $attributes; + } + + /** + * Get collection of comparable items + * + * @param ContextInterface $context + * + * @return Collection + */ + private function getCollectionComparableItems(ContextInterface $context): Collection + { + $this->compareProduct->setAllowUsedFlat(false); + /** @var Collection $comparableItems */ + $this->items = $this->itemCollectionFactory->create(); + $this->items->setCustomerId($context->getUserId()); + $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); + + $this->items->addAttributeToSelect( + $this->catalogConfig->getProductAttributes() + )->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility( + $this->catalogProductVisibility->getVisibleInSiteIds() + ); + + return $this->items; + } + + /** + * Get formatted minimum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Get formatted maximum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Format price for GraphQl output + * + * @param float $regularPrice + * @param float $finalPrice + * @param StoreInterface $store + * + * @return array + */ + private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array + { + return [ + 'regular_price' => [ + 'value' => $regularPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'final_price' => [ + 'value' => $finalPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), + ]; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php new file mode 100644 index 0000000000000..e82f0fb0c9cdd --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php @@ -0,0 +1,40 @@ + + + + + + + + + + + + diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls new file mode 100644 index 0000000000000..1a44629b482b3 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -0,0 +1,37 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. + +type ComparableItem { + productId: ID! @doc(description: "Product Id") + name: String! @doc(description: "Product name") + sku: String! @doc(description: "Product SKU") + priceRange: PriceRange! @doc(description: "Product prices") + canonical_url: String @doc(description: "Product URL") + images: [ProductImage]! @doc(description: "Product Images") + # values: [ProductAttribute]! @doc(description: "Product comparable attributes") +} + +type ComparableAttribute { + code: String! @doc(description: "Attribute code") + title: String! @doc(description: "Addibute display title") +} + +type CompareList { + list_id: ID! @doc(description: "Compare list id") + items: [ComparableItem] @doc(description: "Comparable products") + attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") +} + +type Customer { + compare_list: CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CustomerCompareList") @doc(description: "Active customers compare list") +} + +type Query { + compareList(id: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Compare list") +} + +type Mutation { + addItemsToCompareList(id: ID!, items: [ID!]): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddItemsToCompareList") @doc(description: "Add items to compare list") + removeItemsFromCompareList(id: ID!, items: [ID!]): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveItemsFromCompareList") @doc(description: "Remove items from compare list") + assignCompareListToCustomer(customerId: ID!, listId: ID!): Boolean @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") +} diff --git a/app/code/Magento/CompareListGraphQl/registration.php b/app/code/Magento/CompareListGraphQl/registration.php new file mode 100644 index 0000000000000..bb764b439273d --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/registration.php @@ -0,0 +1,14 @@ + Date: Mon, 17 Aug 2020 16:08:09 +0300 Subject: [PATCH 014/490] added resolver for getting compare list by id --- .../Product/Compare/Item/Collection.php | 35 +++ .../Model/Resolver/CompareList.php | 57 +++- .../Model/Resolver/CustomerCompareList.php | 220 +++----------- .../Model/Service/CompareListService.php | 272 ++++++++++++++++++ .../CompareListGraphQl/etc/schema.graphqls | 7 +- 5 files changed, 401 insertions(+), 190 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 92741cf9ba88e..dca3f76af6a04 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -31,6 +31,13 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection */ protected $_visitorId = 0; + /** + * List Id Filter + * + * @var int + */ + protected $listId = 0; + /** * Comparable attributes cache * @@ -156,6 +163,30 @@ public function setCustomerId($customerId) return $this; } + /** + * Set listId filter to collection + * + * @param $listId + * + * @return $this + */ + public function setListId($listId) + { + $this->listId = (int)$listId; + $this->_addJoinToSelect(); + return $this; + } + + /** + * Retrieve listId filter applied to collection + * + * @return int + */ + public function getListId() + { + return $this->listId; + } + /** * Set visitor filter to collection * @@ -204,6 +235,10 @@ public function getConditionForJoin() return ['visitor_id' => $this->getVisitorId()]; } + if ($this->getListId()) { + return ['list_id' => $this->getListId()]; + } + return ['customer_id' => ['null' => true], 'visitor_id' => '0']; } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index a2e5d06084b14..ffe5cb1fbfc05 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -7,26 +7,57 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\CompareListGraphQl\Model\Service\CompareListService; +use Magento\Catalog\Model\CompareList as ModelCompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Store\Api\Data\StoreInterface; class CompareList implements ResolverInterface { + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @var CompareListService + */ + private $compareListService; + + public function __construct( + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList, + CompareListService $compareListService + ) { + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + $this->compareListService = $compareListService; + } + /** * Get compare list * - * @param Field $field + * @param Field $field * @param ContextInterface $context - * @param ResolveInfo $info - * @param array|null $value - * @param array|null $args + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args * * @return array|Value|mixed * * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * */ public function resolve( Field $field, @@ -35,7 +66,21 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + /** @var StoreInterface $store */ + $store = $context->getExtensionAttributes()->getStore(); + /** @var $compareListModel ModelCompareList*/ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $args['id']); + $listId = (int)$compareListModel->getId(); + + if (!$listId) { + return null; + } + + return [ + 'list_id' => $listId, + 'items' => $this->compareListService->getComparableItems($listId, $context, $store), + 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) + ]; } } - diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php index ccc1b1ad7b3ad..b8d22e02678de 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php @@ -7,81 +7,47 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Helper\Product\Compare; -use Magento\Catalog\Model\Config as CatalogConfig; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Visibility as CatalogProductVisibility; -use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; -use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\CollectionFactory as CompareItemsCollectionFactory; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\Discount; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool as PriceProviderPool; +use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\CompareListGraphQl\Model\Service\CompareListService; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Framework\Pricing\SaleableInterface; use Magento\Store\Api\Data\StoreInterface; class CustomerCompareList implements ResolverInterface { /** - * @var Collection + * @var ResourceCompareList */ - private $items; + private $resourceCompareList; /** - * @var CompareItemsCollectionFactory + * @var CompareListFactory */ - private $itemCollectionFactory; + private $compareListFactory; /** - * @var CatalogProductVisibility + * @var CompareListService */ - private $catalogProductVisibility; + private $compareListService; /** - * @var CatalogConfig - */ - private $catalogConfig; - - /** - * @var Compare - */ - private $compareProduct; - - /** - * @var Discount - */ - private $discount; - - /** - * @var PriceProviderPool - */ - private $priceProviderPool; - - /** - * @param CompareItemsCollectionFactory $itemCollectionFactory - * @param CatalogProductVisibility $catalogProductVisibility - * @param CatalogConfig $catalogConfig - * @param Compare $compareHelper - * @param PriceProviderPool $priceProviderPool - * @param Discount $discount + * @param ResourceCompareList $resourceCompareList + * @param CompareListFactory $compareListFactory + * @param CompareListService $compareListService */ public function __construct( - CompareItemsCollectionFactory $itemCollectionFactory, - CatalogProductVisibility $catalogProductVisibility, - CatalogConfig $catalogConfig, - Compare $compareHelper, - PriceProviderPool $priceProviderPool, - Discount $discount + ResourceCompareList $resourceCompareList, + CompareListFactory $compareListFactory, + CompareListService $compareListService ) { - $this->itemCollectionFactory = $itemCollectionFactory; - $this->catalogProductVisibility = $catalogProductVisibility; - $this->catalogConfig = $catalogConfig; - $this->compareProduct = $compareHelper; - $this->priceProviderPool = $priceProviderPool; - $this->discount = $discount; + $this->resourceCompareList = $resourceCompareList; + $this->compareListFactory = $compareListFactory; + $this->compareListService = $compareListService; } /** @@ -106,147 +72,35 @@ public function resolve( ) { /** @var StoreInterface $store */ $store = $context->getExtensionAttributes()->getStore(); + $listId = (int)$this->getListIdByCustomerId($context->getUserId()); - return [ - 'list_id' => 1, - 'items' => $this->getComparableItems($context, $store), - 'attributes' => $this->getComparableAttributes($context) - ]; - } - - /** - * Get comparable items - * - * @param ContextInterface $context - * @param StoreInterface $store - * - * @return array - */ - private function getComparableItems(ContextInterface $context, StoreInterface $store) - { - $items = []; - foreach ($this->getCollectionComparableItems($context) as $item) { - /** @var Product $item */ - $items[] = [ - 'productId' => $item->getId(), - 'name' => $item->getName(), - 'sku' => $item->getSku(), - 'priceRange' => [ - 'minimum_price' => $this->getMinimumProductPrice($item, $store), - 'maximum_price' => $this->getMinimumProductPrice($item, $store) - ], - 'canonical_url' => $item->getUrlKey(), - 'images' => [ - 'url' => [ - 'model' => $item, - 'image_type' => 'image', - 'label' => $item->getImageLabel() - ], - ], - ]; + if (!$listId) { + return null; } - return $items; + return [ + 'list_id' => $listId, + 'items' => $this->compareListService->getComparableItems($listId, $context, $store), + 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) + ]; } /** - * Get comparable attributes + * Get listId by Customer ID * - * @param ContextInterface $context + * @param $customerId * - * @return array + * @return int|null */ - private function getComparableAttributes(ContextInterface $context): array + private function getListIdByCustomerId($customerId) { - $attributes = []; - $itemsCollection = $this->getCollectionComparableItems($context); - foreach ($itemsCollection->getComparableAttributes() as $item) { - $attributes[] = [ - 'code' => $item->getAttributeCode(), - 'title' => $item->getStoreLabel() - ]; + if ($customerId) { + /** @var CompareList $compareListModel */ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $customerId, 'customer_id'); + return (int)$compareListModel->getId(); } - return $attributes; - } - - /** - * Get collection of comparable items - * - * @param ContextInterface $context - * - * @return Collection - */ - private function getCollectionComparableItems(ContextInterface $context): Collection - { - $this->compareProduct->setAllowUsedFlat(false); - /** @var Collection $comparableItems */ - $this->items = $this->itemCollectionFactory->create(); - $this->items->setCustomerId($context->getUserId()); - $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); - - $this->items->addAttributeToSelect( - $this->catalogConfig->getProductAttributes() - )->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility( - $this->catalogProductVisibility->getVisibleInSiteIds() - ); - - return $this->items; - } - - /** - * Get formatted minimum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Get formatted maximum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Format price for GraphQl output - * - * @param float $regularPrice - * @param float $finalPrice - * @param StoreInterface $store - * - * @return array - */ - private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array - { - return [ - 'regular_price' => [ - 'value' => $regularPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'final_price' => [ - 'value' => $finalPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), - ]; + return null; } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php new file mode 100644 index 0000000000000..970003a70ff8c --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php @@ -0,0 +1,272 @@ +itemCollectionFactory = $itemCollectionFactory; + $this->catalogProductVisibility = $catalogProductVisibility; + $this->catalogConfig = $catalogConfig; + $this->compareProduct = $compareHelper; + $this->priceProviderPool = $priceProviderPool; + $this->discount = $discount; + $this->resourceCompareList = $resourceCompareList; + $this->modelCompareList = $compareList; + $this->blockListCompare = $listCompare; + } + + /** + * Get comparable items + * + * @param int $listId + * @param ContextInterface $context + * @param StoreInterface $store + * + * @return array + */ + public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) + { + $items = []; + foreach ($this->getCollectionComparableItems($listId, $context) as $item) { + /** @var Product $item */ + $items[] = [ + 'productId' => $item->getId(), + 'name' => $item->getName(), + 'sku' => $item->getSku(), + 'priceRange' => [ + 'minimum_price' => $this->getMinimumProductPrice($item, $store), + 'maximum_price' => $this->getMaximumProductPrice($item, $store) + ], + 'canonical_url' => $item->getUrlKey(), + 'images' => [ + 'url' => [ + 'model' => $item, + 'image_type' => 'image', + 'label' => $item->getImageLabel() + ], + ], + 'values' => $this->getProductComparableAttributes($listId, $item, $context) + ]; + } + + return $items; + } + + /** + * Get comparable attributes + * + * @param int $listId + * @param ContextInterface $context + * + * @return array + */ + public function getComparableAttributes(int $listId, ContextInterface $context): array + { + $attributes = []; + $itemsCollection = $this->getCollectionComparableItems($listId, $context); + foreach ($itemsCollection->getComparableAttributes() as $item) { + $attributes[] = [ + 'code' => $item->getAttributeCode(), + 'title' => $item->getStoreLabel() + ]; + } + + return $attributes; + } + + /** + * Get comparable attributes for product + * + * @param int $listId + * @param Product $product + * @param ContextInterface $context + * + * @return array + */ + private function getProductComparableAttributes(int $listId, Product $product, ContextInterface $context): array + { + $attributes = []; + $itemsCollection = $this->getCollectionComparableItems($listId, $context); + foreach ($itemsCollection->getComparableAttributes() as $item) { + $attributes[] = [ + 'code' => $item->getAttributeCode(), + 'value' => $this->blockListCompare->getProductAttributeValue($product, $item) + ]; + } + + return $attributes; + } + + /** + * Get formatted minimum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Get formatted maximum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Format price for GraphQl output + * + * @param float $regularPrice + * @param float $finalPrice + * @param StoreInterface $store + * + * @return array + */ + private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array + { + return [ + 'regular_price' => [ + 'value' => $regularPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'final_price' => [ + 'value' => $finalPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), + ]; + } + + /** + * Get collection of comparable items + * + * @param int $listId + * @param ContextInterface $context + * + * @return Collection + */ + private function getCollectionComparableItems(int $listId, ContextInterface $context): Collection + { + $this->compareProduct->setAllowUsedFlat(false); + /** @var Collection $comparableItems */ + $this->items = $this->itemCollectionFactory->create(); + $this->items->setListId($listId); + $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); + $this->items->addAttributeToSelect( + $this->catalogConfig->getProductAttributes() + )->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility( + $this->catalogProductVisibility->getVisibleInSiteIds() + ); + + return $this->items; + } +} diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 1a44629b482b3..6131aa9ec1135 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -8,7 +8,12 @@ type ComparableItem { priceRange: PriceRange! @doc(description: "Product prices") canonical_url: String @doc(description: "Product URL") images: [ProductImage]! @doc(description: "Product Images") - # values: [ProductAttribute]! @doc(description: "Product comparable attributes") + values: [ProductAttribute]! @doc(description: "Product comparable attributes") +} + +type ProductAttribute { + code: String! @doc(description:"Attribute code") + value: String! @doc(description:"Addibute display value") } type ComparableAttribute { From d24e5446b9b6b4bb00b989a854ec27cd5482bc1e Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Mon, 17 Aug 2020 20:17:13 +0300 Subject: [PATCH 015/490] add remove and assign functionality --- .../Model/Product/Compare/ListCompare.php | 6 +- .../Model/Resolver/AddItemsToCompareList.php | 127 ++++++++++++++++- .../Resolver/AssignCompareListToCustomer.php | 133 +++++++++++++++++- .../Model/Resolver/CompareList.php | 5 + .../Resolver/RemoveItemsFromCompareList.php | 86 ++++++++++- 5 files changed, 337 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php index 7c2ad694132b9..356c8e701b21e 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php @@ -73,7 +73,7 @@ class ListCompare extends \Magento\Framework\DataObject * @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Visitor $customerVisitor - * @param \Magento\Catalog\Model\Product\Compare\CompareList + * @param \Magento\Catalog\Model\Product\Compare\CompareList $compareList * @param array $data * @param ProductRepository|null $productRepository */ @@ -83,7 +83,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Visitor $customerVisitor, - \Magento\Catalog\Model\Product\Compare\CompareList $addToList, + \Magento\Catalog\Model\Product\Compare\CompareList $compareList, array $data = [], ProductRepository $productRepository = null ) { @@ -92,7 +92,7 @@ public function __construct( $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_customerSession = $customerSession; $this->_customerVisitor = $customerVisitor; - $this->compareList = $addToList; + $this->compareList = $compareList; $this->productRepository = $productRepository ?: ObjectManager::getInstance()->create(ProductRepository::class); parent::__construct($data); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php index 279119b29a93b..7b8a00ebf724d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php @@ -7,24 +7,94 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\CompareList as ModelCompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Compare\CompareList; +use Magento\Catalog\Model\Product\Compare\Item; +use Magento\Catalog\Model\Product\Compare\ItemFactory; +use Magento\Catalog\Model\ProductRepository; +use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\CompareListGraphQl\Model\Service\CompareListService; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Store\Api\Data\StoreInterface; class AddItemsToCompareList implements ResolverInterface { + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @var CompareListService + */ + private $compareListService; + + /** + * Compare item factory + * + * @var ItemFactory + */ + private $compareItemFactory; + + /** + * @var CompareList + */ + private $compareList; + + /** + * @var ProductRepository + */ + private $productRepository; + + /** + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + * @param CompareListService $compareListService + * @param ItemFactory $compareItemFactory + * @param CompareList $compareList + * @param ProductRepository $productRepository + */ + public function __construct( + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList, + CompareListService $compareListService, + ItemFactory $compareItemFactory, + CompareList $compareList, + ProductRepository $productRepository + ) { + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + $this->compareListService = $compareListService; + $this->compareItemFactory = $compareItemFactory; + $this->compareList = $compareList; + $this->productRepository = $productRepository; + } + /** * Add items to compare list * - * @param Field $field + * @param Field $field * @param ContextInterface $context - * @param ResolveInfo $info - * @param array|null $value - * @param array|null $args + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args * * @return Value|mixed|void + * + * @throws GraphQlInputException */ public function resolve( Field $field, @@ -33,8 +103,53 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + $listId = (int)$args['id']; + /** @var StoreInterface $store */ + $store = $context->getExtensionAttributes()->getStore(); + /** @var $compareListModel ModelCompareList*/ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $args['id']); + + if (!$compareListModel->getId()) { + throw new GraphQlInputException(__('Can\'t load compare list.')); + } + + foreach ($args['items'] as $key) { + /* @var $item Item */ + $item = $this->compareItemFactory->create(); + $item->loadByProduct($key); + if (!$item->getId() && $this->productExists($key)) { + $item->addProductData($key); + $item->setListId($listId); + $item->save(); + } + } + + return [ + 'list_id' => $listId, + 'items' => $this->compareListService->getComparableItems($listId, $context, $store), + 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) + ]; } -} + /** + * Check product exists. + * + * @param int|Product $product + * + * @return bool + */ + private function productExists($product) + { + if ($product instanceof Product && $product->getId()) { + return true; + } + try { + $product = $this->productRepository->getById((int)$product); + return !empty($product->getId()); + } catch (NoSuchEntityException $e) { + return false; + } + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index ff459d11f1b16..131fd553aa514 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -7,7 +7,19 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\CompareList as ModelCompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\AuthenticationInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; @@ -15,16 +27,64 @@ class AssignCompareListToCustomer implements ResolverInterface { + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @var AuthenticationInterface + */ + private $authentication; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @var AccountManagementInterface + */ + private $accountManagement; + + /** + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + * @param AuthenticationInterface $authentication + * @param CustomerRepositoryInterface $customerRepository + * @param AccountManagementInterface $accountManagement + */ + public function __construct( + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList, + AuthenticationInterface $authentication, + CustomerRepositoryInterface $customerRepository, + AccountManagementInterface $accountManagement + ) { + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + $this->authentication = $authentication; + $this->customerRepository = $customerRepository; + $this->accountManagement = $accountManagement; + } + /** * Assign compare list to customer * - * @param Field $field + * @param Field $field * @param ContextInterface $context - * @param ResolveInfo $info - * @param array|null $value - * @param array|null $args + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args * * @return Value|mixed|void + * + * @throws GraphQlInputException */ public function resolve( Field $field, @@ -33,7 +93,68 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + if (!isset($args['customerId'])) { + throw new GraphQlInputException(__('"customerId" value must be specified')); + } + + if (!isset($args['listId'])) { + throw new GraphQlInputException(__('"listId" value must be specified')); + } + + $customer = $this->validateCustomer($args['customerId']); + + /** @var $compareListModel ModelCompareList*/ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $args['listId']); + + if (!$compareListModel->getId()) { + return false; + } + + $compareListModel->setCustomerId($customer->getId()); + $this->resourceCompareList->save($compareListModel); + + return true; } -} + /** + * Customer validate + * + * @param $customerId + * + * @return CustomerInterface + * + * @throws GraphQlAuthenticationException + * @throws GraphQlInputException + * @throws GraphQlNoSuchEntityException + */ + private function validateCustomer($customerId) + { + try { + $customer = $this->customerRepository->getById($customerId); + } catch (NoSuchEntityException $e) { + throw new GraphQlNoSuchEntityException( + __('Customer with id "%customer_id" does not exist.', ['customer_id' => $customerId]), + $e + ); + } catch (LocalizedException $e) { + throw new GraphQlInputException(__($e->getMessage())); + } + + if (true === $this->authentication->isLocked($customerId)) { + throw new GraphQlAuthenticationException(__('The account is locked.')); + } + + try { + $confirmationStatus = $this->accountManagement->getConfirmationStatus($customerId); + } catch (LocalizedException $e) { + throw new GraphQlInputException(__($e->getMessage())); + } + + if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { + throw new GraphQlAuthenticationException(__("This account isn't confirmed. Verify and try again.")); + } + + return $customer; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index ffe5cb1fbfc05..502fb305153df 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -35,6 +35,11 @@ class CompareList implements ResolverInterface */ private $compareListService; + /** + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + * @param CompareListService $compareListService + */ public function __construct( CompareListFactory $compareListFactory, ResourceCompareList $resourceCompareList, diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php index e82f0fb0c9cdd..f1a3536dbdb5e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php @@ -7,26 +7,76 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\CompareList as ModelCompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\Product\Compare\Item; +use Magento\Catalog\Model\Product\Compare\ItemFactory; +use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\CompareListGraphQl\Model\Service\CompareListService; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Store\Api\Data\StoreInterface; class RemoveItemsFromCompareList implements ResolverInterface { + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @var CompareListService + */ + private $compareListService; + + /** + * Compare item factory + * + * @var ItemFactory + */ + private $compareItemFactory; + + /** + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + * @param CompareListService $compareListService + * @param ItemFactory $compareItemFactory, + */ + public function __construct( + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList, + CompareListService $compareListService, + ItemFactory $compareItemFactory + ) { + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + $this->compareListService = $compareListService; + $this->compareItemFactory = $compareItemFactory; + } + /** * Remove items from compare list * - * @param Field $field + * @param Field $field * @param ContextInterface $context - * @param ResolveInfo $info - * @param array|null $value - * @param array|null $args + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args * * @return Value|mixed|void * * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * + * @throws GraphQlInputException */ public function resolve( Field $field, @@ -35,6 +85,32 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + $listId = (int)$args['id']; + /** @var StoreInterface $store */ + $store = $context->getExtensionAttributes()->getStore(); + /** @var $compareListModel ModelCompareList*/ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $args['id']); + + if (!$compareListModel->getId()) { + throw new GraphQlInputException(__('Can\'t load compare list.')); + } + + foreach ($args['items'] as $key) { + /* @var $item Item */ + $item = $this->compareItemFactory->create(); + $item->setListId($listId); + $item->loadByProduct($key); + + if ($item->getId()) { + $item->delete(); + } + } + + return [ + 'list_id' => $listId, + 'items' => $this->compareListService->getComparableItems($listId, $context, $store), + 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) + ]; } } From 96029b55f7cd00b58967637aedac67ddd1767bad Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 10:37:47 +0100 Subject: [PATCH 016/490] Fix test --- .../Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 9414680ce0e45..98ec3c918f539 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1082,8 +1082,8 @@ public function testMissedJobsCleanedInTime() ->method('quoteInto') ->with( 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - ['test_job1'], - 'running' + 'running', + ['test_job1'] ) ->willReturn(''); From 68d679b7bd7d371c5266d4803f03f204893f7af2 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 12:04:43 +0100 Subject: [PATCH 017/490] Reduce line count to fix static testing --- .../Observer/ProcessCronQueueObserverTest.php | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 98ec3c918f539..816fdb6173d8b 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -764,22 +764,17 @@ function ($callback) { ->method('getCollection')->willReturn($this->scheduleCollectionMock); $scheduleMock->expects($this->any()) ->method('getResource')->willReturn($this->scheduleResourceMock); - $this->scheduleFactoryMock->expects($this->once(2)) + $this->scheduleFactoryMock->expects($this->once()) ->method('create')->willReturn($scheduleMock); $testCronJob = $this->getMockBuilder('CronJob') ->setMethods(['execute'])->getMock(); $testCronJob->expects($this->atLeastOnce())->method('execute')->with($schedule); - $this->objectManagerMock->expects( - $this->once() - )->method( - 'create' - )->with( - 'CronJob' - )->willReturn( - $testCronJob - ); + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with('CronJob') + ->willReturn($testCronJob); $this->cronQueueObserver->execute($this->observerMock); } @@ -1055,26 +1050,11 @@ public function testMissedJobsCleanedInTime() $connectionMock->expects($this->exactly(5)) ->method('delete') ->withConsecutive( - [ - $tableName, - ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']] - ], - [ - $tableName, - ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ] + [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]], + [$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]] ) ->willReturn(1); From a9ea92a82eabeab252adfb0e3d1e3fbe9fcae6da Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Fri, 21 Aug 2020 15:07:06 +0300 Subject: [PATCH 018/490] separated some logic --- .../Model/Resolver/AddItemsToCompareList.php | 61 ++---------- .../Resolver/AssignCompareListToCustomer.php | 81 ++-------------- .../Model/Service/AddToCompareListService.php | 85 +++++++++++++++++ .../Model/Service/CustomerService.php | 95 +++++++++++++++++++ 4 files changed, 200 insertions(+), 122 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php index 7b8a00ebf724d..51a48de49c686 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php @@ -9,14 +9,10 @@ use Magento\Catalog\Model\CompareList as ModelCompareList; use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Compare\CompareList; -use Magento\Catalog\Model\Product\Compare\Item; -use Magento\Catalog\Model\Product\Compare\ItemFactory; -use Magento\Catalog\Model\ProductRepository; use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\CompareListGraphQl\Model\Service\AddToCompareListService; use Magento\CompareListGraphQl\Model\Service\CompareListService; -use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -25,6 +21,9 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Store\Api\Data\StoreInterface; +/** + * Class add products to compare list + */ class AddItemsToCompareList implements ResolverInterface { /** @@ -42,45 +41,35 @@ class AddItemsToCompareList implements ResolverInterface */ private $compareListService; - /** - * Compare item factory - * - * @var ItemFactory - */ - private $compareItemFactory; - /** * @var CompareList */ private $compareList; /** - * @var ProductRepository + * @var AddToCompareListService */ - private $productRepository; + private $addToCompareListService; /** * @param CompareListFactory $compareListFactory * @param ResourceCompareList $resourceCompareList * @param CompareListService $compareListService - * @param ItemFactory $compareItemFactory * @param CompareList $compareList - * @param ProductRepository $productRepository + * @param AddToCompareListService $addToCompareListService */ public function __construct( CompareListFactory $compareListFactory, ResourceCompareList $resourceCompareList, CompareListService $compareListService, - ItemFactory $compareItemFactory, CompareList $compareList, - ProductRepository $productRepository + AddToCompareListService $addToCompareListService ) { $this->compareListFactory = $compareListFactory; $this->resourceCompareList = $resourceCompareList; $this->compareListService = $compareListService; - $this->compareItemFactory = $compareItemFactory; $this->compareList = $compareList; - $this->productRepository = $productRepository; + $this->addToCompareListService = $addToCompareListService; } /** @@ -114,16 +103,7 @@ public function resolve( throw new GraphQlInputException(__('Can\'t load compare list.')); } - foreach ($args['items'] as $key) { - /* @var $item Item */ - $item = $this->compareItemFactory->create(); - $item->loadByProduct($key); - if (!$item->getId() && $this->productExists($key)) { - $item->addProductData($key); - $item->setListId($listId); - $item->save(); - } - } + $this->addToCompareListService->addToCompareList($listId, $args); return [ 'list_id' => $listId, @@ -131,25 +111,4 @@ public function resolve( 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) ]; } - - /** - * Check product exists. - * - * @param int|Product $product - * - * @return bool - */ - private function productExists($product) - { - if ($product instanceof Product && $product->getId()) { - return true; - } - - try { - $product = $this->productRepository->getById((int)$product); - return !empty($product->getId()); - } catch (NoSuchEntityException $e) { - return false; - } - } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index 131fd553aa514..ed4eb724ea14c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -10,21 +10,17 @@ use Magento\Catalog\Model\CompareList as ModelCompareList; use Magento\Catalog\Model\CompareListFactory; use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\Customer\Api\AccountManagementInterface; -use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Customer\Model\AuthenticationInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; +use Magento\CompareListGraphQl\Model\Service\CustomerService; use Magento\Framework\GraphQl\Config\Element\Field; -use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; -use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +/** + * Class Assign Customer to CompareList + */ class AssignCompareListToCustomer implements ResolverInterface { /** @@ -38,39 +34,23 @@ class AssignCompareListToCustomer implements ResolverInterface private $resourceCompareList; /** - * @var AuthenticationInterface - */ - private $authentication; - - /** - * @var CustomerRepositoryInterface - */ - private $customerRepository; - - /** - * @var AccountManagementInterface + * @var CustomerService */ - private $accountManagement; + private $customerService; /** * @param CompareListFactory $compareListFactory * @param ResourceCompareList $resourceCompareList - * @param AuthenticationInterface $authentication - * @param CustomerRepositoryInterface $customerRepository - * @param AccountManagementInterface $accountManagement + * @param CustomerService $customerService */ public function __construct( CompareListFactory $compareListFactory, ResourceCompareList $resourceCompareList, - AuthenticationInterface $authentication, - CustomerRepositoryInterface $customerRepository, - AccountManagementInterface $accountManagement + CustomerService $customerService ) { $this->compareListFactory = $compareListFactory; $this->resourceCompareList = $resourceCompareList; - $this->authentication = $authentication; - $this->customerRepository = $customerRepository; - $this->accountManagement = $accountManagement; + $this->customerService = $customerService; } /** @@ -101,7 +81,7 @@ public function resolve( throw new GraphQlInputException(__('"listId" value must be specified')); } - $customer = $this->validateCustomer($args['customerId']); + $customer = $this->customerService->validateCustomer($args['customerId']); /** @var $compareListModel ModelCompareList*/ $compareListModel = $this->compareListFactory->create(); @@ -116,45 +96,4 @@ public function resolve( return true; } - - /** - * Customer validate - * - * @param $customerId - * - * @return CustomerInterface - * - * @throws GraphQlAuthenticationException - * @throws GraphQlInputException - * @throws GraphQlNoSuchEntityException - */ - private function validateCustomer($customerId) - { - try { - $customer = $this->customerRepository->getById($customerId); - } catch (NoSuchEntityException $e) { - throw new GraphQlNoSuchEntityException( - __('Customer with id "%customer_id" does not exist.', ['customer_id' => $customerId]), - $e - ); - } catch (LocalizedException $e) { - throw new GraphQlInputException(__($e->getMessage())); - } - - if (true === $this->authentication->isLocked($customerId)) { - throw new GraphQlAuthenticationException(__('The account is locked.')); - } - - try { - $confirmationStatus = $this->accountManagement->getConfirmationStatus($customerId); - } catch (LocalizedException $e) { - throw new GraphQlInputException(__($e->getMessage())); - } - - if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { - throw new GraphQlAuthenticationException(__("This account isn't confirmed. Verify and try again.")); - } - - return $customer; - } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php new file mode 100644 index 0000000000000..06945d8acff7b --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php @@ -0,0 +1,85 @@ +compareItemFactory = $compareItemFactory; + $this->productRepository = $productRepository; + } + + /** + * Add to compare list + * + * @param int $listId + * @param array $items + */ + public function addToCompareList(int $listId, array $items) + { + foreach ($items['items'] as $key) { + /* @var $item Item */ + $item = $this->compareItemFactory->create(); + $item->loadByProduct($key); + if (!$item->getId() && $this->productExists($key)) { + $item->addProductData($key); + $item->setListId($listId); + $item->save(); + } + } + } + + /** + * Check product exists. + * + * @param int|Product $product + * + * @return bool + */ + private function productExists($product) + { + if ($product instanceof Product && $product->getId()) { + return true; + } + + try { + $product = $this->productRepository->getById((int)$product); + return !empty($product->getId()); + } catch (NoSuchEntityException $e) { + return false; + } + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php new file mode 100644 index 0000000000000..0eb05c3720eec --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php @@ -0,0 +1,95 @@ +authentication = $authentication; + $this->customerRepository = $customerRepository; + $this->accountManagement = $accountManagement; + } + + /** + * Customer validate + * + * @param $customerId + * + * @return CustomerInterface + * + * @throws GraphQlAuthenticationException + * @throws GraphQlInputException + * @throws GraphQlNoSuchEntityException + */ + public function validateCustomer($customerId) + { + try { + $customer = $this->customerRepository->getById($customerId); + } catch (NoSuchEntityException $e) { + throw new GraphQlNoSuchEntityException( + __('Customer with id "%customer_id" does not exist.', ['customer_id' => $customerId]), + $e + ); + } catch (LocalizedException $e) { + throw new GraphQlInputException(__($e->getMessage())); + } + + if (true === $this->authentication->isLocked($customerId)) { + throw new GraphQlAuthenticationException(__('The account is locked.')); + } + + try { + $confirmationStatus = $this->accountManagement->getConfirmationStatus($customerId); + } catch (LocalizedException $e) { + throw new GraphQlInputException(__($e->getMessage())); + } + + if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { + throw new GraphQlAuthenticationException(__("This account isn't confirmed. Verify and try again.")); + } + + return $customer; + } +} From a90161907aedae371cb307759b685cc254efe2d8 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 13:10:43 +0100 Subject: [PATCH 019/490] Fix test failure due to table fetch --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index a6a8f77c039d8..de42027742c6e 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -711,7 +711,7 @@ private function cleanupRunningJobs($groupId) $jobs = $this->_config->getJobs(); $connection->update( - $scheduleResource->getMainTable(), + $scheduleResource->getTable('cron_schedule'), [ 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, 'messages' => 'Time out' From 907877bfe035999cecadd8803268d2950c1d17ac Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Fri, 21 Aug 2020 16:32:45 +0300 Subject: [PATCH 020/490] have decoupled some resolvers --- .../Model/Resolver/AddItemsToCompareList.php | 26 +- .../Model/Resolver/CompareList.php | 11 +- .../Model/Resolver/CustomerCompareList.php | 15 +- .../Resolver/RemoveItemsFromCompareList.php | 27 +- .../Service/Collection/ComparableItems.php | 88 ++++++ .../Service/ComparableAttributesService.php | 53 ++++ .../Model/Service/ComparableItemsService.php | 196 ++++++++++++++ .../Model/Service/CompareListService.php | 251 ++---------------- 8 files changed, 391 insertions(+), 276 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php index 51a48de49c686..8df7b9f7a221e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php @@ -12,7 +12,6 @@ use Magento\Catalog\Model\Product\Compare\CompareList; use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; use Magento\CompareListGraphQl\Model\Service\AddToCompareListService; -use Magento\CompareListGraphQl\Model\Service\CompareListService; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -20,6 +19,7 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Store\Api\Data\StoreInterface; +use Magento\CompareListGraphQl\Model\Service\CompareListService; /** * Class add products to compare list @@ -36,11 +36,6 @@ class AddItemsToCompareList implements ResolverInterface */ private $resourceCompareList; - /** - * @var CompareListService - */ - private $compareListService; - /** * @var CompareList */ @@ -51,25 +46,30 @@ class AddItemsToCompareList implements ResolverInterface */ private $addToCompareListService; + /** + * @var CompareListService + */ + private $compareListService; + /** * @param CompareListFactory $compareListFactory * @param ResourceCompareList $resourceCompareList - * @param CompareListService $compareListService * @param CompareList $compareList * @param AddToCompareListService $addToCompareListService + * @param CompareListService $compareListService */ public function __construct( CompareListFactory $compareListFactory, ResourceCompareList $resourceCompareList, - CompareListService $compareListService, CompareList $compareList, - AddToCompareListService $addToCompareListService + AddToCompareListService $addToCompareListService, + CompareListService $compareListService ) { $this->compareListFactory = $compareListFactory; $this->resourceCompareList = $resourceCompareList; - $this->compareListService = $compareListService; $this->compareList = $compareList; $this->addToCompareListService = $addToCompareListService; + $this->compareListService = $compareListService; } /** @@ -105,10 +105,6 @@ public function resolve( $this->addToCompareListService->addToCompareList($listId, $args); - return [ - 'list_id' => $listId, - 'items' => $this->compareListService->getComparableItems($listId, $context, $store), - 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) - ]; + return $this->compareListService->getCompareList($listId, $context, $store); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index 502fb305153df..4edb20ab3d2b9 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -8,16 +8,19 @@ namespace Magento\CompareListGraphQl\Model\Resolver; use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\CompareListGraphQl\Model\Service\CompareListService; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\CompareListGraphQl\Model\Service\CompareListService; use Magento\Catalog\Model\CompareList as ModelCompareList; use Magento\Catalog\Model\CompareListFactory; use Magento\Store\Api\Data\StoreInterface; +/** + * Get compare list + */ class CompareList implements ResolverInterface { /** @@ -82,10 +85,6 @@ public function resolve( return null; } - return [ - 'list_id' => $listId, - 'items' => $this->compareListService->getComparableItems($listId, $context, $store), - 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) - ]; + return $this->compareListService->getCompareList($listId, $context, $store); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php index b8d22e02678de..cd115ecb53ea4 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php @@ -18,6 +18,9 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Store\Api\Data\StoreInterface; +/** + * Get customer compare list + */ class CustomerCompareList implements ResolverInterface { /** @@ -36,9 +39,9 @@ class CustomerCompareList implements ResolverInterface private $compareListService; /** - * @param ResourceCompareList $resourceCompareList - * @param CompareListFactory $compareListFactory - * @param CompareListService $compareListService + * @param ResourceCompareList $resourceCompareList + * @param CompareListFactory $compareListFactory + * @param CompareListService $compareListService */ public function __construct( ResourceCompareList $resourceCompareList, @@ -78,11 +81,7 @@ public function resolve( return null; } - return [ - 'list_id' => $listId, - 'items' => $this->compareListService->getComparableItems($listId, $context, $store), - 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) - ]; + return $this->compareListService->getCompareList($listId, $context, $store); } /** diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php index f1a3536dbdb5e..d750e142e2dae 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php @@ -21,6 +21,9 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Store\Api\Data\StoreInterface; +/** + * Remove items from compare list + */ class RemoveItemsFromCompareList implements ResolverInterface { /** @@ -33,11 +36,6 @@ class RemoveItemsFromCompareList implements ResolverInterface */ private $resourceCompareList; - /** - * @var CompareListService - */ - private $compareListService; - /** * Compare item factory * @@ -45,22 +43,27 @@ class RemoveItemsFromCompareList implements ResolverInterface */ private $compareItemFactory; + /** + * @var CompareListService + */ + private $compareListService; + /** * @param CompareListFactory $compareListFactory * @param ResourceCompareList $resourceCompareList + * @param ItemFactory $compareItemFactory * @param CompareListService $compareListService - * @param ItemFactory $compareItemFactory, */ public function __construct( CompareListFactory $compareListFactory, ResourceCompareList $resourceCompareList, - CompareListService $compareListService, - ItemFactory $compareItemFactory + ItemFactory $compareItemFactory, + CompareListService $compareListService ) { $this->compareListFactory = $compareListFactory; $this->resourceCompareList = $resourceCompareList; - $this->compareListService = $compareListService; $this->compareItemFactory = $compareItemFactory; + $this->compareListService = $compareListService; } /** @@ -107,10 +110,6 @@ public function resolve( } } - return [ - 'list_id' => $listId, - 'items' => $this->compareListService->getComparableItems($listId, $context, $store), - 'attributes' => $this->compareListService->getComparableAttributes($listId, $context) - ]; + return $this->compareListService->getCompareList($listId, $context, $store); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php new file mode 100644 index 0000000000000..0e6c41f1c2aab --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php @@ -0,0 +1,88 @@ +itemCollectionFactory = $itemCollectionFactory; + $this->catalogProductVisibility = $catalogProductVisibility; + $this->catalogConfig = $catalogConfig; + $this->compareProduct = $compareHelper; + } + + /** + * Get collection of comparable items + * + * @param int $listId + * @param ContextInterface $context + * + * @return Collection + */ + public function getCollectionComparableItems(int $listId, ContextInterface $context): Collection + { + $this->compareProduct->setAllowUsedFlat(false); + /** @var Collection $comparableItems */ + $this->items = $this->itemCollectionFactory->create(); + $this->items->setListId($listId); + $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); + $this->items->addAttributeToSelect( + $this->catalogConfig->getProductAttributes() + )->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility( + $this->catalogProductVisibility->getVisibleInSiteIds() + ); + + return $this->items; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php new file mode 100644 index 0000000000000..152c09f2bbd1f --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php @@ -0,0 +1,53 @@ +comparableItemsCollection = $comparableItemsCollection; + } + + /** + * Get comparable attributes + * + * @param int $listId + * @param ContextInterface $context + * + * @return array + */ + public function getComparableAttributes(int $listId, ContextInterface $context): array + { + $attributes = []; + $itemsCollection = $this->comparableItemsCollection->getCollectionComparableItems($listId, $context); + foreach ($itemsCollection->getComparableAttributes() as $item) { + $attributes[] = [ + 'code' => $item->getAttributeCode(), + 'title' => $item->getStoreLabel() + ]; + } + + return $attributes; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php new file mode 100644 index 0000000000000..e14678b9ca0e3 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php @@ -0,0 +1,196 @@ +priceProviderPool = $priceProviderPool; + $this->discount = $discount; + $this->resourceCompareList = $resourceCompareList; + $this->modelCompareList = $compareList; + $this->blockListCompare = $listCompare; + $this->comparableItemsCollection = $comparableItemsCollection; + } + + /** + * Get comparable items + * + * @param int $listId + * @param ContextInterface $context + * @param StoreInterface $store + * + * @return array + */ + public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) + { + $items = []; + foreach ($this->comparableItemsCollection->getCollectionComparableItems($listId, $context) as $item) { + /** @var Product $item */ + $items[] = [ + 'productId' => $item->getId(), + 'name' => $item->getName(), + 'sku' => $item->getSku(), + 'priceRange' => [ + 'minimum_price' => $this->getMinimumProductPrice($item, $store), + 'maximum_price' => $this->getMaximumProductPrice($item, $store) + ], + 'canonical_url' => $item->getUrlKey(), + 'images' => [ + 'url' => [ + 'model' => $item, + 'image_type' => 'image', + 'label' => $item->getImageLabel() + ], + ], + 'values' => $this->getProductComparableAttributes($listId, $item, $context) + ]; + } + + return $items; + } + + /** + * Get comparable attributes for product + * + * @param int $listId + * @param Product $product + * @param ContextInterface $context + * + * @return array + */ + private function getProductComparableAttributes(int $listId, Product $product, ContextInterface $context): array + { + $attributes = []; + $itemsCollection = $this->comparableItemsCollection->getCollectionComparableItems($listId, $context); + foreach ($itemsCollection->getComparableAttributes() as $item) { + $attributes[] = [ + 'code' => $item->getAttributeCode(), + 'value' => $this->blockListCompare->getProductAttributeValue($product, $item) + ]; + } + + return $attributes; + } + + /** + * Get formatted minimum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Get formatted maximum product price + * + * @param SaleableInterface $product + * @param StoreInterface $store + * + * @return array + */ + private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array + { + $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); + $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); + $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); + return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); + } + + /** + * Format price for GraphQl output + * + * @param float $regularPrice + * @param float $finalPrice + * @param StoreInterface $store + * + * @return array + */ + private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array + { + return [ + 'regular_price' => [ + 'value' => $regularPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'final_price' => [ + 'value' => $finalPrice, + 'currency' => $store->getCurrentCurrencyCode() + ], + 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), + ]; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php index 970003a70ff8c..a11b93a8fed39 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php @@ -7,109 +7,38 @@ namespace Magento\CompareListGraphQl\Model\Service; -use Magento\Catalog\Block\Product\Compare\ListCompare; -use Magento\Catalog\Helper\Product\Compare; -use Magento\Catalog\Model\CompareList; -use Magento\Catalog\Model\Config as CatalogConfig; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Visibility as CatalogProductVisibility; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\Discount; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool as PriceProviderPool; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; -use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\CollectionFactory as CompareItemsCollectionFactory; -use Magento\Framework\Pricing\SaleableInterface; use Magento\Store\Api\Data\StoreInterface; - +/** + * Get compare list + */ class CompareListService { /** - * @var Collection - */ - private $items; - - /** - * @var CompareItemsCollectionFactory - */ - private $itemCollectionFactory; - - /** - * @var CatalogProductVisibility - */ - private $catalogProductVisibility; - - /** - * @var CatalogConfig - */ - private $catalogConfig; - - /** - * @var Compare - */ - private $compareProduct; - - /** - * @var Discount - */ - private $discount; - - /** - * @var PriceProviderPool - */ - private $priceProviderPool; - - /** - * @var ResourceCompareList - */ - private $resourceCompareList; - - /** - * @var CompareList + * @var ComparableItemsService */ - private $modelCompareList; + private $comparableItemsService; /** - * @var ListCompare + * @var ComparableAttributesService */ - private $blockListCompare; + private $comparableAttributesService; /** - * @param CompareItemsCollectionFactory $itemCollectionFactory - * @param CatalogProductVisibility $catalogProductVisibility - * @param CatalogConfig $catalogConfig - * @param Compare $compareHelper - * @param PriceProviderPool $priceProviderPool - * @param Discount $discount - * @param ResourceCompareList $resourceCompareList - * @param CompareList $compareList - * @param ListCompare $listCompare + * @param ComparableItemsService $comparableItemsService + * @param ComparableAttributesService $comparableAttributesService */ public function __construct( - CompareItemsCollectionFactory $itemCollectionFactory, - CatalogProductVisibility $catalogProductVisibility, - CatalogConfig $catalogConfig, - Compare $compareHelper, - PriceProviderPool $priceProviderPool, - Discount $discount, - ResourceCompareList $resourceCompareList, - CompareList $compareList, - ListCompare $listCompare + ComparableItemsService $comparableItemsService, + ComparableAttributesService $comparableAttributesService ) { - $this->itemCollectionFactory = $itemCollectionFactory; - $this->catalogProductVisibility = $catalogProductVisibility; - $this->catalogConfig = $catalogConfig; - $this->compareProduct = $compareHelper; - $this->priceProviderPool = $priceProviderPool; - $this->discount = $discount; - $this->resourceCompareList = $resourceCompareList; - $this->modelCompareList = $compareList; - $this->blockListCompare = $listCompare; + $this->comparableItemsService = $comparableItemsService; + $this->comparableAttributesService = $comparableAttributesService; } /** - * Get comparable items + * Get compare list * * @param int $listId * @param ContextInterface $context @@ -117,156 +46,12 @@ public function __construct( * * @return array */ - public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) - { - $items = []; - foreach ($this->getCollectionComparableItems($listId, $context) as $item) { - /** @var Product $item */ - $items[] = [ - 'productId' => $item->getId(), - 'name' => $item->getName(), - 'sku' => $item->getSku(), - 'priceRange' => [ - 'minimum_price' => $this->getMinimumProductPrice($item, $store), - 'maximum_price' => $this->getMaximumProductPrice($item, $store) - ], - 'canonical_url' => $item->getUrlKey(), - 'images' => [ - 'url' => [ - 'model' => $item, - 'image_type' => 'image', - 'label' => $item->getImageLabel() - ], - ], - 'values' => $this->getProductComparableAttributes($listId, $item, $context) - ]; - } - - return $items; - } - - /** - * Get comparable attributes - * - * @param int $listId - * @param ContextInterface $context - * - * @return array - */ - public function getComparableAttributes(int $listId, ContextInterface $context): array - { - $attributes = []; - $itemsCollection = $this->getCollectionComparableItems($listId, $context); - foreach ($itemsCollection->getComparableAttributes() as $item) { - $attributes[] = [ - 'code' => $item->getAttributeCode(), - 'title' => $item->getStoreLabel() - ]; - } - - return $attributes; - } - - /** - * Get comparable attributes for product - * - * @param int $listId - * @param Product $product - * @param ContextInterface $context - * - * @return array - */ - private function getProductComparableAttributes(int $listId, Product $product, ContextInterface $context): array - { - $attributes = []; - $itemsCollection = $this->getCollectionComparableItems($listId, $context); - foreach ($itemsCollection->getComparableAttributes() as $item) { - $attributes[] = [ - 'code' => $item->getAttributeCode(), - 'value' => $this->blockListCompare->getProductAttributeValue($product, $item) - ]; - } - - return $attributes; - } - - /** - * Get formatted minimum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Get formatted maximum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Format price for GraphQl output - * - * @param float $regularPrice - * @param float $finalPrice - * @param StoreInterface $store - * - * @return array - */ - private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array + public function getCompareList(int $listId, ContextInterface $context, StoreInterface $store) { return [ - 'regular_price' => [ - 'value' => $regularPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'final_price' => [ - 'value' => $finalPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), + 'list_id' => $listId, + 'items' => $this->comparableItemsService->getComparableItems($listId, $context, $store), + 'attributes' => $this->comparableAttributesService->getComparableAttributes($listId, $context) ]; } - - /** - * Get collection of comparable items - * - * @param int $listId - * @param ContextInterface $context - * - * @return Collection - */ - private function getCollectionComparableItems(int $listId, ContextInterface $context): Collection - { - $this->compareProduct->setAllowUsedFlat(false); - /** @var Collection $comparableItems */ - $this->items = $this->itemCollectionFactory->create(); - $this->items->setListId($listId); - $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); - $this->items->addAttributeToSelect( - $this->catalogConfig->getProductAttributes() - )->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility( - $this->catalogProductVisibility->getVisibleInSiteIds() - ); - - return $this->items; - } } From 11ccb291f24c23b6c2602bfcdc44c096ada7e14b Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Fri, 21 Aug 2020 16:22:41 -0300 Subject: [PATCH 021/490] Adding Integration test cases for communication.xml merging process --- .../Framework/Communication/ConfigTest.php | 64 +++++++++++-------- .../_files/valid_communication_expected.php | 4 ++ .../_files/valid_communication_extra.xml | 12 ++++ .../_files/valid_communication_input.php | 4 ++ 4 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_extra.xml diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php index 857c068efe188..76f8da59846e2 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php @@ -17,7 +17,9 @@ class ConfigTest extends \PHPUnit\Framework\TestCase */ public function testGetTopics() { - $topics = $this->getConfigInstance(__DIR__ . '/_files/valid_communication.xml')->getTopics(); + $topics = $this->getConfigInstance( + [__DIR__ . '/_files/valid_communication.xml', __DIR__ . '/_files/valid_communication_extra.xml'] + )->getTopics(); $expectedParsedTopics = include __DIR__ . '/_files/valid_communication_expected.php'; $this->assertEquals($expectedParsedTopics, $topics); } @@ -31,7 +33,7 @@ public function testGetTopicsNumeric() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Service method specified in the definition of topic "customerDeletedNumbers" is not av'); - $this->getConfigInstance(__DIR__ . '/_files/valid_communication_numeric.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/valid_communication_numeric.xml'])->getTopics(); } // @codingStandardsIgnoreStart @@ -58,7 +60,7 @@ public function testGetTopicsNumericInvalid() $this->expectException(\Magento\Framework\Exception\LocalizedException::class); $this->expectExceptionMessage('The XML in file "0" is invalid:'); - $this->getConfigInstance(__DIR__ . '/_files/invalid_communication_numeric.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/invalid_communication_numeric.xml'])->getTopics(); } /** @@ -66,7 +68,9 @@ public function testGetTopicsNumericInvalid() */ public function testGetTopic() { - $topics = $this->getConfigInstance(__DIR__ . '/_files/valid_communication.xml')->getTopic('customerCreated'); + $topics = $this->getConfigInstance( + [__DIR__ . '/_files/valid_communication.xml', __DIR__ . '/_files/valid_communication_extra.xml'] + )->getTopic('customerCreated'); $expectedParsedTopics = include __DIR__ . '/_files/valid_communication_expected.php'; $this->assertEquals($expectedParsedTopics['customerCreated'], $topics); } @@ -80,7 +84,7 @@ public function testGetTopicInvalidName() $this->expectException(\Magento\Framework\Exception\LocalizedException::class); $this->expectExceptionMessage('Topic "invalidTopic" is not configured.'); - $this->getConfigInstance(__DIR__ . '/_files/valid_communication.xml')->getTopic('invalidTopic'); + $this->getConfigInstance([__DIR__ . '/_files/valid_communication.xml'])->getTopic('invalidTopic'); } /** @@ -90,7 +94,7 @@ public function testGetTopicsExceptionMissingRequest() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Either "request" or "schema" attribute must be specified for topic "customerUpdated"'); - $this->getConfigInstance(__DIR__ . '/_files/communication_missing_request.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_missing_request.xml'])->getTopics(); } /** @@ -100,7 +104,7 @@ public function testGetTopicsExceptionNotExistingServiceMethod() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Service method specified in the definition of topic "customerRetrieved" is not'); - $this->getConfigInstance(__DIR__ . '/_files/communication_not_existing_service_method.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_not_existing_service_method.xml'])->getTopics(); } /** @@ -110,7 +114,7 @@ public function testGetTopicsExceptionNotExistingService() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Service method specified in the definition of topic "customerRetrieved" is not'); - $this->getConfigInstance(__DIR__ . '/_files/communication_not_existing_service.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_not_existing_service.xml'])->getTopics(); } /** @@ -120,7 +124,7 @@ public function testGetTopicsExceptionNoAttributes() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Either "request" or "schema" attribute must be specified for topic "customerRetrieved"'); - $this->getConfigInstance(__DIR__ . '/_files/communication_no_attributes.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_no_attributes.xml'])->getTopics(); } /** @@ -130,7 +134,7 @@ public function testGetTopicsExceptionInvalidResponseSchema() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Response schema definition for topic "customerUpdated" should reference existing'); - $this->getConfigInstance(__DIR__ . '/_files/communication_response_not_existing_service.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_response_not_existing_service.xml'])->getTopics(); } /** @@ -140,7 +144,7 @@ public function testGetTopicsExceptionInvalidRequestSchema() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Request schema definition for topic "customerUpdated" should reference existing'); - $this->getConfigInstance(__DIR__ . '/_files/communication_request_not_existing_service.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_request_not_existing_service.xml'])->getTopics(); } /** @@ -150,7 +154,7 @@ public function testGetTopicsExceptionMultipleHandlersSynchronousMode() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Topic "customerDeleted" is configured for synchronous requests, that is why it must'); - $this->getConfigInstance(__DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.xml'])->getTopics(); } /** @@ -160,7 +164,7 @@ public function testGetTopicsExceptionInvalidHandler() $this->expectException(\LogicException::class); $this->expectExceptionMessage('Service method specified in the definition of handler "customHandler" for topic "custo'); - $this->getConfigInstance(__DIR__ . '/_files/communication_not_existing_handler_method.xml')->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_not_existing_handler_method.xml'])->getTopics(); } /** @@ -171,7 +175,7 @@ public function testGetTopicsExceptionInvalidTopicNameInEnv() $this->expectExceptionMessage('Topic name "customerAdded" and attribute "name" = "customerCreated" must be equal'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_invalid_topic_name.php' )->getTopics(); } @@ -184,7 +188,7 @@ public function testGetTopicsExceptionTopicWithoutDataInEnv() $this->expectExceptionMessage('Topic "customerCreated" must contain data'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_topic_without_data.php' )->getTopics(); } @@ -197,7 +201,7 @@ public function testGetTopicsExceptionTopicWithMissedKeysInEnv() $this->expectExceptionMessage('Topic "customerCreated" has missed keys: [response]'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_topic_with_missed_keys.php' )->getTopics(); } @@ -210,7 +214,7 @@ public function testGetTopicsExceptionTopicWithExcessiveKeysInEnv() $this->expectExceptionMessage('Topic "customerCreated" has excessive keys: [some_incorrect_key]'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_topic_with_excessive_keys.php' )->getTopics(); } @@ -223,7 +227,7 @@ public function testGetTopicsExceptionTopicWithNonMatchedNameInEnv() $this->expectExceptionMessage('Topic name "customerDeleted" and attribute "name" = "customerRemoved" must be equal'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_with_non_matched_name.php' )->getTopics(); } @@ -236,7 +240,7 @@ public function testGetTopicsExceptionMultipleHandlersSynchronousModeInEnv() $this->expectExceptionMessage('Topic "customerDeleted" is configured for synchronous requests, that is why it must'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.php' )->getTopics(); } @@ -249,7 +253,7 @@ public function testGetTopicsExceptionInvalidRequestSchemaInEnv() $this->expectExceptionMessage('Request schema definition for topic "customerCreated" should reference existing service'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_request_not_existing_service.php' )->getTopics(); } @@ -262,7 +266,7 @@ public function testGetTopicsExceptionInvalidResponseSchemaInEnv() $this->expectExceptionMessage('Response schema definition for topic "customerCreated" should reference existing type o'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_response_not_existing_service.php' )->getTopics(); } @@ -275,7 +279,7 @@ public function testGetTopicsExceptionInvalidMethodInHandlerInEnv() $this->expectExceptionMessage('Service method specified in the definition of handler "customerCreatedFirst" for topic'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_not_existing_handler_method.php' )->getTopics(); } @@ -288,7 +292,7 @@ public function testGetTopicsExceptionWithDisabledHandlerInEnv() $this->expectExceptionMessage('Disabled handler "default" for topic "customerCreated" cannot be added to the config fi'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_with_disabled_handler.php' )->getTopics(); } @@ -301,7 +305,7 @@ public function testGetTopicsExceptionIncorrectRequestSchemaTypeInEnv() $this->expectExceptionMessage('Request schema type for topic "customerCreated" must be "object_interface" or "service_'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_incorrect_request_schema_type.php' )->getTopics(); } @@ -314,7 +318,7 @@ public function testGetTopicsExceptionIsNotBooleanTypeOfIsSynchronousInEnv() $this->expectExceptionMessage('The attribute "is_synchronous" for topic "customerCreated" should have the value of the'); $this->getConfigInstance( - __DIR__ . '/_files/valid_communication.xml', + [__DIR__ . '/_files/valid_communication.xml'], __DIR__ . '/_files/communication_is_synchronous_is_not_boolean.php' )->getTopics(); } @@ -322,16 +326,20 @@ public function testGetTopicsExceptionIsNotBooleanTypeOfIsSynchronousInEnv() /** * Create config instance initialized with configuration from $configFilePath * - * @param string $configFilePath + * @param array $configFilePaths * @param string|null $envConfigFilePath * @return \Magento\Framework\Communication\ConfigInterface */ - protected function getConfigInstance($configFilePath, $envConfigFilePath = null) + protected function getConfigInstance($configFilePaths, $envConfigFilePath = null) { $fileResolver = $this->getMockForAbstractClass(\Magento\Framework\Config\FileResolverInterface::class); + $fileResolverResult = []; + foreach ($configFilePaths as $configFilePath) { + $fileResolverResult[] = file_get_contents($configFilePath); + } $fileResolver->expects($this->any()) ->method('get') - ->willReturn([file_get_contents($configFilePath)]); + ->willReturn($fileResolverResult); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $xmlReader = $objectManager->create( \Magento\Framework\Communication\Config\Reader\XmlReader::class, diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_expected.php b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_expected.php index e384e779de74d..447197e10808e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_expected.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_expected.php @@ -33,6 +33,10 @@ 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, 'method' => 'delete', ], + 'customerCreatedExtra' => [ + 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, + 'method' => 'save', + ], 'saveNameNotDisabled' => [ 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, 'method' => 'save', diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_extra.xml b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_extra.xml new file mode 100644 index 0000000000000..fad468a5d288a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_extra.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_input.php b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_input.php index e099d5d45c877..082984ff15aaf 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_input.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/_files/valid_communication_input.php @@ -35,6 +35,10 @@ 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, 'method' => 'delete', ], + 'customerCreatedExtra' => [ + 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, + 'method' => 'save', + ], 'saveNameNotDisabled' => [ 'type' => \Magento\Customer\Api\CustomerRepositoryInterface::class, 'method' => 'save', From 623e87faf718164fe26a6b1315e9f3dd444d2fdd Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Mon, 24 Aug 2020 09:40:51 -0300 Subject: [PATCH 022/490] Applying coding standards to already existent long lines into configuration integration test file --- .../Framework/Communication/ConfigTest.php | 64 ++++++++++++++----- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php index 76f8da59846e2..a3574d81348bf 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php @@ -31,7 +31,9 @@ public function testGetTopics() public function testGetTopicsNumeric() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Service method specified in the definition of topic "customerDeletedNumbers" is not av'); + $this->expectExceptionMessage( + 'Service method specified in the definition of topic "customerDeletedNumbers" is not av' + ); $this->getConfigInstance([__DIR__ . '/_files/valid_communication_numeric.xml'])->getTopics(); } @@ -92,7 +94,9 @@ public function testGetTopicInvalidName() public function testGetTopicsExceptionMissingRequest() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Either "request" or "schema" attribute must be specified for topic "customerUpdated"'); + $this->expectExceptionMessage( + 'Either "request" or "schema" attribute must be specified for topic "customerUpdated"' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_missing_request.xml'])->getTopics(); } @@ -122,7 +126,9 @@ public function testGetTopicsExceptionNotExistingService() public function testGetTopicsExceptionNoAttributes() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Either "request" or "schema" attribute must be specified for topic "customerRetrieved"'); + $this->expectExceptionMessage( + 'Either "request" or "schema" attribute must be specified for topic "customerRetrieved"' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_no_attributes.xml'])->getTopics(); } @@ -132,7 +138,9 @@ public function testGetTopicsExceptionNoAttributes() public function testGetTopicsExceptionInvalidResponseSchema() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Response schema definition for topic "customerUpdated" should reference existing'); + $this->expectExceptionMessage( + 'Response schema definition for topic "customerUpdated" should reference existing' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_response_not_existing_service.xml'])->getTopics(); } @@ -142,7 +150,9 @@ public function testGetTopicsExceptionInvalidResponseSchema() public function testGetTopicsExceptionInvalidRequestSchema() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Request schema definition for topic "customerUpdated" should reference existing'); + $this->expectExceptionMessage( + 'Request schema definition for topic "customerUpdated" should reference existing' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_request_not_existing_service.xml'])->getTopics(); } @@ -152,7 +162,9 @@ public function testGetTopicsExceptionInvalidRequestSchema() public function testGetTopicsExceptionMultipleHandlersSynchronousMode() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Topic "customerDeleted" is configured for synchronous requests, that is why it must'); + $this->expectExceptionMessage( + 'Topic "customerDeleted" is configured for synchronous requests, that is why it must' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.xml'])->getTopics(); } @@ -162,7 +174,9 @@ public function testGetTopicsExceptionMultipleHandlersSynchronousMode() public function testGetTopicsExceptionInvalidHandler() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Service method specified in the definition of handler "customHandler" for topic "custo'); + $this->expectExceptionMessage( + 'Service method specified in the definition of handler "customHandler" for topic "custo' + ); $this->getConfigInstance([__DIR__ . '/_files/communication_not_existing_handler_method.xml'])->getTopics(); } @@ -172,7 +186,9 @@ public function testGetTopicsExceptionInvalidHandler() public function testGetTopicsExceptionInvalidTopicNameInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Topic name "customerAdded" and attribute "name" = "customerCreated" must be equal'); + $this->expectExceptionMessage( + 'Topic name "customerAdded" and attribute "name" = "customerCreated" must be equal' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -224,7 +240,9 @@ public function testGetTopicsExceptionTopicWithExcessiveKeysInEnv() public function testGetTopicsExceptionTopicWithNonMatchedNameInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Topic name "customerDeleted" and attribute "name" = "customerRemoved" must be equal'); + $this->expectExceptionMessage( + 'Topic name "customerDeleted" and attribute "name" = "customerRemoved" must be equal' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -237,7 +255,9 @@ public function testGetTopicsExceptionTopicWithNonMatchedNameInEnv() public function testGetTopicsExceptionMultipleHandlersSynchronousModeInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Topic "customerDeleted" is configured for synchronous requests, that is why it must'); + $this->expectExceptionMessage( + 'Topic "customerDeleted" is configured for synchronous requests, that is why it must' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -250,7 +270,9 @@ public function testGetTopicsExceptionMultipleHandlersSynchronousModeInEnv() public function testGetTopicsExceptionInvalidRequestSchemaInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Request schema definition for topic "customerCreated" should reference existing service'); + $this->expectExceptionMessage( + 'Request schema definition for topic "customerCreated" should reference existing service' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -263,7 +285,9 @@ public function testGetTopicsExceptionInvalidRequestSchemaInEnv() public function testGetTopicsExceptionInvalidResponseSchemaInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Response schema definition for topic "customerCreated" should reference existing type o'); + $this->expectExceptionMessage( + 'Response schema definition for topic "customerCreated" should reference existing type o' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -276,7 +300,9 @@ public function testGetTopicsExceptionInvalidResponseSchemaInEnv() public function testGetTopicsExceptionInvalidMethodInHandlerInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Service method specified in the definition of handler "customerCreatedFirst" for topic'); + $this->expectExceptionMessage( + 'Service method specified in the definition of handler "customerCreatedFirst" for topic' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -289,7 +315,9 @@ public function testGetTopicsExceptionInvalidMethodInHandlerInEnv() public function testGetTopicsExceptionWithDisabledHandlerInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Disabled handler "default" for topic "customerCreated" cannot be added to the config fi'); + $this->expectExceptionMessage( + 'Disabled handler "default" for topic "customerCreated" cannot be added to the config fi' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -302,7 +330,9 @@ public function testGetTopicsExceptionWithDisabledHandlerInEnv() public function testGetTopicsExceptionIncorrectRequestSchemaTypeInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Request schema type for topic "customerCreated" must be "object_interface" or "service_'); + $this->expectExceptionMessage( + 'Request schema type for topic "customerCreated" must be "object_interface" or "service_' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], @@ -315,7 +345,9 @@ public function testGetTopicsExceptionIncorrectRequestSchemaTypeInEnv() public function testGetTopicsExceptionIsNotBooleanTypeOfIsSynchronousInEnv() { $this->expectException(\LogicException::class); - $this->expectExceptionMessage('The attribute "is_synchronous" for topic "customerCreated" should have the value of the'); + $this->expectExceptionMessage( + 'The attribute "is_synchronous" for topic "customerCreated" should have the value of the' + ); $this->getConfigInstance( [__DIR__ . '/_files/valid_communication.xml'], From d5680d23fb7938e5e780d8cf0d90710fc5c5aac7 Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Mon, 24 Aug 2020 11:18:25 -0300 Subject: [PATCH 023/490] Applying coding standards to already existent long lines into configuration integration test file --- .../testsuite/Magento/Framework/Communication/ConfigTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php index a3574d81348bf..b02ccdb21e687 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php @@ -166,7 +166,8 @@ public function testGetTopicsExceptionMultipleHandlersSynchronousMode() 'Topic "customerDeleted" is configured for synchronous requests, that is why it must' ); - $this->getConfigInstance([__DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.xml'])->getTopics(); + $this->getConfigInstance([__DIR__ . '/_files/communication_multiple_handlers_synchronous_mode.xml']) + ->getTopics(); } /** From cf9de17dad689a1922cc987ed484bd7d84e91009 Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Mon, 24 Aug 2020 11:19:22 -0300 Subject: [PATCH 024/490] Removing useless method overriding detected via Static test --- .../Communication/Config/Reader/XmlReader.php | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php index 7a6463a323580..9e13ab8a73749 100644 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php +++ b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php @@ -19,36 +19,4 @@ class XmlReader extends \Magento\Framework\Config\Reader\Filesystem '/config/topic' => 'name', '/config/topic/handler' => 'name' ]; - - /** - * @param \Magento\Framework\Config\FileResolverInterface $fileResolver - * @param \Magento\Framework\Communication\Config\Reader\XmlReader\Converter $converter - * @param \Magento\Framework\Communication\Config\Reader\XmlReader\SchemaLocator $schemaLocator - * @param \Magento\Framework\Config\ValidationStateInterface $validationState - * @param string $fileName - * @param array $idAttributes - * @param string $domDocumentClass - * @param string $defaultScope - */ - public function __construct( - \Magento\Framework\Config\FileResolverInterface $fileResolver, - XmlReader\Converter $converter, - XmlReader\SchemaLocator $schemaLocator, - \Magento\Framework\Config\ValidationStateInterface $validationState, - $fileName = 'communication.xml', - $idAttributes = [], - $domDocumentClass = \Magento\Framework\Config\Dom::class, - $defaultScope = 'global' - ) { - parent::__construct( - $fileResolver, - $converter, - $schemaLocator, - $validationState, - $fileName, - $idAttributes, - $domDocumentClass, - $defaultScope - ); - } } From dda5c72c9303f9476ce7041743c87079cada87f6 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 25 Aug 2020 13:40:25 +0300 Subject: [PATCH 025/490] Cron cleanup repeatedly hits deadlocks on large environments Fix failing tests --- .../Observer/ProcessCronQueueObserver.php | 47 +++++----- .../Observer/ProcessCronQueueObserverTest.php | 90 +++++++++++++------ .../Magento/Cron/etc/db_schema_whitelist.json | 5 +- 3 files changed, 87 insertions(+), 55 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index de42027742c6e..0f266b5d62d83 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -9,6 +9,7 @@ */ namespace Magento\Cron\Observer; +use Magento\Cron\Model\ResourceModel\Schedule\Collection as ScheduleCollection; use Magento\Cron\Model\Schedule; use Magento\Framework\App\State; use Magento\Framework\Console\Cli; @@ -83,7 +84,7 @@ class ProcessCronQueueObserver implements ObserverInterface const MAX_RETRIES = 5; /** - * @var \Magento\Cron\Model\ResourceModel\Schedule\Collection + * @var ScheduleCollection */ protected $_pendingSchedules; @@ -278,12 +279,12 @@ function ($groupId) use ($currentTime) { * * It should be taken by standalone (child) process, not by the parent process. * - * @param int $groupId + * @param string $groupId * @param callable $callback * * @return void */ - private function lockGroup($groupId, callable $callback) + private function lockGroup(string $groupId, callable $callback): void { if (!$this->lockManager->lock(self::LOCK_PREFIX . $groupId, self::LOCK_TIMEOUT)) { $this->logger->warning( @@ -399,7 +400,7 @@ function () use ($schedule) { * @param string $jobName * @return void */ - private function startProfiling(string $jobName = '') + private function startProfiling(string $jobName = ''): void { $this->statProfiler->clear(); $this->statProfiler->start( @@ -416,7 +417,7 @@ private function startProfiling(string $jobName = '') * @param string $jobName * @return void */ - private function stopProfiling(string $jobName = '') + private function stopProfiling(string $jobName = ''): void { $this->statProfiler->stop( sprintf(self::CRON_TIMERID, $jobName), @@ -445,9 +446,9 @@ private function getProfilingStat(string $jobName): string * Return job collection from data base with status 'pending'. * * @param string $groupId - * @return \Magento\Cron\Model\ResourceModel\Schedule\Collection + * @return ScheduleCollection */ - private function getPendingSchedules($groupId) + private function getPendingSchedules(string $groupId): ScheduleCollection { $jobs = $this->_config->getJobs(); $pendingJobs = $this->_scheduleFactory->create()->getCollection(); @@ -462,7 +463,7 @@ private function getPendingSchedules($groupId) * @param string $groupId * @return $this */ - private function generateSchedules($groupId) + private function generateSchedules(string $groupId): self { /** * check if schedule generation is needed @@ -533,13 +534,13 @@ protected function _generateJobs($jobs, $exists, $groupId) * @param int $currentTime * @return void */ - private function cleanupJobs($groupId, $currentTime) + private function cleanupJobs(string $groupId, int $currentTime): void { // check if history cleanup is needed $lastCleanup = (int)$this->_cache->load(self::CACHE_KEY_LAST_HISTORY_CLEANUP_AT . $groupId); $historyCleanUp = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_CLEANUP_EVERY); if ($lastCleanup > $this->dateTime->gmtTimestamp() - $historyCleanUp * self::SECONDS_IN_MINUTE) { - return $this; + return; } // save time history cleanup was ran with no expiration $this->_cache->save( @@ -674,7 +675,7 @@ protected function getScheduleTimeInterval($groupId) * @param string $groupId * @return void */ - private function cleanupDisabledJobs($groupId) + private function cleanupDisabledJobs(string $groupId): void { $jobs = $this->_config->getJobs(); $jobsToCleanup = []; @@ -703,7 +704,7 @@ private function cleanupDisabledJobs($groupId) * @param string $groupId * @return void */ - private function cleanupRunningJobs($groupId) + private function cleanupRunningJobs(string $groupId): void { $scheduleResource = $this->_scheduleFactory->create()->getResource(); $connection = $scheduleResource->getConnection(); @@ -716,13 +717,11 @@ private function cleanupRunningJobs($groupId) 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, 'messages' => 'Time out' ], - $connection->quoteInto( - 'status = ? ' . - 'AND job_code IN (?) ' . - 'AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - \Magento\Cron\Model\Schedule::STATUS_RUNNING, - array_keys($jobs[$groupId]) - ) + [ + $connection->quoteInto('status = ?', \Magento\Cron\Model\Schedule::STATUS_RUNNING), + $connection->quoteInto('job_code IN (?)', array_keys($jobs[$groupId])), + 'scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY' + ] ); } @@ -803,13 +802,13 @@ private function isGroupInFilter($groupId): bool * @param array $jobsRoot * @param int $currentTime */ - private function processPendingJobs($groupId, $jobsRoot, $currentTime) + private function processPendingJobs(string $groupId, array $jobsRoot, int $currentTime): void { - $procesedJobs = []; + $processedJobs = []; $pendingJobs = $this->getPendingSchedules($groupId); /** @var Schedule $schedule */ foreach ($pendingJobs as $schedule) { - if (isset($procesedJobs[$schedule->getJobCode()])) { + if (isset($processedJobs[$schedule->getJobCode()])) { // process only on job per run continue; } @@ -826,7 +825,7 @@ private function processPendingJobs($groupId, $jobsRoot, $currentTime) $this->tryRunJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId); if ($schedule->getStatus() === Schedule::STATUS_SUCCESS) { - $procesedJobs[$schedule->getJobCode()] = true; + $processedJobs[$schedule->getJobCode()] = true; } $this->retrier->execute( @@ -851,7 +850,7 @@ private function tryRunJob($scheduledTime, $currentTime, $jobConfig, $schedule, { // use sha1 to limit length // phpcs:ignore Magento2.Security.InsecureFunction - $lockName = self::LOCK_PREFIX . md5($groupId . '_' . $schedule->getJobCode()); + $lockName = self::LOCK_PREFIX . md5($groupId . '_' . $schedule->getJobCode()); try { for ($retries = self::MAX_RETRIES; $retries > 0; $retries--) { diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 816fdb6173d8b..134d4ea04d171 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1045,53 +1045,85 @@ public function testMissedJobsCleanedInTime() $scheduleMock->expects($this->exactly(10))->method('getResource')->willReturn($this->scheduleResourceMock); $this->scheduleFactoryMock->expects($this->exactly(11))->method('create')->willReturn($scheduleMock); + $connectionMock = $this->prepareConnectionMock($tableName); + + $this->scheduleResourceMock->expects($this->exactly(6)) + ->method('getTable') + ->with($tableName) + ->willReturn($tableName); + $this->scheduleResourceMock->expects($this->exactly(15)) + ->method('getConnection') + ->willReturn($connectionMock); + + $this->retrierMock->expects($this->exactly(5)) + ->method('execute') + ->willReturnCallback( + function ($callback) { + return $callback(); + } + ); + + $this->cronQueueObserver->execute($this->observerMock); + } + + /** + * @param string $tableName + * @return AdapterInterface|MockObject + */ + private function prepareConnectionMock(string $tableName) + { $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); $connectionMock->expects($this->exactly(5)) ->method('delete') ->withConsecutive( - [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]], - [$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]] + [ + $tableName, + ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']] + ], + [ + $tableName, + ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ] ) ->willReturn(1); - $connectionMock->expects($this->once()) + $connectionMock->expects($this->any()) ->method('quoteInto') - ->with( - 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - 'running', - ['test_job1'] + ->withConsecutive( + ['status = ?', \Magento\Cron\Model\Schedule::STATUS_RUNNING], + ['job_code IN (?)', ['test_job1']], ) - ->willReturn(''); + ->willReturnOnConsecutiveCalls( + "status = 'running'", + "job_code IN ('test_job1')" + ); $connectionMock->expects($this->once()) ->method('update') ->with( $tableName, ['status' => 'error', 'messages' => 'Time out'], - '' + [ + "status = 'running'", + "job_code IN ('test_job1')", + 'scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY' + ] ) ->willReturn(0); - $this->scheduleResourceMock->expects($this->exactly(6)) - ->method('getTable') - ->with($tableName) - ->willReturn($tableName); - $this->scheduleResourceMock->expects($this->exactly(15)) - ->method('getConnection') - ->willReturn($connectionMock); - - $this->retrierMock->expects($this->exactly(5)) - ->method('execute') - ->willReturnCallback( - function ($callback) { - return $callback(); - } - ); - - $this->cronQueueObserver->execute($this->observerMock); + return $connectionMock; } } diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index c8666896627e2..74836c0be8a2e 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -12,10 +12,11 @@ }, "index": { "CRON_SCHEDULE_JOB_CODE": true, - "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true + "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, + "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { "PRIMARY": true } } -} \ No newline at end of file +} From e7cde72591b81895e8b02e1de3e8f88a4ede80b1 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 9 Sep 2020 13:14:54 +0300 Subject: [PATCH 026/490] magento/magento2#29528: Fix for communication.xml Handlers merging processs. --- .../Communication/Config/Reader/XmlReader.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php index 9e13ab8a73749..1ced7bd927fd8 100644 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php +++ b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php @@ -5,6 +5,10 @@ */ namespace Magento\Framework\Communication\Config\Reader; +use Magento\Framework\Config\Dom; +use Magento\Framework\Config\FileResolverInterface; +use Magento\Framework\Config\ValidationStateInterface; + /** * Communication configuration filesystem reader. Reads data from XML configs. */ @@ -19,4 +23,38 @@ class XmlReader extends \Magento\Framework\Config\Reader\Filesystem '/config/topic' => 'name', '/config/topic/handler' => 'name' ]; + + /** + * @param FileResolverInterface $fileResolver + * @param XmlReader\Converter $converter + * @param XmlReader\SchemaLocator $schemaLocator + * @param ValidationStateInterface $validationState + * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + */ + public function __construct( + FileResolverInterface $fileResolver, + XmlReader\Converter $converter, + XmlReader\SchemaLocator $schemaLocator, + ValidationStateInterface $validationState, + $fileName = 'communication.xml', + $idAttributes = [], + $domDocumentClass = Dom::class, + $defaultScope = 'global' + ) { + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); + } + //phpcs:enable Generic.CodeAnalysis.UselessOverridingMethod } From 90e457d983e906f361f9c1a994382383a8c20131 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Thu, 10 Sep 2020 10:30:59 +0300 Subject: [PATCH 027/490] magento/magento2#29528: Fix for communication.xml Handlers merging processs. --- app/etc/di.xml | 11 ++++ .../Communication/Config/Reader/XmlReader.php | 60 ------------------- 2 files changed, 11 insertions(+), 60 deletions(-) delete mode 100644 lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php diff --git a/app/etc/di.xml b/app/etc/di.xml index fed2e336046f9..4049541062640 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -228,6 +228,17 @@ + + + Magento\Framework\Communication\Config\Reader\XmlReader\Converter + Magento\Framework\Communication\Config\Reader\XmlReader\SchemaLocator + communication.xml + + name + name + + + diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php deleted file mode 100644 index 1ced7bd927fd8..0000000000000 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader.php +++ /dev/null @@ -1,60 +0,0 @@ - 'name', - '/config/topic/handler' => 'name' - ]; - - /** - * @param FileResolverInterface $fileResolver - * @param XmlReader\Converter $converter - * @param XmlReader\SchemaLocator $schemaLocator - * @param ValidationStateInterface $validationState - * @param string $fileName - * @param array $idAttributes - * @param string $domDocumentClass - * @param string $defaultScope - * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod - */ - public function __construct( - FileResolverInterface $fileResolver, - XmlReader\Converter $converter, - XmlReader\SchemaLocator $schemaLocator, - ValidationStateInterface $validationState, - $fileName = 'communication.xml', - $idAttributes = [], - $domDocumentClass = Dom::class, - $defaultScope = 'global' - ) { - parent::__construct( - $fileResolver, - $converter, - $schemaLocator, - $validationState, - $fileName, - $idAttributes, - $domDocumentClass, - $defaultScope - ); - } - //phpcs:enable Generic.CodeAnalysis.UselessOverridingMethod -} From 7d6f8bb0846b863d8a2aa78b8ce1e480a7cf7413 Mon Sep 17 00:00:00 2001 From: saphaljha Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 028/490] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From 1bf790a4ca2be7fa255c8173132bb47134021def Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 11 Sep 2020 14:59:05 +0300 Subject: [PATCH 029/490] magento/magento2#29528: Fix for communication.xml Handlers merging processs - static test fix. --- .../Magento/Test/Php/_files/phpstan/blacklist/common.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt index a9c65eb29c2e5..15d9edd76dd83 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt @@ -8,6 +8,7 @@ lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php dev/tests/integration/framework/deployTestModules.php +dev/tests/integration/testsuite/Magento/Framework/Communication/ConfigTest.php dev/tests/integration/testsuite/Magento/Framework/Filter/DirectiveProcessor/SimpleDirectiveTest.php dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php dev/tests/integration/testsuite/Magento/Framework/Session/SessionManagerTest.php From 1f0fe69c7965997b43995848119a3b5ec004de27 Mon Sep 17 00:00:00 2001 From: saphaljha Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 030/490] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 4 ++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ + + + + + + Goes to the Admin Widget creation page. Add and delete multiple layouts + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 0777e6cbd58d9..373274aef8584 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -40,5 +40,9 @@ + + + + diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ + + + + + + + + + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From 68875db121cb8576e7a2eabb4a26854ed90ee42c Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Mon, 21 Sep 2020 19:46:07 +0530 Subject: [PATCH 031/490] LoginAsCustomer GraphQL --- .../LoginAsCustomer/CreateCustomerToken.php | 78 +++++++ .../Model/Resolver/RequestCustomerToken.php | 116 ++++++++++ .../Magento/LoginAsCustomerGraphQl/README.md | 51 ++++ .../LoginAsCustomerGraphQl/composer.json | 26 +++ .../LoginAsCustomerGraphQl/etc/module.xml | 11 + .../etc/schema.graphqls | 27 +++ .../LoginAsCustomerGraphQl/registration.php | 4 + .../GenerateLoginCustomerTokenTest.php | 218 ++++++++++++++++++ .../Magento/LoginAsCustomer/_files/admin.php | 29 +++ .../LoginAsCustomer/_files/admin_rollback.php | 17 ++ 10 files changed, 577 insertions(+) create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/README.md create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/composer.json create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/registration.php create mode 100755 dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php create mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php create mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php new file mode 100755 index 0000000000000..d188e33b7f60f --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -0,0 +1,78 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer; + +use Magento\Customer\Model\Customer; +use Magento\Framework\Exception\LocalizedException; +use Magento\Integration\Model\Oauth\TokenFactory; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Create customer token from customer email + * + * Class CreateCustomerToken + */ +class CreateCustomerToken +{ + /** + * @var Customer + */ + private $customer; + + /** + * @var TokenFactory + */ + private $tokenModelFactory; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * CreateCustomerToken constructor. + * @param StoreManagerInterface $storeManager + * @param TokenFactory $tokenModelFactory + * @param Customer $customer + */ + public function __construct( + StoreManagerInterface $storeManager, + TokenFactory $tokenModelFactory, + Customer $customer + ) { + $this->storeManager = $storeManager; + $this->tokenModelFactory = $tokenModelFactory; + $this->customer= $customer; + } + + /** + * @param string $email + * @return array + * @throws LocalizedException + */ + public function execute(string $email) + { + $websiteID = $this->storeManager->getStore()->getWebsiteId(); + $this->customer->setWebsiteId($websiteID)->loadByEmail($email); + + /* Check if customer email exist */ + if (!$this->customer->getId()) { + throw new GraphQlInputException( + __('Customer email provided does not exist') + ); + } + + $customerId = $this->customer->getId(); + $customerToken = $this->tokenModelFactory->create(); + return [ + "customer_token" => $customerToken->createCustomerToken($customerId)->getToken() + ]; + } +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php new file mode 100755 index 0000000000000..5c2e340c529df --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -0,0 +1,116 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomerGraphQl\Model\Resolver; + +use Magento\Framework\AuthorizationInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Resolver\Value; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\LoginAsCustomerApi\Api\ConfigInterface; +use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken; + +/** + * Gets customer token + * + * Class RequestCustomerToken + */ +class RequestCustomerToken implements ResolverInterface +{ + /** + * @var ConfigInterface + */ + private $config; + + /** + * @var AuthorizationInterface + */ + private $authorization; + + /** + * @var CreateCustomerToken + */ + private $createCustomerToken; + + /** + * RequestCustomerToken constructor. + * @param AuthorizationInterface $authorization + * @param ConfigInterface $config + * @param CreateCustomerToken $createCustomerToken + */ + public function __construct( + AuthorizationInterface $authorization, + ConfigInterface $config, + CreateCustomerToken $createCustomerToken + ) { + $this->authorization = $authorization; + $this->config = $config; + $this->createCustomerToken = $createCustomerToken; + } + + /** + * Get Customer Token using email + * + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * @return Value|mixed|void + * @throws GraphQlAuthorizationException|GraphQlNoSuchEntityException|LocalizedException + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + $isAllowedLogin = $this->authorization->isAllowed('Magento_LoginAsCustomer::login'); + $isEnabled = $this->config->isEnabled(); + + /* Get input params */ + try { + $args = $args['input'] ?: []; + } catch (NoSuchEntityException $e) { + throw new GraphQlNoSuchEntityException(__('Check input params.')); + } + + if (empty(trim($args['customer_email'], " "))) { + throw new GraphQlInputException(__('Specify the "customer email" value.')); + } + + $this->validateUser($context); + + if (!$isAllowedLogin || !$isEnabled) { + throw new GraphQlAuthorizationException( + __('Login as Customer is disabled.') + ); + } + + return $this->createCustomerToken->execute($args['customer_email']); + } + + /** + * Check if its an admin user + * + * @param $context + * @throws GraphQlAuthorizationException + */ + private function validateUser($context) + { + if ($context->getUserType() != 2 || $context->getUserId() == 0) { + throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); + } + } +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/README.md b/app/code/Magento/LoginAsCustomerGraphQl/README.md new file mode 100755 index 0000000000000..dc5e03c96feca --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/README.md @@ -0,0 +1,51 @@ +# Module Magento LoginAsCustomerGraphQl + + ``magento/module-loginascustomergraphql`` + + - [Main Functionalities](#markdown-header-main-functionalities) + - [Installation](#markdown-header-installation) + - [Configuration](#markdown-header-configuration) + - [Specifications](#markdown-header-specifications) + - [Attributes](#markdown-header-attributes) + + +## Main Functionalities +Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account. + +## Installation +\* = in production please use the `--keep-generated` option + +### Type 1: Zip file + + - Unzip the zip file in `app/code/Magento` + - Enable the module by running `php bin/magento module:enable Magento_LoginAsCustomerGraphQl` + - Apply database updates by running `php bin/magento setup:upgrade`\* + - Flush the cache by running `php bin/magento cache:flush` + +### Type 2: Composer + + - Make the module available in a composer repository for example: + - private repository `repo.magento.com` + - public repository `packagist.org` + - public github repository as vcs + - Add the composer repository to the configuration by running `composer config repositories.repo.magento.com composer https://repo.magento.com/` + - Install the module composer by running `composer require magento/module-loginascustomergraphql` + - enable the module by running `php bin/magento module:enable Magento_LoginAsCustomerGraphQl` + - apply database updates by running `php bin/magento setup:upgrade`\* + - Flush the cache by running `php bin/magento cache:flush` + + +## Configuration + + + + +## Specifications + + + + +## Attributes + + + diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json new file mode 100755 index 0000000000000..2c70eb9e468b0 --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -0,0 +1,26 @@ +{ + "name": "magento/module-loginascustomergraphql", + "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", + "type": "magento2-module", + "require": {}, + "version": "1.0.0", + "require": { + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/framework": "102.0.*" + }, + "suggest": { + "magento/module-graph-ql": "100.3.*" + }, + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\LoginAsCustomerGraphQl\\": "" + } + } +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml new file mode 100755 index 0000000000000..5082d39a2829d --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" ?> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_LoginAsCustomerGraphQl" setup_version="1.0.0"> + <sequence> + <module name="Magento_Customer"/> + <module name="Magento_LoginAsCustomer"/> + <module name="Magento_Authorization"/> + <module name="Magento_GraphQl"/> + </sequence> + </module> +</config> diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls new file mode 100755 index 0000000000000..f67da3014349a --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls @@ -0,0 +1,27 @@ +type Mutation { + generateCustomerTokenAsAdmin( + input: GenerateCustomerTokenAsAdminInput! + ): GenerateCustomerTokenAsAdminOutput + @resolver(class: "Magento\\LoginAsCustomerGraphQl\\Model\\Resolver\\RequestCustomerToken") + @doc(description: "Request a token using Customer email") +} + +input GenerateCustomerTokenAsAdminInput { + customer_email: String! +} + +type GenerateCustomerTokenAsAdminOutput { + customer_token: String! +} + +type Customer { + allow_remote_shopping_assistance: Boolean! +} + +input CustomerCreateInput { + allow_remote_shopping_assistance: Boolean +} + +input CustomerUpdateInput { + allow_remote_shopping_assistance: Boolean +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/registration.php b/app/code/Magento/LoginAsCustomerGraphQl/registration.php new file mode 100755 index 0000000000000..22f3f5994ee8e --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/registration.php @@ -0,0 +1,4 @@ +<?php +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_LoginAsCustomerGraphQl', __DIR__); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php new file mode 100755 index 0000000000000..82c1e4d47e13b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -0,0 +1,218 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\LoginAsCustomer; + +use Exception; +use Magento\Framework\Exception\AuthenticationException; +use Magento\Integration\Api\AdminTokenServiceInterface as AdminTokenService; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * API-functional tests cases for generateCustomerToken mutation + */ +class GenerateLoginCustomerTokenTest extends GraphQlAbstract +{ + + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + /** + * @var AdminTokenService + */ + private $adminTokenService; + + /** + * Set Up + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + $this->adminTokenService = $objectManager->get(AdminTokenService::class); + } + + /** + * Verify with Admin email ID and Magento_LoginAsCustomer::login is enabled + * + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoConfigFixture default_store login_as_customer/general/enabled 1 + * @throws Exception + */ + public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() + { + $customerEmail = 'customer@example.com'; + + $mutation = $this->getQuery($customerEmail); + + $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777')); + $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); + $this->assertIsArray($response['generateCustomerTokenAsAdmin']); + } + + /** + * Verify with Admin email ID and Magento_LoginAsCustomer::login is disabled + * + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoConfigFixture default_store login_as_customer/general/enabled 0 + * @throws Exception + */ + public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() + { + $customerEmail = 'customer@example.com'; + + $mutation = $this->getQuery($customerEmail); + + $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777')); + $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); + $this->assertIsArray($response['generateCustomerTokenAsAdmin']); + } + + /** + * Verify with Customer Token in auth header + * + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoConfigFixture default_store login_as_customer/general/enabled 1 + * @throws Exception + */ + public function testGenerateCustomerTokenLoginWithCustomerCredentials() + { + $customerEmail = 'customer@example.com'; + $password = 'password'; + + $mutation = $this->getQuery($customerEmail); + + $this->expectException(Exception::class); + $this->expectExceptionMessage("The current customer isn't authorized."); + + $response = $this->graphQlMutation($mutation, [], '', $this->getCustomerHeaderAuthentication($customerEmail, $password)); + $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); + $this->assertIsArray($response['generateCustomerTokenAsAdmin']); + } + + /** + * Test with invalid data. + * + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * @magentoConfigFixture default_store login_as_customer/general/enabled 1 + * + * @dataProvider dataProviderInvalidInfo + * @param string $adminUserName + * @param string $adminPassword + * @param string $customerEmail + * @param string $message + */ + public function testGenerateCustomerTokenInvalidData(string $adminUserName, string $adminPassword, string $customerEmail, string $message) + { + $this->expectException(Exception::class); + + $mutation = $this->getQuery($customerEmail); + $this->expectExceptionMessage($message); + $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication($adminUserName, $adminPassword)); + } + + /** + * @return array + */ + public function dataProviderInvalidInfo(): array + { + return [ + 'invalid_admin_user_name' => [ + 'TestAdmin(^%', + 'Zilker777', + 'customer@example.com', + 'The account sign-in was incorrect or your account is disabled temporarily. ' . + 'Please wait and try again later.' + ], + 'invalid_admin_password' => [ + 'TestAdmin1', + 'invalid_password', + 'customer@example.com', + 'The account sign-in was incorrect or your account is disabled temporarily. ' . + 'Please wait and try again later.' + ], + 'invalid_customer_email' => [ + 'TestAdmin1', + 'Zilker777', + 'DCvsMarvel@example.com', + 'Customer email provided does not exist' + ], + 'empty_customer_email' => [ + 'TestAdmin1', + 'Zilker777', + 'Specify the customer email value', + 'Customer email provided does not exist' + ] + ]; + } + + /** + * @param string $customerEmail + * @return string + */ + private function getQuery(string $customerEmail) : string + { + return <<<MUTATION +mutation{ + generateCustomerTokenAsAdmin(input: { + customer_email: "{$customerEmail}" + }){ + customer_token + } +} +MUTATION; + } + + /** + * Generate customer authentication token + * + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * + * @param string $username + * @param string $password + * @return string[] + * @throws AuthenticationException + */ + public function getCustomerHeaderAuthentication( + string $username = 'github@gmail.com', + string $password = 'Zilker777' + ): array { + $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); + + return ['Authorization' => 'Bearer ' . $customerToken]; + } + + /** + * To get admin access token + * + * @param string $userName + * @param string $password + * @return string[] + * @throws AuthenticationException + */ + public function getAdminHeaderAuthentication(string $userName, string $password) + { + try { + $adminAccessToken = $this->adminTokenService->createAdminAccessToken($userName, $password); + + return ['Authorization' => 'Bearer ' . $adminAccessToken]; + } catch (\Exception $e) { + throw new AuthenticationException( + __( + 'The account sign-in was incorrect or your account is disabled temporarily. ' + . 'Please wait and try again later.' + ) + ); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php new file mode 100755 index 0000000000000..b6904c3e3c28a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +use Magento\User\Model\UserFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var UserFactory $userFactory */ +$userFactory = $objectManager->get(UserFactory::class); +$adminInfo = [ + 'username' => 'TestAdmin1', + 'firstname' => 'test', + 'lastname' => 'test', + 'email' => 'testadmin1@gmail.com', + 'password' =>'Zilker777', + 'interface_locale' => 'en_US', + 'is_active' => 1 +]; + +$userModel = $userFactory->create(); +try { + $userModel->setData($adminInfo); + $userModel->setRoleId(1); + $userModel->save(); +} catch (\Magento\Framework\Exception\AlreadyExistsException $e) { + +} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php new file mode 100755 index 0000000000000..ed9b8923bc51b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +use Magento\User\Model\UserFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var UserFactory $userFactory */ +$userFactory = $objectManager->get(UserFactory::class); + +$userModel = $userFactory->create(); +$userModel->loadByUsername('TestAdmin1'); +if ($userModel->getId()) { + $userModel->delete(); +} From e95d2fefefb62150e566f000a4a17f58f6716af5 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Mon, 21 Sep 2020 16:36:46 +0100 Subject: [PATCH 032/490] Revert #27391 changes Status field is no longer used in that query after this PR --- app/code/Magento/Cron/etc/db_schema.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index de7ebf3fc50b6..72b1428756898 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -26,9 +26,5 @@ <column name="status"/> <column name="scheduled_at"/> </index> - <index referenceId="CRON_SCHEDULE_SCHEDULE_ID_STATUS" indexType="btree"> - <column name="schedule_id"/> - <column name="status"/> - </index> </table> </schema> From 916bc93138f7a81f65c2e8b5069eeb0f35fceb43 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Mon, 21 Sep 2020 16:40:43 +0100 Subject: [PATCH 033/490] Revert #27391 changes Status field is no longer used in the query --- app/code/Magento/Cron/etc/db_schema_whitelist.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index a598c6d213c55..74836c0be8a2e 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -13,8 +13,7 @@ "index": { "CRON_SCHEDULE_JOB_CODE": true, "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, - "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true, - "CRON_SCHEDULE_SCHEDULE_ID_STATUS": true + "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { "PRIMARY": true From edd77531f8847f7b13dbaca9aefa315ba4aa5e57 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> Date: Mon, 21 Sep 2020 22:23:38 +0300 Subject: [PATCH 034/490] Fix SVC failure --- app/code/Magento/Cron/etc/db_schema_whitelist.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index 74836c0be8a2e..2e5cc6e0a4618 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -13,6 +13,7 @@ "index": { "CRON_SCHEDULE_JOB_CODE": true, "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, + "CRON_SCHEDULE_SCHEDULE_ID_STATUS": true, "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { From 12d25237fe587c6067d3528fb64bf0d344bf432c Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Tue, 22 Sep 2020 20:38:45 +0530 Subject: [PATCH 035/490] Updated the module as suggested --- .../LoginAsCustomer/CreateCustomerToken.php | 41 +++++++++++-------- .../Model/Resolver/RequestCustomerToken.php | 16 ++++---- .../LoginAsCustomerGraphQl/composer.json | 5 ++- .../LoginAsCustomerGraphQl/etc/module.xml | 2 +- .../LoginAsCustomerGraphQl/registration.php | 12 +++++- .../GenerateLoginCustomerTokenTest.php | 12 +++--- .../Magento/LoginAsCustomer/_files/admin.php | 7 +++- 7 files changed, 60 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index d188e33b7f60f..13ea87442ddfb 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -1,5 +1,4 @@ <?php - /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. @@ -8,11 +7,12 @@ namespace Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer; -use Magento\Customer\Model\Customer; +use Magento\Customer\Model\CustomerFactory; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Integration\Model\Oauth\TokenFactory; +use Magento\Setup\Exception; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\GraphQl\Exception\GraphQlInputException; /** * Create customer token from customer email @@ -22,9 +22,9 @@ class CreateCustomerToken { /** - * @var Customer + * @var CustomerFactory */ - private $customer; + private $customerFactory; /** * @var TokenFactory @@ -40,16 +40,16 @@ class CreateCustomerToken * CreateCustomerToken constructor. * @param StoreManagerInterface $storeManager * @param TokenFactory $tokenModelFactory - * @param Customer $customer + * @param CustomerFactory $customerFactory */ public function __construct( StoreManagerInterface $storeManager, TokenFactory $tokenModelFactory, - Customer $customer + CustomerFactory $customerFactory ) { $this->storeManager = $storeManager; $this->tokenModelFactory = $tokenModelFactory; - $this->customer= $customer; + $this->customerFactory= $customerFactory; } /** @@ -57,22 +57,31 @@ public function __construct( * @return array * @throws LocalizedException */ - public function execute(string $email) + public function execute(string $email): array { $websiteID = $this->storeManager->getStore()->getWebsiteId(); - $this->customer->setWebsiteId($websiteID)->loadByEmail($email); + + $customer = $this->customerFactory->create()->setWebsiteId($websiteID)->loadByEmail($email); /* Check if customer email exist */ - if (!$this->customer->getId()) { + if (!$customer->getId()) { throw new GraphQlInputException( __('Customer email provided does not exist') ); } - $customerId = $this->customer->getId(); - $customerToken = $this->tokenModelFactory->create(); - return [ - "customer_token" => $customerToken->createCustomerToken($customerId)->getToken() - ]; + try { + return [ + "customer_token" => $this->tokenModelFactory->create() + ->createCustomerToken($customer->getId())->getToken() + ]; + } catch (Exception $e) { + throw new LocalizedException( + __( + 'Unable to generate tokens. ' + . 'Please wait and try again later.' + ) + ); + } } } diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index 5c2e340c529df..b1c8b5ad08d9c 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -17,18 +17,16 @@ use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\LoginAsCustomerApi\Api\ConfigInterface; +use Magento\LoginAsCustomerApi\Api\ConfigInterface as LoginAsCustomerConfig; use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken; /** * Gets customer token - * - * Class RequestCustomerToken */ class RequestCustomerToken implements ResolverInterface { /** - * @var ConfigInterface + * @var LoginAsCustomerConfig */ private $config; @@ -45,12 +43,12 @@ class RequestCustomerToken implements ResolverInterface /** * RequestCustomerToken constructor. * @param AuthorizationInterface $authorization - * @param ConfigInterface $config + * @param LoginAsCustomerConfig $config * @param CreateCustomerToken $createCustomerToken */ public function __construct( AuthorizationInterface $authorization, - ConfigInterface $config, + LoginAsCustomerConfig $config, CreateCustomerToken $createCustomerToken ) { $this->authorization = $authorization; @@ -104,12 +102,12 @@ public function resolve( /** * Check if its an admin user * - * @param $context + * @param ContextInterface $context * @throws GraphQlAuthorizationException */ - private function validateUser($context) + private function validateUser(ContextInterface $context): void { - if ($context->getUserType() != 2 || $context->getUserId() == 0) { + if ($context->getUserType() !== 2 || $context->getUserId() === 0) { throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); } } diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 2c70eb9e468b0..a14540716acc2 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -6,7 +6,10 @@ "version": "1.0.0", "require": { "php": "~7.1.3||~7.2.0||~7.3.0", - "magento/framework": "102.0.*" + "magento/framework": "102.0.*", + "magento/module-login-as-customer-api": "100.4.*", + "magento/module-customer": "103.0.*", + "magento/module-login-as-customer-admin-ui": "100.4.0" }, "suggest": { "magento/module-graph-ql": "100.3.*" diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index 5082d39a2829d..a289b2fd33f52 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -1,6 +1,6 @@ <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="Magento_LoginAsCustomerGraphQl" setup_version="1.0.0"> + <module name="Magento_LoginAsCustomerGraphQl"> <sequence> <module name="Magento_Customer"/> <module name="Magento_LoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomerGraphQl/registration.php b/app/code/Magento/LoginAsCustomerGraphQl/registration.php index 22f3f5994ee8e..0981811982e6b 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/registration.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/registration.php @@ -1,4 +1,14 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + use Magento\Framework\Component\ComponentRegistrar; -ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_LoginAsCustomerGraphQl', __DIR__); +ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_LoginAsCustomerGraphQl', + __DIR__ +); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index 82c1e4d47e13b..612f4ac09c22c 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -30,9 +30,6 @@ class GenerateLoginCustomerTokenTest extends GraphQlAbstract */ private $adminTokenService; - /** - * Set Up - */ protected function setUp(): void { $objectManager = Bootstrap::getObjectManager(); @@ -54,7 +51,12 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() $mutation = $this->getQuery($customerEmail); - $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777')); + $response = $this->graphQlMutation( + $mutation, + [], + '', + $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777') + ); $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); $this->assertIsArray($response['generateCustomerTokenAsAdmin']); } @@ -200,7 +202,7 @@ public function getCustomerHeaderAuthentication( * @return string[] * @throws AuthenticationException */ - public function getAdminHeaderAuthentication(string $userName, string $password) + private function getAdminHeaderAuthentication(string $userName, string $password) { try { $adminAccessToken = $this->adminTokenService->createAdminAccessToken($userName, $password); diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php index b6904c3e3c28a..515b42542913b 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php @@ -4,11 +4,15 @@ * See COPYING.txt for license details. */ use Magento\User\Model\UserFactory; +use Magento\User\Model\ResourceModel\User as UserResource; $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var UserFactory $userFactory */ $userFactory = $objectManager->get(UserFactory::class); +/** @var UserResource $userResource */ +$userResource = $objectManager->get(UserResource::class); + $adminInfo = [ 'username' => 'TestAdmin1', 'firstname' => 'test', @@ -23,7 +27,6 @@ try { $userModel->setData($adminInfo); $userModel->setRoleId(1); - $userModel->save(); + $userResource->save($userModel); } catch (\Magento\Framework\Exception\AlreadyExistsException $e) { - } From 13c6b6e679b157256e18111b9ec0d45450eb235c Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Fri, 25 Sep 2020 19:51:39 +0530 Subject: [PATCH 036/490] fixes for magento automation testing v1 --- .../Model/LoginAsCustomer/CreateCustomerToken.php | 6 +++--- .../Model/Resolver/RequestCustomerToken.php | 6 +++--- app/code/Magento/LoginAsCustomerGraphQl/composer.json | 2 +- app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml | 6 ++++++ app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls | 3 +++ .../LoginAsCustomer/GenerateLoginCustomerTokenTest.php | 6 ------ 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index 13ea87442ddfb..0693ee19be843 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -24,17 +24,17 @@ class CreateCustomerToken /** * @var CustomerFactory */ - private $customerFactory; + private CustomerFactory $customerFactory; /** * @var TokenFactory */ - private $tokenModelFactory; + private TokenFactory $tokenModelFactory; /** * @var StoreManagerInterface */ - private $storeManager; + private StoreManagerInterface $storeManager; /** * CreateCustomerToken constructor. diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index b1c8b5ad08d9c..4b318984c7aa8 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -28,17 +28,17 @@ class RequestCustomerToken implements ResolverInterface /** * @var LoginAsCustomerConfig */ - private $config; + private LoginAsCustomerConfig $config; /** * @var AuthorizationInterface */ - private $authorization; + private AuthorizationInterface $authorization; /** * @var CreateCustomerToken */ - private $createCustomerToken; + private CreateCustomerToken $createCustomerToken; /** * RequestCustomerToken constructor. diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index a14540716acc2..4a240fc742464 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -1,5 +1,5 @@ { - "name": "magento/module-loginascustomergraphql", + "name": "magento/module-login-as-customer-graph-ql", "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", "type": "magento2-module", "require": {}, diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index a289b2fd33f52..f3ad1f8c69e44 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -1,4 +1,10 @@ <?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:Module/etc/module.xsd"> <module name="Magento_LoginAsCustomerGraphQl"> <sequence> diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls index f67da3014349a..da41db5210fd6 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls @@ -1,3 +1,6 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. + type Mutation { generateCustomerTokenAsAdmin( input: GenerateCustomerTokenAsAdminInput! diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index 612f4ac09c22c..fb4b1001b46d0 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -148,12 +148,6 @@ public function dataProviderInvalidInfo(): array 'Zilker777', 'DCvsMarvel@example.com', 'Customer email provided does not exist' - ], - 'empty_customer_email' => [ - 'TestAdmin1', - 'Zilker777', - 'Specify the customer email value', - 'Customer email provided does not exist' ] ]; } From 81cfc8af8f8f44a0218d34a1302bb9733efe2663 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Sat, 26 Sep 2020 12:38:57 +0530 Subject: [PATCH 037/490] fixes for magento automation testing v2 --- .../LoginAsCustomer/CreateCustomerToken.php | 2 + .../Model/Resolver/RequestCustomerToken.php | 1 + .../LoginAsCustomerGraphQl/composer.json | 13 +++---- .../LoginAsCustomerGraphQl/etc/module.xml | 1 - .../GenerateLoginCustomerTokenTest.php | 37 +++++++++++++------ 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index 0693ee19be843..28383df027eda 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -53,6 +53,8 @@ public function __construct( } /** + * Get admin user token + * * @param string $email * @return array * @throws LocalizedException diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index 4b318984c7aa8..e3e4878f3aa28 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -19,6 +19,7 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\LoginAsCustomerApi\Api\ConfigInterface as LoginAsCustomerConfig; use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; /** * Gets customer token diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 4a240fc742464..7298f80f3c815 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -1,19 +1,15 @@ { "name": "magento/module-login-as-customer-graph-ql", "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", - "type": "magento2-module", - "require": {}, - "version": "1.0.0", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "102.0.*", - "magento/module-login-as-customer-api": "100.4.*", - "magento/module-customer": "103.0.*", - "magento/module-login-as-customer-admin-ui": "100.4.0" + "magento/module-customer": "103.0.*" }, "suggest": { "magento/module-graph-ql": "100.3.*" }, + "type": "magento2-module", "license": [ "OSL-3.0", "AFL-3.0" @@ -25,5 +21,6 @@ "psr-4": { "Magento\\LoginAsCustomerGraphQl\\": "" } - } + }, + "version": "1.0.0" } diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index f3ad1f8c69e44..09a890bfe1021 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -9,7 +9,6 @@ <module name="Magento_LoginAsCustomerGraphQl"> <sequence> <module name="Magento_Customer"/> - <module name="Magento_LoginAsCustomer"/> <module name="Magento_Authorization"/> <module name="Magento_GraphQl"/> </sequence> diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index fb4b1001b46d0..1825024d2d953 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -75,7 +75,12 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() $mutation = $this->getQuery($customerEmail); - $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777')); + $response = $this->graphQlMutation( + $mutation, + [], + '', + $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777') + ); $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); $this->assertIsArray($response['generateCustomerTokenAsAdmin']); } @@ -97,7 +102,12 @@ public function testGenerateCustomerTokenLoginWithCustomerCredentials() $this->expectException(Exception::class); $this->expectExceptionMessage("The current customer isn't authorized."); - $response = $this->graphQlMutation($mutation, [], '', $this->getCustomerHeaderAuthentication($customerEmail, $password)); + $response = $this->graphQlMutation( + $mutation, + [], + '', + $this->getCustomerHeaderAuthentication($customerEmail, $password) + ); $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); $this->assertIsArray($response['generateCustomerTokenAsAdmin']); } @@ -114,16 +124,27 @@ public function testGenerateCustomerTokenLoginWithCustomerCredentials() * @param string $customerEmail * @param string $message */ - public function testGenerateCustomerTokenInvalidData(string $adminUserName, string $adminPassword, string $customerEmail, string $message) - { + public function testGenerateCustomerTokenInvalidData( + string $adminUserName, + string $adminPassword, + string $customerEmail, + string $message + ) { $this->expectException(Exception::class); $mutation = $this->getQuery($customerEmail); $this->expectExceptionMessage($message); - $response = $this->graphQlMutation($mutation, [], '', $this->getAdminHeaderAuthentication($adminUserName, $adminPassword)); + $response = $this->graphQlMutation( + $mutation, + [], + '', + $this->getAdminHeaderAuthentication($adminUserName, $adminPassword) + ); } /** + * Provides invalid test cases data + * * @return array */ public function dataProviderInvalidInfo(): array @@ -142,12 +163,6 @@ public function dataProviderInvalidInfo(): array 'customer@example.com', 'The account sign-in was incorrect or your account is disabled temporarily. ' . 'Please wait and try again later.' - ], - 'invalid_customer_email' => [ - 'TestAdmin1', - 'Zilker777', - 'DCvsMarvel@example.com', - 'Customer email provided does not exist' ] ]; } From f64315ef92306f5ba5f0b25aa34766b08510c468 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Mon, 28 Sep 2020 15:55:35 +0530 Subject: [PATCH 038/490] fixes for magento automation testing v3 --- .../Model/LoginAsCustomer/CreateCustomerToken.php | 6 +++--- .../Model/Resolver/RequestCustomerToken.php | 1 + app/code/Magento/LoginAsCustomerGraphQl/composer.json | 9 ++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index 28383df027eda..3a9e3077b0387 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -24,17 +24,17 @@ class CreateCustomerToken /** * @var CustomerFactory */ - private CustomerFactory $customerFactory; + private $customerFactory; /** * @var TokenFactory */ - private TokenFactory $tokenModelFactory; + private $tokenModelFactory; /** * @var StoreManagerInterface */ - private StoreManagerInterface $storeManager; + private $storeManager; /** * CreateCustomerToken constructor. diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index e3e4878f3aa28..9c96fd868df96 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -67,6 +67,7 @@ public function __construct( * @param array|null $args * @return Value|mixed|void * @throws GraphQlAuthorizationException|GraphQlNoSuchEntityException|LocalizedException + * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function resolve( Field $field, diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 7298f80f3c815..78af5020f9826 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -2,12 +2,11 @@ "name": "magento/module-login-as-customer-graph-ql", "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", "require": { - "php": "~7.3.0||~7.4.0", + "php": "~7.4.0", "magento/framework": "102.0.*", - "magento/module-customer": "103.0.*" - }, - "suggest": { - "magento/module-graph-ql": "100.3.*" + "magento/module-customer": "103.0.*", + "magento/module-catalog-graph-ql": "100.4.*", + "magento/framework": "103.0.*" }, "type": "magento2-module", "license": [ From cc0c94263c7c73e8f84adaa5ea0045211f5e76b7 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 29 Sep 2020 11:16:17 +0300 Subject: [PATCH 039/490] Allow customer to specify associated product qtys when adding grouped via REST --- .../Api/Data/GroupedItemQtyInterface.php | 64 ----------- .../Api/Data/GroupedOptionsInterface.php | 45 ++++++++ .../Model/Product/Type/Grouped.php | 9 +- .../Model/Quote/Item/CartItemProcessor.php | 106 +++++++++++++----- .../Model/Quote/Item/GroupedItemQty.php | 91 --------------- .../Model/Quote/Item/GroupedOptions.php | 76 +++++++++++++ app/code/Magento/GroupedProduct/etc/di.xml | 2 +- .../etc/extension_attributes.xml | 2 +- 8 files changed, 208 insertions(+), 187 deletions(-) delete mode 100644 app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php create mode 100644 app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php delete mode 100644 app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php create mode 100644 app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php deleted file mode 100644 index 8f656a7e0c634..0000000000000 --- a/app/code/Magento/GroupedProduct/Api/Data/GroupedItemQtyInterface.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\GroupedProduct\Api\Data; - -/** - * Object that contains quantity information for a single associated product of a Grouped Product - * - * Interface \Magento\GroupedProduct\Api\Data\GroupedItemQtyInterface - */ -interface GroupedItemQtyInterface extends \Magento\Framework\Api\ExtensibleDataInterface -{ - const PRODUCT_ID = 'product_id'; - const QTY = 'qty'; - - /** - * Set associated product id - * - * @param int|string $value - */ - public function setProductId($value); - - /** - * Get associated product id - * - * @return int|string - */ - public function getProductId(); - - /** - * Set associated product qty - * - * @param int|string $qty - */ - public function setQty($qty); - - /** - * Get associated product qty - * - * @return int - */ - public function getQty(); - - /** - * Set extension attributes - * - * @param \Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface $extensionAttributes - * - * @return $this - */ - public function setExtensionAttributes( - \Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface $extensionAttributes - ); - - /** - * Get extension attributes - * - * @return \Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface|null - */ - public function getExtensionAttributes(); -} diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php new file mode 100644 index 0000000000000..e7ea3a60359ea --- /dev/null +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GroupedProduct\Api\Data; + +use Magento\Framework\Api\ExtensibleDataInterface; + +/** + * Represents `product item id with qty` of a grouped product. + */ +interface GroupedOptionsInterface extends ExtensibleDataInterface +{ + /** + * Get associated product id + * + * @return int + */ + public function getId(): int; + + /** + * Get associated product qty + * + * @return float + */ + public function getQty(): float; + + /** + * Set extension attributes + * + * @param \Magento\GroupedProduct\Api\Data\GroupedOptionsExtensionInterface $extensionAttributes + * @return void + */ + public function setExtensionAttributes(GroupedOptionsExtensionInterface $extensionAttributes): void; + + /** + * Get extension attributes + * + * @return \Magento\GroupedProduct\Api\Data\GroupedOptionsExtensionInterface|null + */ + public function getExtensionAttributes(): ?GroupedOptionsExtensionInterface; +} diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 8eac8d0b0e163..9a2b72b19d2d1 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -389,7 +389,9 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p if (is_string($_result)) { return $_result; - } elseif (!isset($_result[0])) { + } + + if (!isset($_result[0])) { return __('Cannot process the item.')->render(); } @@ -407,6 +409,11 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p ] ) ); + if ($buyRequest->getSuperGroup()) { + $serializedValue = $this->serializer->serialize($buyRequest->getSuperGroup()); + $_result[0]->addCustomOption('super_group', $serializedValue); + } + $products[] = $_result[0]; } else { $associatedProductsInfo[] = [$subProduct->getId() => $qty]; diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 1138bed2b123d..05a59f42fca02 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -3,64 +3,94 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\GroupedProduct\Model\Quote\Item; +use Magento\Framework\DataObject; use Magento\Framework\DataObject\Factory as ObjectFactory; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\GroupedProduct\Api\Data\GroupedOptionsInterface; +use Magento\GroupedProduct\Api\Data\GroupedOptionsInterfaceFactory; +use Magento\GroupedProduct\Model\Product\Type\Grouped; +use Magento\Quote\Api\Data as QuoteApi; use Magento\Quote\Api\Data\CartItemInterface; -use Magento\Quote\Api\Data\ProductOptionInterface; use Magento\Quote\Model\Quote\Item\CartItemProcessorInterface; /** - * A class that converts the Grouped Product super group, as received over RESTful API, - * into the format needed within the buy request - * - * Class \Magento\GroupedProduct\Model\Quote\Item\CartItemProcessor + * Converts grouped_options to super_group for the grouped product. */ class CartItemProcessor implements CartItemProcessorInterface { + private const SUPER_GROUP_CODE = 'super_group'; + /** * @var ObjectFactory */ private $objectFactory; /** - * CartItemProcessor constructor. - * + * @var GroupedOptionsInterface + */ + private $groupedOptionFactory; + + /** + * @var Json + */ + private $jsonSerializer; + + /** + * @var QuoteApi\ProductOptionExtensionFactory + */ + private $productOptionExtensionFactory; + + /** + * @var QuoteApi\ProductOptionInterfaceFactory + */ + private $productOptionFactory; + + /** * @param ObjectFactory $objectFactory + * @param GroupedOptionsInterfaceFactory $groupedOptionFactory + * @param Json $jsonSerializer + * @param QuoteApi\ProductOptionExtensionFactory $productOptionExtensionFactory + * @param QuoteApi\ProductOptionInterfaceFactory $productOptionFactory */ - public function __construct(ObjectFactory $objectFactory) - { + public function __construct( + ObjectFactory $objectFactory, + GroupedOptionsInterfaceFactory $groupedOptionFactory, + Json $jsonSerializer, + QuoteApi\ProductOptionExtensionFactory $productOptionExtensionFactory, + QuoteApi\ProductOptionInterfaceFactory $productOptionFactory + ) { $this->objectFactory = $objectFactory; + $this->groupedOptionFactory = $groupedOptionFactory; + $this->jsonSerializer = $jsonSerializer; + $this->productOptionExtensionFactory = $productOptionExtensionFactory; + $this->productOptionFactory = $productOptionFactory; } /** - * Converts the super_group request data into the same format as native frontend add-to-cart + * Converts the grouped_options request data into the same format as native frontend add-to-cart * * @param CartItemInterface $cartItem - * - * @return \Magento\Framework\DataObject|null + * @return DataObject|null */ - public function convertToBuyRequest(CartItemInterface $cartItem) + public function convertToBuyRequest(CartItemInterface $cartItem): ?DataObject { - $productOption = $cartItem->getProductOption(); - if ($productOption instanceof ProductOptionInterface && $productOption->getExtensionAttributes()) { - $superGroup = $productOption->getExtensionAttributes()->getSuperGroup(); - if (is_array($superGroup)) { + $extensionAttributes = $cartItem->getProductOption() + ? $cartItem->getProductOption()->getExtensionAttributes() + : null; + if ($extensionAttributes) { + $groupedOptions = $extensionAttributes->getGroupedOptions(); + if ($groupedOptions) { $requestData = []; - /** @var GroupedItemQty $item */ - foreach ($superGroup as $item) { - if (!isset($requestData['super_group'])) { - $requestData['super_group'] = []; - } - - $requestData['super_group'][$item->getProductId()] = $item->getQty(); + foreach ($groupedOptions as $item) { + $requestData[self::SUPER_GROUP_CODE][$item->getId()] = $item->getQty(); } - if (!empty($requestData)) { - return $this->objectFactory->create($requestData); - } + return $this->objectFactory->create($requestData); } } @@ -71,11 +101,29 @@ public function convertToBuyRequest(CartItemInterface $cartItem) * Option processor * * @param CartItemInterface $cartItem - * * @return CartItemInterface */ - public function processOptions(CartItemInterface $cartItem) + public function processOptions(CartItemInterface $cartItem): CartItemInterface { + if ($cartItem->getProductType() !== Grouped::TYPE_CODE) { + return $cartItem; + } + + $superGroup = $cartItem->getOptionByCode(self::SUPER_GROUP_CODE); + $superGroupValues = $superGroup ? $this->jsonSerializer->unserialize($superGroup->getValue()) : null; + if ($superGroupValues) { + $productOptions = []; + foreach ($superGroupValues as $id => $qty) { + $productOptions[] = $this->groupedOptionFactory->create(['id' => $id, 'qty' => $qty]); + } + + $extension = $this->productOptionExtensionFactory->create()->setGroupedOptions($productOptions); + if (!$cartItem->getProductOption()) { + $cartItem->setProductOption($this->productOptionFactory->create()); + } + $cartItem->getProductOption()->setExtensionAttributes($extension); + } + return $cartItem; } } diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php deleted file mode 100644 index db4c83b25df5f..0000000000000 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedItemQty.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\GroupedProduct\Model\Quote\Item; - -use Magento\Framework\Model\AbstractExtensibleModel; -use Magento\GroupedProduct\Api\Data\GroupedItemQtyInterface; -use Magento\GroupedProduct\Api\Data\GroupedItemQtyExtensionInterface; - -/** - * Object that contains quantity information for a single associated product of a Grouped Product - * - * Class \Magento\GroupedProduct\Model\Quote\Item\GroupedItemQty - */ -class GroupedItemQty extends AbstractExtensibleModel implements GroupedItemQtyInterface -{ - /** - * Set associated product id - * - * @param int|string $value - * - * @return $this - */ - public function setProductId($value) - { - $this->setData(self::PRODUCT_ID, $value); - - return $this; - } - - /** - * Get associated product id - * - * @return int|string - */ - public function getProductId() - { - return $this->getData(self::PRODUCT_ID); - } - - /** - * Set associated product qty - * - * @param int|string $qty - * - * @return $this - */ - public function setQty($qty) - { - $this->setData(self::QTY, $qty); - - return $this; - } - - /** - * Get associated product qty - * - * @return int - */ - public function getQty() - { - return (int)$this->getData(self::QTY); - } - - /** - * Set extension attributes - * - * @param GroupedItemQtyExtensionInterface $extensionAttributes - * - * @return $this - */ - public function setExtensionAttributes(GroupedItemQtyExtensionInterface $extensionAttributes) - { - $this->_setExtensionAttributes($extensionAttributes); - - return $this; - } - - /** - * Get extension attributes - * - * @return GroupedItemQtyExtensionInterface|null - */ - public function getExtensionAttributes() - { - return $this->_getExtensionAttributes(); - } -} diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php new file mode 100644 index 0000000000000..70acba28db325 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GroupedProduct\Model\Quote\Item; + +use Magento\GroupedProduct\Api\Data\GroupedOptionsInterface; +use Magento\GroupedProduct\Api\Data\GroupedOptionsExtensionInterface; + +/** + * @inheritDoc + */ +class GroupedOptions implements GroupedOptionsInterface +{ + /** + * @var float + */ + private $qty; + + /** + * @var int + */ + private $id; + + /** + * @var GroupedOptionsExtensionInterface|null + */ + private $extensionAttributes; + + /** + * @param int $id + * @param float $qty + * @param GroupedOptionsExtensionInterface|null $extensionAttributes + */ + public function __construct(int $id, float $qty, $extensionAttributes = null) + { + $this->id = $id; + $this->qty = $qty; + $this->extensionAttributes = $extensionAttributes; + } + + /** + * @inheritDoc + */ + public function getId(): int + { + return $this->id; + } + + /** + * @inheritDoc + */ + public function getQty(): float + { + return $this->qty; + } + + /** + * @inheritDoc + */ + public function setExtensionAttributes(GroupedOptionsExtensionInterface $extensionAttributes): void + { + $this->extensionAttributes = $extensionAttributes; + } + + /** + * @inheritDoc + */ + public function getExtensionAttributes(): ?GroupedOptionsExtensionInterface + { + return $this->extensionAttributes; + } +} diff --git a/app/code/Magento/GroupedProduct/etc/di.xml b/app/code/Magento/GroupedProduct/etc/di.xml index 71ce81947383b..4c5d397606ed9 100644 --- a/app/code/Magento/GroupedProduct/etc/di.xml +++ b/app/code/Magento/GroupedProduct/etc/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <preference for="Magento\GroupedProduct\Api\Data\GroupedItemQtyInterface" type="Magento\GroupedProduct\Model\Quote\Item\GroupedItemQty" /> + <preference for="Magento\GroupedProduct\Api\Data\GroupedOptionsInterface" type="Magento\GroupedProduct\Model\Quote\Item\GroupedOptions" /> <type name="Magento\Quote\Model\Quote\Item\RelatedProducts"> <arguments> diff --git a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml index 55a41babc4ace..b614a1277de76 100644 --- a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml +++ b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml @@ -11,6 +11,6 @@ </extension_attributes> <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface"> - <attribute code="super_group" type="Magento\GroupedProduct\Api\Data\GroupedItemQtyInterface[]" /> + <attribute code="grouped_options" type="Magento\GroupedProduct\Api\Data\GroupedOptionsInterface[]" /> </extension_attributes> </config> From 74709d2e4fcaec39fd1726c005e0efe69d0992a8 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 29 Sep 2020 12:32:47 +0300 Subject: [PATCH 040/490] test coverage --- .../Magento/Quote/Api/CartAddingItemsTest.php | 117 +++++++++++++++--- 1 file changed, 103 insertions(+), 14 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php index 7900ae45e2f3d..ff5946186f8c8 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php @@ -7,6 +7,11 @@ namespace Magento\Quote\Api; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\Framework\Webapi\Rest\Request; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\WebapiAbstract; /** @@ -15,13 +20,22 @@ class CartAddingItemsTest extends WebapiAbstract { /** - * @var \Magento\TestFramework\ObjectManager + * @var ObjectManager */ protected $objectManager; + /** + * @var ProductResource + */ + private $productResource; + + /** + * @inheritDoc + */ protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->productResource = $this->objectManager->get(ProductResource::class); } /** @@ -36,9 +50,9 @@ public function testPriceForCreatingQuoteFromEmptyCart() $this->_markTestAsRestOnly(); // Get customer ID token - /** @var \Magento\Integration\Api\CustomerTokenServiceInterface $customerTokenService */ + /** @var CustomerTokenServiceInterface $customerTokenService */ $customerTokenService = $this->objectManager->create( - \Magento\Integration\Api\CustomerTokenServiceInterface::class + CustomerTokenServiceInterface::class ); $token = $customerTokenService->createCustomerAccessToken( 'customer_one_address@test.com', @@ -49,7 +63,7 @@ public function testPriceForCreatingQuoteFromEmptyCart() $serviceInfo = [ 'rest' => [ 'resourcePath' => '/V1/carts/mine', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + 'httpMethod' => Request::HTTP_METHOD_POST, 'token' => $token ] ]; @@ -58,13 +72,6 @@ public function testPriceForCreatingQuoteFromEmptyCart() $this->assertGreaterThan(0, $quoteId); // Adding item to the cart - $serviceInfoForAddingProduct = [ - 'rest' => [ - 'resourcePath' => '/V1/carts/mine/items', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, - 'token' => $token - ] - ]; $requestData = [ 'cartItem' => [ 'quote_id' => $quoteId, @@ -72,7 +79,7 @@ public function testPriceForCreatingQuoteFromEmptyCart() 'qty' => 1 ] ]; - $item = $this->_webApiCall($serviceInfoForAddingProduct, $requestData); + $item = $this->_webApiCall($this->getServiceInfoAddToCart($token), $requestData); $this->assertNotEmpty($item); $this->assertEquals(10, $item['price']); @@ -80,7 +87,7 @@ public function testPriceForCreatingQuoteFromEmptyCart() $serviceInfoForGettingPaymentInfo = [ 'rest' => [ 'resourcePath' => '/V1/carts/mine/payment-information', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, + 'httpMethod' => Request::HTTP_METHOD_GET, 'token' => $token ] ]; @@ -92,4 +99,86 @@ public function testPriceForCreatingQuoteFromEmptyCart() $quote->load($quoteId); $quote->delete(); } + + /** + * Test qty for cart after adding grouped product with custom qty. + * + * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped_with_simple.php + * @magentoApiDataFixture Magento/Customer/_files/customer_one_address.php + * @return void + */ + public function testAddToCartGroupedCustomQuantity(): void + { + $this->_markTestAsRestOnly(); + + $firstProductId = $this->productResource->getIdBySku('simple_11'); + $secondProductId = $this->productResource->getIdBySku('simple_22'); + $qtyData = [$firstProductId => 2, $secondProductId => 4]; + + // Get customer ID token + /** @var CustomerTokenServiceInterface $customerTokenService */ + $customerTokenService = $this->objectManager->create(CustomerTokenServiceInterface::class); + $token = $customerTokenService->createCustomerAccessToken( + 'customer_one_address@test.com', + 'password' + ); + + // Creating empty cart for registered customer. + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/carts/mine', + 'httpMethod' => Request::HTTP_METHOD_POST, + 'token' => $token + ] + ]; + + $quoteId = $this->_webApiCall($serviceInfo, ['customerId' => 999]); // customerId 999 will get overridden + $this->assertGreaterThan(0, $quoteId); + + // Adding item to the cart + $productOptionData = [ + 'extension_attributes' => [ + 'grouped_options' => [ + ['id' => $firstProductId, 'qty' => $qtyData[$firstProductId]], + ['id' => $secondProductId, 'qty' => $qtyData[$secondProductId]], + ] + ] + ]; + $requestData = [ + 'cartItem' => [ + 'quote_id' => $quoteId, + 'sku' => 'grouped', + 'qty' => 1, + 'product_option' => $productOptionData + ] + ]; + $response = $this->_webApiCall($this->getServiceInfoAddToCart($token), $requestData); + $this->assertArrayHasKey('product_option', $response); + $this->assertEquals($response['product_option'], $productOptionData); + + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $this->objectManager->get(CartRepositoryInterface::class); + $quote = $cartRepository->get($quoteId); + + foreach ($quote->getAllItems() as $item) { + $this->assertEquals($qtyData[$item->getProductId()], $item->getQty()); + } + } + + /** + * Returns service info add to cart + * + * @param string $token + * @return array + */ + private function getServiceInfoAddToCart(string $token): array + { + return [ + 'rest' => [ + 'resourcePath' => '/V1/carts/mine/items', + 'httpMethod' => Request::HTTP_METHOD_POST, + 'token' => $token + ] + ]; + } } From 13dd676241bfdb163d453c384aef7831474557b1 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Wed, 30 Sep 2020 11:01:29 +0530 Subject: [PATCH 041/490] fixes for magento automation testing v4 --- .../LoginAsCustomer/CreateCustomerToken.php | 2 +- .../Model/Resolver/RequestCustomerToken.php | 10 +++++----- .../LoginAsCustomerGraphQl/composer.json | 5 ++++- .../GenerateLoginCustomerTokenTest.php | 10 ++++++---- .../login_as_customer_config_disable.php | 19 +++++++++++++++++++ .../login_as_customer_config_enable.php | 19 +++++++++++++++++++ ...gin_as_customer_config_enable_rollback.php | 19 +++++++++++++++++++ 7 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php create mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php create mode 100644 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index 3a9e3077b0387..e33a7aef25a31 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -11,8 +11,8 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Integration\Model\Oauth\TokenFactory; -use Magento\Setup\Exception; use Magento\Store\Model\StoreManagerInterface; +use Exception; /** * Create customer token from customer email diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index 9c96fd868df96..8536ec78df45a 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -12,6 +12,7 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; @@ -19,7 +20,6 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\LoginAsCustomerApi\Api\ConfigInterface as LoginAsCustomerConfig; use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken; -use Magento\Framework\GraphQl\Exception\GraphQlInputException; /** * Gets customer token @@ -29,17 +29,17 @@ class RequestCustomerToken implements ResolverInterface /** * @var LoginAsCustomerConfig */ - private LoginAsCustomerConfig $config; + private $config; /** * @var AuthorizationInterface */ - private AuthorizationInterface $authorization; + private $authorization; /** * @var CreateCustomerToken */ - private CreateCustomerToken $createCustomerToken; + private $createCustomerToken; /** * RequestCustomerToken constructor. @@ -67,7 +67,7 @@ public function __construct( * @param array|null $args * @return Value|mixed|void * @throws GraphQlAuthorizationException|GraphQlNoSuchEntityException|LocalizedException - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( Field $field, diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 78af5020f9826..91e4c333f67f0 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -2,8 +2,11 @@ "name": "magento/module-login-as-customer-graph-ql", "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", "require": { - "php": "~7.4.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "102.0.*", + "magento/module-login-as-customer-api": "100.4.*", + "magento/module-integration": "100.4.*", + "magento/module-store": "101.1.*", "magento/module-customer": "103.0.*", "magento/module-catalog-graph-ql": "100.4.*", "magento/framework": "103.0.*" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index 1825024d2d953..9c47623d40880 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -41,8 +41,8 @@ protected function setUp(): void * Verify with Admin email ID and Magento_LoginAsCustomer::login is enabled * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoConfigFixture default_store login_as_customer/general/enabled 1 * @throws Exception */ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() @@ -65,8 +65,8 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() * Verify with Admin email ID and Magento_LoginAsCustomer::login is disabled * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoConfigFixture default_store login_as_customer/general/enabled 0 * @throws Exception */ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() @@ -74,6 +74,8 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() $customerEmail = 'customer@example.com'; $mutation = $this->getQuery($customerEmail); + $this->expectException(Exception::class); + $this->expectExceptionMessage("Login as Customer is disabled.."); $response = $this->graphQlMutation( $mutation, @@ -89,7 +91,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() * Verify with Customer Token in auth header * * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoConfigFixture default_store login_as_customer/general/enabled 1 + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php * @throws Exception */ public function testGenerateCustomerTokenLoginWithCustomerCredentials() @@ -116,7 +118,7 @@ public function testGenerateCustomerTokenLoginWithCustomerCredentials() * Test with invalid data. * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php - * @magentoConfigFixture default_store login_as_customer/general/enabled 1 + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php * * @dataProvider dataProviderInvalidInfo * @param string $adminUserName diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php new file mode 100644 index 0000000000000..706c024c53bff --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +use Magento\Config\Model\Config\Factory as ConfigFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; +/** @var ConfigFactory $configFactory */ +$configFactory = $objectManager->get(ConfigFactory::class); + +$configModel = $configFactory->create(); +$configModel->setDataByPath($loginAsCustomerConfigPath, 0); +try { + $configModel->save(); +} catch (Exception $e) { +} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php new file mode 100755 index 0000000000000..426d2575f1547 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +use Magento\Config\Model\Config\Factory as ConfigFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; +/** @var ConfigFactory $configFactory */ +$configFactory = $objectManager->get(ConfigFactory::class); + +$configModel = $configFactory->create(); +$configModel->setDataByPath($loginAsCustomerConfigPath, 1); +try { + $configModel->save(); +} catch (Exception $e) { +} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php new file mode 100644 index 0000000000000..706c024c53bff --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +use Magento\Config\Model\Config\Factory as ConfigFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; +/** @var ConfigFactory $configFactory */ +$configFactory = $objectManager->get(ConfigFactory::class); + +$configModel = $configFactory->create(); +$configModel->setDataByPath($loginAsCustomerConfigPath, 0); +try { + $configModel->save(); +} catch (Exception $e) { +} From 1e10126474ad3eef544505ad4fc4b57b6da1781c Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Wed, 30 Sep 2020 11:06:38 +0530 Subject: [PATCH 042/490] updated version module dependencies --- .../Magento/LoginAsCustomerGraphQl/composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 91e4c333f67f0..99ddb350e94cb 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -3,13 +3,13 @@ "description": "Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account.", "require": { "php": "~7.3.0||~7.4.0", - "magento/framework": "102.0.*", - "magento/module-login-as-customer-api": "100.4.*", - "magento/module-integration": "100.4.*", - "magento/module-store": "101.1.*", - "magento/module-customer": "103.0.*", - "magento/module-catalog-graph-ql": "100.4.*", - "magento/framework": "103.0.*" + "magento/framework": "*", + "magento/module-login-as-customer-api": "*", + "magento/module-integration": "*", + "magento/module-store": "*", + "magento/module-customer": "*", + "magento/module-catalog-graph-ql": "*", + "magento/framework": "*" }, "type": "magento2-module", "license": [ From 3783bea38f9100ca123c8c7c5094739b43cf5417 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Wed, 30 Sep 2020 16:06:01 -0500 Subject: [PATCH 043/490] MC-37484: Cart query error when trying to switch store view --- .../Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php | 8 ++------ .../Magento/GraphQl/Quote/Guest/GetCartTest.php | 9 ++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php index 21243a4545fa3..e27b1067e64fe 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php @@ -76,12 +76,8 @@ public function execute(string $cartHash, ?int $customerId, int $storeId): Quote } if ((int)$cart->getStoreId() !== $storeId) { - throw new GraphQlNoSuchEntityException( - __( - 'Wrong store code specified for cart "%masked_cart_id"', - ['masked_cart_id' => $cartHash] - ) - ); + $cart->setStoreId($storeId); + $this->cartRepository->save($cart); } $cartCustomerId = (int)$cart->getCustomerId(); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php index 858c38cc72dfd..2039f75a6bc4d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php @@ -151,18 +151,17 @@ public function testGetCartWithNotDefaultStore() /** * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php * @magentoApiDataFixture Magento/Store/_files/second_store.php - * */ public function testGetCartWithWrongStore() { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Wrong store code specified for cart'); - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); $query = $this->getQuery($maskedQuoteId); $headerMap = ['Store' => 'fixture_second_store']; - $this->graphQlQuery($query, [], '', $headerMap); + $response = $this->graphQlQuery($query, [], '', $headerMap); + + self::assertArrayHasKey('cart', $response); + self::assertArrayHasKey('items', $response['cart']); } /** From faabbaf2b9907adfa18f1777def31d7e7d1e85fe Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Fri, 2 Oct 2020 14:31:40 -0500 Subject: [PATCH 044/490] MC-37484: Cart query error when trying to switch store view --- .../Model/Cart/GetCartForUser.php | 20 ++++++++++++++++++- .../GraphQl/Quote/Guest/GetCartTest.php | 15 ++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php index e27b1067e64fe..ad5422fa67e07 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php @@ -9,10 +9,12 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface; use Magento\Quote\Model\Quote; +use Magento\Store\Api\StoreRepositoryInterface; /** * Get cart @@ -29,16 +31,24 @@ class GetCartForUser */ private $cartRepository; + /** + * @var StoreRepositoryInterface + */ + private $storeRepository; + /** * @param MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId * @param CartRepositoryInterface $cartRepository + * @param StoreRepositoryInterface $storeRepository */ public function __construct( MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId, - CartRepositoryInterface $cartRepository + CartRepositoryInterface $cartRepository, + StoreRepositoryInterface $storeRepository ) { $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId; $this->cartRepository = $cartRepository; + $this->storeRepository = $storeRepository; } /** @@ -49,6 +59,7 @@ public function __construct( * @param int $storeId * @return Quote * @throws GraphQlAuthorizationException + * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException * @throws NoSuchEntityException */ @@ -76,6 +87,13 @@ public function execute(string $cartHash, ?int $customerId, int $storeId): Quote } if ((int)$cart->getStoreId() !== $storeId) { + $cartStore = $this->storeRepository->getById($cart->getStoreId()); + $newStore = $this->storeRepository->getById($storeId); + if ($cartStore->getWebsite() !== $newStore->getWebsite()) { + throw new GraphQlInputException( + __('Can\'t assign cart to store in different website.') + ); + } $cart->setStoreId($storeId); $this->cartRepository->save($cart); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php index 2039f75a6bc4d..517465fedc417 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php @@ -164,6 +164,21 @@ public function testGetCartWithWrongStore() self::assertArrayHasKey('items', $response['cart']); } + /** + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + * @magentoApiDataFixture Magento/Store/_files/second_website_with_store_group_and_store.php + */ + public function testGetCartWithDifferentStoreDifferentWebsite() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Can\'t assign cart to store in different website.'); + + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $query = $this->getQuery($maskedQuoteId); + + $headerMap = ['Store' => 'fixture_second_store']; + $this->graphQlQuery($query, [], '', $headerMap); + } + /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote_guest_not_default_store.php From d9bbe697ad8909c2929a3d805727237b737a2085 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Fri, 2 Oct 2020 17:04:57 -0500 Subject: [PATCH 045/490] MC-37484: Cart query error when trying to switch store view --- app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php index ad5422fa67e07..1eac282a1e482 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php @@ -7,6 +7,7 @@ namespace Magento\QuoteGraphQl\Model\Cart; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -44,11 +45,11 @@ class GetCartForUser public function __construct( MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId, CartRepositoryInterface $cartRepository, - StoreRepositoryInterface $storeRepository + StoreRepositoryInterface $storeRepository = null ) { $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId; $this->cartRepository = $cartRepository; - $this->storeRepository = $storeRepository; + $this->storeRepository = $storeRepository ?: ObjectManager::getInstance()->get(StoreRepositoryInterface::class); } /** From 3dceba934d0ace9a6b74775e147d859bc3069a54 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 3 Oct 2020 13:22:22 +0300 Subject: [PATCH 046/490] Added changes to schema and add some class --- ...eList.php => AddProductsToCompareList.php} | 2 +- .../Model/Resolver/CreateCompareList.php | 39 +++++++++++++++++++ .../Model/Resolver/DeleteCompareList.php | 39 +++++++++++++++++++ ....php => RemoveProductsFromCompareList.php} | 2 +- .../CompareListGraphQl/etc/schema.graphqls | 34 ++++++++++++---- 5 files changed, 107 insertions(+), 9 deletions(-) rename app/code/Magento/CompareListGraphQl/Model/Resolver/{AddItemsToCompareList.php => AddProductsToCompareList.php} (98%) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php rename app/code/Magento/CompareListGraphQl/Model/Resolver/{RemoveItemsFromCompareList.php => RemoveProductsFromCompareList.php} (98%) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php similarity index 98% rename from app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php rename to app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index 8df7b9f7a221e..177652314c18b 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddItemsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -24,7 +24,7 @@ /** * Class add products to compare list */ -class AddItemsToCompareList implements ResolverInterface +class AddProductsToCompareList implements ResolverInterface { /** * @var CompareListFactory diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php new file mode 100644 index 0000000000000..870b1a21f0c9d --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Resolver\Value; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Class for creating compare list + */ +class CreateCompareList implements ResolverInterface +{ + /** + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return Value|mixed|void + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + // TODO: Implement resolve() method. + } +} \ No newline at end of file diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php new file mode 100644 index 0000000000000..a0f313837ceef --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Resolver\Value; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Class for deleting compare list + */ +class DeleteCompareList implements ResolverInterface +{ + /** + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return Value|mixed|void + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + // TODO: Implement resolve() method. + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php similarity index 98% rename from app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php rename to app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php index d750e142e2dae..35baeb4996048 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveItemsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php @@ -24,7 +24,7 @@ /** * Remove items from compare list */ -class RemoveItemsFromCompareList implements ResolverInterface +class RemoveProductsFromCompareList implements ResolverInterface { /** * @var CompareListFactory diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 6131aa9ec1135..46100d0a61bb7 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -13,16 +13,16 @@ type ComparableItem { type ProductAttribute { code: String! @doc(description:"Attribute code") - value: String! @doc(description:"Addibute display value") + value: String! @doc(description:"Attribute display value") } type ComparableAttribute { code: String! @doc(description: "Attribute code") - title: String! @doc(description: "Addibute display title") + title: String! @doc(description: "Attribute display title") } type CompareList { - list_id: ID! @doc(description: "Compare list id") + uid: ID! @doc(description: "Compare list id") items: [ComparableItem] @doc(description: "Comparable products") attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") } @@ -32,11 +32,31 @@ type Customer { } type Query { - compareList(id: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Compare list") + compareList(uid: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Compare list") } type Mutation { - addItemsToCompareList(id: ID!, items: [ID!]): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddItemsToCompareList") @doc(description: "Add items to compare list") - removeItemsFromCompareList(id: ID!, items: [ID!]): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveItemsFromCompareList") @doc(description: "Remove items from compare list") - assignCompareListToCustomer(customerId: ID!, listId: ID!): Boolean @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") + createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") + addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to compare list") + removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from compare list") + assignCompareListToCustomer(uid: ID!): Boolean @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") + deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete compare list") +} + +input CreateCompareListInput { + products: [ID!] +} + +input AddProductsToCompareListInput { + uid: ID!, + products: [ID!]! +} + +input RemoveProductsFromCompareListInput { + uid: ID!, + products: [ID!]! +} + +type DeleteCompareListOutput { + result: Boolean! } From 571a73e0b11af42450c38d322ff1d512403fd476 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 3 Oct 2020 13:35:17 +0300 Subject: [PATCH 047/490] set type list_id as varchar in DB --- app/code/Magento/Catalog/etc/db_schema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index 23b777350d33c..8a4869023d80b 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -547,7 +547,7 @@ default="0" comment="Product ID"/> <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false" comment="Store ID"/> - <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" identity="false" + <column xsi:type="varchar" name="list_id" padding="10" unsigned="true" nullable="false" identity="false" comment="List ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="catalog_compare_item_id"/> @@ -578,7 +578,7 @@ </index> </table> <table name="catalog_compare_list" resource="default" engine="innodb" comment="Catalog Compare List with hash Table"> - <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" + <column xsi:type="varchar" name="list_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Compare List ID"/> <column xsi:type="int" name="visitor_id" unsigned="true" nullable="false" identity="false" default="0" comment="Visitor ID"/> From a8fe53f54f7471e833ff507f94304f108c402dc5 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 5 Oct 2020 23:41:20 +0300 Subject: [PATCH 048/490] add changes to DB scheme --- .../Magento/Catalog/Model/ResourceModel/CompareList.php | 2 +- app/code/Magento/Catalog/etc/db_schema.xml | 6 ++++-- app/code/Magento/Catalog/etc/db_schema_whitelist.json | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php b/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php index c7ff5e4963214..aca0213832c8f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php @@ -18,6 +18,6 @@ class CompareList extends AbstractDb */ protected function _construct() { - $this->_init('catalog_compare_list', 'list_id'); + $this->_init('catalog_compare_list', 'id'); } } diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index 8a4869023d80b..a3d217127c7eb 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -578,14 +578,16 @@ </index> </table> <table name="catalog_compare_list" resource="default" engine="innodb" comment="Catalog Compare List with hash Table"> + <column xsi:type="int" name="id" padding="5" unsigned="true" nullable="false" + identity="true" comment="ID"/> <column xsi:type="varchar" name="list_id" padding="10" unsigned="true" nullable="false" - identity="true" comment="Compare List ID"/> + identity="false" comment="Compare List ID"/> <column xsi:type="int" name="visitor_id" unsigned="true" nullable="false" identity="false" default="0" comment="Visitor ID"/> <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false" comment="Customer ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> - <column name="list_id"/> + <column name="id"/> </constraint> <constraint xsi:type="foreign" referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="catalog_compare_list" column="customer_id" referenceTable="customer_entity" diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index e927287fdd355..e4a49a4d81b0b 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1127,6 +1127,7 @@ }, "catalog_compare_list": { "column": { + "id": true, "list_id": true, "visitor_id": true, "customer_id": true From 517dc294f5e1ff389f4452e5fc55e5754fd612f6 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Tue, 6 Oct 2020 20:12:17 +0530 Subject: [PATCH 049/490] Added PHPMD suppress comment in testing --- .../Model/Resolver/RequestCustomerToken.php | 8 ++++---- .../Magento/LoginAsCustomerGraphQl/composer.json | 2 +- .../GenerateLoginCustomerTokenTest.php | 15 ++++++++------- .../_files/login_as_customer_config_disable.php | 0 .../login_as_customer_config_enable_rollback.php | 0 5 files changed, 13 insertions(+), 12 deletions(-) mode change 100644 => 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php mode change 100644 => 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index 8536ec78df45a..fd0fc64b50181 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -11,13 +11,13 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; -use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; -use Magento\Framework\GraphQl\Exception\GraphQlInputException; -use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; -use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\LoginAsCustomerApi\Api\ConfigInterface as LoginAsCustomerConfig; use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken; diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 99ddb350e94cb..7e8d24deef0c0 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -24,5 +24,5 @@ "Magento\\LoginAsCustomerGraphQl\\": "" } }, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index 9c47623d40880..d2d715bf5e83e 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -16,6 +16,7 @@ /** * API-functional tests cases for generateCustomerToken mutation + * @SuppressWarnings(PHPMD) */ class GenerateLoginCustomerTokenTest extends GraphQlAbstract { @@ -71,12 +72,12 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() */ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() { - $customerEmail = 'customer@example.com'; - - $mutation = $this->getQuery($customerEmail); $this->expectException(Exception::class); $this->expectExceptionMessage("Login as Customer is disabled.."); + $customerEmail = 'customer@example.com'; + + $mutation = $this->getQuery($customerEmail); $response = $this->graphQlMutation( $mutation, [], @@ -96,14 +97,14 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() */ public function testGenerateCustomerTokenLoginWithCustomerCredentials() { + $this->expectException(Exception::class); + $this->expectExceptionMessage("The current customer isn't authorized."); + $customerEmail = 'customer@example.com'; $password = 'password'; $mutation = $this->getQuery($customerEmail); - $this->expectException(Exception::class); - $this->expectExceptionMessage("The current customer isn't authorized."); - $response = $this->graphQlMutation( $mutation, [], @@ -133,9 +134,9 @@ public function testGenerateCustomerTokenInvalidData( string $message ) { $this->expectException(Exception::class); + $this->expectExceptionMessage($message); $mutation = $this->getQuery($customerEmail); - $this->expectExceptionMessage($message); $response = $this->graphQlMutation( $mutation, [], diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php old mode 100644 new mode 100755 diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php old mode 100644 new mode 100755 From 595763024302b01932d3e956b496ca0738d33dc3 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Thu, 8 Oct 2020 19:18:59 +0530 Subject: [PATCH 050/490] Suggestions mentioned by Rogyar V1 --- .../LoginAsCustomer/CreateCustomerToken.php | 18 +++++------------- .../Model/Resolver/RequestCustomerToken.php | 10 ++++++---- .../LoginAsCustomerGraphQl/composer.json | 3 +-- .../GenerateLoginCustomerTokenTest.php | 9 ++------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index e33a7aef25a31..220ffdf4114e8 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -11,7 +11,7 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Integration\Model\Oauth\TokenFactory; -use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Api\Data\StoreInterface; use Exception; /** @@ -31,23 +31,15 @@ class CreateCustomerToken */ private $tokenModelFactory; - /** - * @var StoreManagerInterface - */ - private $storeManager; - /** * CreateCustomerToken constructor. - * @param StoreManagerInterface $storeManager * @param TokenFactory $tokenModelFactory * @param CustomerFactory $customerFactory */ public function __construct( - StoreManagerInterface $storeManager, TokenFactory $tokenModelFactory, CustomerFactory $customerFactory ) { - $this->storeManager = $storeManager; $this->tokenModelFactory = $tokenModelFactory; $this->customerFactory= $customerFactory; } @@ -56,14 +48,14 @@ public function __construct( * Get admin user token * * @param string $email + * @param StoreInterface $store * @return array + * @throws GraphQlInputException * @throws LocalizedException */ - public function execute(string $email): array + public function execute(string $email, StoreInterface $store): array { - $websiteID = $this->storeManager->getStore()->getWebsiteId(); - - $customer = $this->customerFactory->create()->setWebsiteId($websiteID)->loadByEmail($email); + $customer = $this->customerFactory->create()->setWebsiteId((int)$store->getId())->loadByEmail($email); /* Check if customer email exist */ if (!$customer->getId()) { diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index fd0fc64b50181..a2fb5571c4f3d 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -81,9 +81,9 @@ public function resolve( /* Get input params */ try { - $args = $args['input'] ?: []; + $args = $args['input']; } catch (NoSuchEntityException $e) { - throw new GraphQlNoSuchEntityException(__('Check input params.')); + throw new GraphQlInputException(__('Check input params.')); } if (empty(trim($args['customer_email'], " "))) { @@ -97,8 +97,10 @@ public function resolve( __('Login as Customer is disabled.') ); } - - return $this->createCustomerToken->execute($args['customer_email']); + return $this->createCustomerToken->execute( + $args['customer_email'], + $context->getExtensionAttributes()->getStore() + ); } /** diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 7e8d24deef0c0..8a731de737097 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -8,8 +8,7 @@ "magento/module-integration": "*", "magento/module-store": "*", "magento/module-customer": "*", - "magento/module-catalog-graph-ql": "*", - "magento/framework": "*" + "magento/module-catalog-graph-ql": "*" }, "type": "magento2-module", "license": [ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index d2d715bf5e83e..6b944fa561ad8 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -84,8 +84,6 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() '', $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777') ); - $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); - $this->assertIsArray($response['generateCustomerTokenAsAdmin']); } /** @@ -105,14 +103,12 @@ public function testGenerateCustomerTokenLoginWithCustomerCredentials() $mutation = $this->getQuery($customerEmail); - $response = $this->graphQlMutation( + $this->graphQlMutation( $mutation, [], '', $this->getCustomerHeaderAuthentication($customerEmail, $password) ); - $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); - $this->assertIsArray($response['generateCustomerTokenAsAdmin']); } /** @@ -137,7 +133,7 @@ public function testGenerateCustomerTokenInvalidData( $this->expectExceptionMessage($message); $mutation = $this->getQuery($customerEmail); - $response = $this->graphQlMutation( + $this->graphQlMutation( $mutation, [], '', @@ -218,7 +214,6 @@ private function getAdminHeaderAuthentication(string $userName, string $password { try { $adminAccessToken = $this->adminTokenService->createAdminAccessToken($userName, $password); - return ['Authorization' => 'Bearer ' . $adminAccessToken]; } catch (\Exception $e) { throw new AuthenticationException( From 797e7f82f84deb09c5e4d519861e52d556f48c66 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Mon, 12 Oct 2020 17:12:32 -0500 Subject: [PATCH 051/490] MC-37484: Cart query error when trying to switch store view --- .../Model/Cart/GetCartForUser.php | 39 ++++++++--- .../Model/Resolver/CartItemPrices.php | 2 +- .../Model/Resolver/RemoveItemFromCart.php | 23 +++++- .../GraphQl/Quote/Guest/GetCartTest.php | 70 ++++++++++++++++++- 4 files changed, 117 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php index 1eac282a1e482..f5e273db0cd6a 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php @@ -87,17 +87,7 @@ public function execute(string $cartHash, ?int $customerId, int $storeId): Quote throw new GraphQlNoSuchEntityException(__('The cart isn\'t active.')); } - if ((int)$cart->getStoreId() !== $storeId) { - $cartStore = $this->storeRepository->getById($cart->getStoreId()); - $newStore = $this->storeRepository->getById($storeId); - if ($cartStore->getWebsite() !== $newStore->getWebsite()) { - throw new GraphQlInputException( - __('Can\'t assign cart to store in different website.') - ); - } - $cart->setStoreId($storeId); - $this->cartRepository->save($cart); - } + $this->updateCartCurrency($cart, $storeId); $cartCustomerId = (int)$cart->getCustomerId(); @@ -116,4 +106,31 @@ public function execute(string $cartHash, ?int $customerId, int $storeId): Quote } return $cart; } + + /** + * Sets cart currency based on specified store. + * + * @param Quote $cart + * @param int $storeId + * @throws GraphQlInputException + * @throws NoSuchEntityException + */ + private function updateCartCurrency(Quote $cart, int $storeId) + { + $cartStore = $this->storeRepository->getById($cart->getStoreId()); + if ((int)$cart->getStoreId() !== $storeId) { + $newStore = $this->storeRepository->getById($storeId); + if ($cartStore->getWebsite() !== $newStore->getWebsite()) { + throw new GraphQlInputException( + __('Can\'t assign cart to store in different website.') + ); + } + $cart->setStoreId($storeId); + $cart->setStoreCurrencyCode($newStore->getCurrentCurrency()); + $cart->setQuoteCurrencyCode($newStore->getCurrentCurrency()); + } else { + $cart->setQuoteCurrencyCode($cartStore->getCurrentCurrency()); + } + $this->cartRepository->save($cart); + } } diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index f0d97780845e8..d4ced5b8b97b0 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -60,7 +60,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value return [ 'price' => [ 'currency' => $currencyCode, - 'value' => $cartItem->getPrice(), + 'value' => $cartItem->getCalculationPrice(), ], 'row_total' => [ 'currency' => $currencyCode, diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php index c2045d4a0e8d5..b4bf91861319f 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php @@ -7,6 +7,7 @@ namespace Magento\QuoteGraphQl\Model\Resolver; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; @@ -15,6 +16,7 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Quote\Api\CartItemRepositoryInterface; +use Magento\Quote\Model\MaskedQuoteIdToQuoteId; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; /** @@ -32,16 +34,24 @@ class RemoveItemFromCart implements ResolverInterface */ private $cartItemRepository; + /** + * @var MaskedQuoteIdToQuoteId + */ + private $maskedQuoteIdToQuoteId; + /** * @param GetCartForUser $getCartForUser * @param CartItemRepositoryInterface $cartItemRepository + * @param MaskedQuoteIdToQuoteId $maskedQuoteIdToQuoteId */ public function __construct( GetCartForUser $getCartForUser, - CartItemRepositoryInterface $cartItemRepository + CartItemRepositoryInterface $cartItemRepository, + MaskedQuoteIdToQuoteId $maskedQuoteIdToQuoteId = null ) { $this->getCartForUser = $getCartForUser; $this->cartItemRepository = $cartItemRepository; + $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId ?: ObjectManager::getInstance()->get(MaskedQuoteIdToQuoteId::class); } /** @@ -53,6 +63,13 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new GraphQlInputException(__('Required parameter "cart_id" is missing.')); } $maskedCartId = $args['input']['cart_id']; + try { + $cartId = $this->maskedQuoteIdToQuoteId->execute($maskedCartId); + } catch (NoSuchEntityException $exception) { + throw new GraphQlNoSuchEntityException( + __('Could not find a cart with ID "%masked_cart_id"', ['masked_cart_id' => $maskedCartId]) + ); + } if (empty($args['input']['cart_item_id'])) { throw new GraphQlInputException(__('Required parameter "cart_item_id" is missing.')); @@ -60,16 +77,16 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $itemId = $args['input']['cart_item_id']; $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); - $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); try { - $this->cartItemRepository->deleteById((int)$cart->getId(), $itemId); + $this->cartItemRepository->deleteById($cartId, $itemId); } catch (NoSuchEntityException $e) { throw new GraphQlNoSuchEntityException(__('The cart doesn\'t contain the item')); } catch (LocalizedException $e) { throw new GraphQlInputException(__($e->getMessage()), $e); } + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ 'model' => $cart, diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php index 517465fedc417..b2c6902f5aa97 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php @@ -8,7 +8,12 @@ namespace Magento\GraphQl\Quote\Guest; use Exception; +use Magento\Config\App\Config\Type\System; +use Magento\Config\Model\ResourceModel\Config; +use Magento\Directory\Model\Currency; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\Store; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -91,7 +96,9 @@ public function testGetCartIfCartIdIsEmpty() public function testGetCartIfCartIdIsMissed() { $this->expectException(\Exception::class); - $this->expectExceptionMessage('Field "cart" argument "cart_id" of type "String!" is required but not provided.'); + $this->expectExceptionMessage( + 'Field "cart" argument "cart_id" of type "String!" is required but not provided.' + ); $query = <<<QUERY { @@ -164,11 +171,64 @@ public function testGetCartWithWrongStore() self::assertArrayHasKey('items', $response['cart']); } + /** + * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php + * @magentoApiDataFixture Magento/Store/_files/second_store_with_second_currency.php + */ + public function testGetCartWithDifferentStoreDifferentCurrency() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute( + 'test_order_with_simple_product_without_address' + ); + $query = $this->getQuery($maskedQuoteId); + + $headerMap = ['Store' => 'fixture_second_store']; + $response = $this->graphQlQuery($query, [], '', $headerMap); + + self::assertArrayHasKey('cart', $response); + self::assertArrayHasKey('items', $response['cart']); + self::assertArrayHasKey('prices', $response['cart']['items'][0]); + $price = $response['cart']['items'][0]['prices']['price']; + self::assertEquals(20, $price['value']); + self::assertEquals('EUR', $price['currency']); + + // test alternate currency in header + $objectManager = Bootstrap::getObjectManager(); + $store = $objectManager->create(Store::class); + $store->load('fixture_second_store', 'code'); + if ($storeId = $store->load('fixture_second_store', 'code')->getId()) { + /** @var \Magento\Config\Model\ResourceModel\Config $configResource */ + $configResource = $objectManager->get(Config::class); + $configResource->saveConfig( + Currency::XML_PATH_CURRENCY_ALLOW, + 'USD', + ScopeInterface::SCOPE_STORES, + $storeId + ); + /** + * Configuration cache clean is required to reload currency setting + */ + /** @var System $config */ + $config = $objectManager->get(System::class); + $config->clean(); + } + $headerMap['Content-Currency'] = 'USD'; + $response = $this->graphQlQuery($query, [], '', $headerMap); + + self::assertArrayHasKey('cart', $response); + self::assertArrayHasKey('items', $response['cart']); + self::assertArrayHasKey('prices', $response['cart']['items'][0]); + $price = $response['cart']['items'][0]['prices']['price']; + self::assertEquals(10, $price['value']); + self::assertEquals('USD', $price['currency']); + } + /** * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php * @magentoApiDataFixture Magento/Store/_files/second_website_with_store_group_and_store.php */ - public function testGetCartWithDifferentStoreDifferentWebsite() { + public function testGetCartWithDifferentStoreDifferentWebsite() + { $this->expectException(\Exception::class); $this->expectExceptionMessage('Can\'t assign cart to store in different website.'); @@ -213,6 +273,12 @@ private function getQuery(string $maskedQuoteId): string product { sku } + prices { + price { + value + currency + } + } } } } From 9bf0265d61d705d39470717e49dc56bbb94d2214 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Tue, 13 Oct 2020 16:20:54 -0500 Subject: [PATCH 052/490] MC-37484: Cart query error when trying to switch store view --- .../Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php | 2 +- .../Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index d4ced5b8b97b0..fa5ab69b67e3c 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -60,7 +60,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value return [ 'price' => [ 'currency' => $currencyCode, - 'value' => $cartItem->getCalculationPrice(), + 'value' => $cartItem->getConvertedPrice(), ], 'row_total' => [ 'currency' => $currencyCode, diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php index b4bf91861319f..e73c900bc9a5f 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php @@ -51,7 +51,8 @@ public function __construct( ) { $this->getCartForUser = $getCartForUser; $this->cartItemRepository = $cartItemRepository; - $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId ?: ObjectManager::getInstance()->get(MaskedQuoteIdToQuoteId::class); + $this->maskedQuoteIdToQuoteId = + $maskedQuoteIdToQuoteId ?: ObjectManager::getInstance()->get(MaskedQuoteIdToQuoteId::class); } /** From 79eea2b8b750962fe2d7e903e9735ab2ff8fc5a3 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 14 Oct 2020 19:22:28 +0300 Subject: [PATCH 053/490] Extract list id to list_id_mask table --- .../Magento/Catalog/Model/CompareList.php | 2 +- app/code/Magento/Catalog/Model/ListIdMask.php | 59 ++++++++++++++++ .../Model/MaskedListIdToCompareListId.php | 53 +++++++++++++++ .../{ => Product/Compare}/CompareList.php | 8 ++- .../ResourceModel/Product/Compare/Item.php | 56 ---------------- .../Product/Compare/Item/Collection.php | 20 ++++++ .../Product/Compare/ListIdMask.php | 26 +++++++ app/code/Magento/Catalog/etc/db_schema.xml | 35 ++++++---- .../Catalog/etc/db_schema_whitelist.json | 20 ++++-- ...reListService.php => AddToCompareList.php} | 13 ++-- .../Model/Service/ComparableItemsService.php | 2 +- .../Model/Service/CreateCompareList.php | 67 +++++++++++++++++++ ...pareListService.php => GetCompareList.php} | 0 13 files changed, 278 insertions(+), 83 deletions(-) create mode 100644 app/code/Magento/Catalog/Model/ListIdMask.php create mode 100644 app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php rename app/code/Magento/Catalog/Model/ResourceModel/{ => Product/Compare}/CompareList.php (66%) create mode 100644 app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php rename app/code/Magento/CompareListGraphQl/Model/Service/{AddToCompareListService.php => AddToCompareList.php} (87%) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php rename app/code/Magento/CompareListGraphQl/Model/Service/{CompareListService.php => GetCompareList.php} (100%) diff --git a/app/code/Magento/Catalog/Model/CompareList.php b/app/code/Magento/Catalog/Model/CompareList.php index 363266d0ce233..5be30d40aacce 100644 --- a/app/code/Magento/Catalog/Model/CompareList.php +++ b/app/code/Magento/Catalog/Model/CompareList.php @@ -19,6 +19,6 @@ class CompareList extends AbstractModel */ protected function _construct() { - $this->_init(\Magento\Catalog\Model\ResourceModel\CompareList::class); + $this->_init(ResourceModel\Product\Compare\CompareList::class); } } diff --git a/app/code/Magento/Catalog/Model/ListIdMask.php b/app/code/Magento/Catalog/Model/ListIdMask.php new file mode 100644 index 0000000000000..160dc703ca876 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ListIdMask.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model; + +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Math\Random; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; + +/** + * ListIdMask model + * + * @method string getMaskedId() + * @method ListIdMask setMaskedId() + */ +class ListIdMask extends AbstractModel +{ + /** + * @var Random + */ + protected $randomDataGenerator; + + /** + * @param Context $context + * @param Registry $registry + * @param Random $randomDataGenerator + * @param AbstractResource $resource + * @param AbstractDb $resourceCollection + * @param array $data + */ + public function __construct( + Context $context, + Registry $registry, + Random $randomDataGenerator, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] + ) { + $this->randomDataGenerator = $randomDataGenerator; + parent::__construct($context, $registry, $resource, $resourceCollection, $data); + } + + /** + * Initialize resource + * + * @return void + */ + protected function _construct() + { + $this->_init(ResourceModel\Product\Compare\ListIdMask::class); + } +} diff --git a/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php new file mode 100644 index 0000000000000..0256b33057b12 --- /dev/null +++ b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model; + +use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskMaskResource; + +/** + * MaskedListId to ListId resolver + */ +class MaskedListIdToCompareListId +{ + /** + * @var ListIdMaskFactory + */ + private $listIdMaskFactory; + + /** + * @var ListIdMaskMaskResource + */ + private $listIdMaskResource; + + /** + * @param ListIdMaskFactory $listIdMaskFactory + * @param ListIdMaskMaskResource $listIdMaskResource + */ + public function __construct( + ListIdMaskFactory $listIdMaskFactory, + ListIdMaskMaskResource $listIdMaskResource + ) { + $this->listIdMaskFactory = $listIdMaskFactory; + $this->listIdMaskResource = $listIdMaskResource; + } + + /** + * Get maskedId by listId + * + * @param string $maskedListId + * + * @return int + */ + public function execute(string $maskedListId): int + { + $listIdMask = $this->listIdMaskFactory->create(); + $this->listIdMaskResource->load($listIdMask, $maskedListId, 'masked_id'); + + return (int)$listIdMask->getListId(); + } +} diff --git a/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/CompareList.php similarity index 66% rename from app/code/Magento/Catalog/Model/ResourceModel/CompareList.php rename to app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/CompareList.php index aca0213832c8f..4185df079d55d 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/CompareList.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/CompareList.php @@ -6,11 +6,13 @@ declare(strict_types=1); -namespace Magento\Catalog\Model\ResourceModel; +namespace Magento\Catalog\Model\ResourceModel\Product\Compare; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; - +/** + * Compare List resource class + */ class CompareList extends AbstractDb { /** @@ -18,6 +20,6 @@ class CompareList extends AbstractDb */ protected function _construct() { - $this->_init('catalog_compare_list', 'id'); + $this->_init('catalog_compare_list', 'list_id'); } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php index e6ef21e2c8448..7eb0552e355fc 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php @@ -5,10 +5,6 @@ */ namespace Magento\Catalog\Model\ResourceModel\Product\Compare; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; -use Magento\Framework\Model\ResourceModel\Db\Context; - /** * Catalog compare item resource model * @@ -16,16 +12,6 @@ */ class Item extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { - /** - * @var CompareListFactory - */ - private $compareListFactory; - - /** - * @var CompareListResource - */ - private $compareListResource; - /** * Initialize connection * @@ -36,23 +22,6 @@ protected function _construct() $this->_init('catalog_compare_item', 'catalog_compare_item_id'); } - /** - * @param CompareListFactory $compareListFactory - * @param CompareListResource $compareListResource - * @param Context $context - * @param null $connectionName - */ - public function __construct( - CompareListFactory $compareListFactory, - CompareListResource $compareListResource, - Context $context, - $connectionName = null - ) { - $this->compareListFactory = $compareListFactory; - $this->compareListResource = $compareListResource; - parent::__construct($context, $connectionName); - } - /** * Load object by product * @@ -244,7 +213,6 @@ public function updateCustomerFromVisitor($object) $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $itemId) ); } - $this->setCustomerFromVisitor($object); } return $this; @@ -274,28 +242,4 @@ public function clearItems($visitorId = null, $customerId = null) $this->getConnection()->delete($this->getMainTable(), $where); return $this; } - - /** - * Set customer from visitor in catalog_compare_list table - * - * @param \Magento\Catalog\Model\Product\Compare\Item $item - * - * @return $this - */ - private function setCustomerFromVisitor($item) - { - $customerId = $item->getCustomerId(); - - if (!$customerId) { - return $this; - } - - $visitorId = $item->getVisitorId(); - $compareListModel = $this->compareListFactory->create(); - $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); - $compareListModel->setCustomerId($customerId); - $compareListModel->save(); - - return $this; - } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index dca3f76af6a04..8e50fb466d426 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -267,6 +267,26 @@ public function _addJoinToSelect() return $this; } + /** + * Get products ids by for compare list + * + * @param int $listId + * + * @return array + */ + public function getProductsByListId(int $listId) + { + $select = $this->getConnection()->select()-> + from( + $this->getTable('catalog_compare_item'), + 'product_id' + )->where( + 'list_id = ?', + $listId + ); + return $this->getConnection()->fetchCol($select); + } + /** * Retrieve comapre products attribute set ids * diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php new file mode 100644 index 0000000000000..54719f656403d --- /dev/null +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\ResourceModel\Product\Compare; + +use Magento\Framework\Model\ResourceModel\Db\AbstractDb; + +/** + * ListIdMask Resource model + */ +class ListIdMask extends AbstractDb +{ + /** + * Main table and field initialization + * + * @return void + */ + protected function _construct() + { + $this->_init('list_id_mask', 'entity_id'); + } +} diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index a3d217127c7eb..146a84e3045bd 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -547,7 +547,7 @@ default="0" comment="Product ID"/> <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false" comment="Store ID"/> - <column xsi:type="varchar" name="list_id" padding="10" unsigned="true" nullable="false" identity="false" + <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" identity="false" comment="List ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="catalog_compare_item_id"/> @@ -578,28 +578,39 @@ </index> </table> <table name="catalog_compare_list" resource="default" engine="innodb" comment="Catalog Compare List with hash Table"> - <column xsi:type="int" name="id" padding="5" unsigned="true" nullable="false" - identity="true" comment="ID"/> - <column xsi:type="varchar" name="list_id" padding="10" unsigned="true" nullable="false" - identity="false" comment="Compare List ID"/> - <column xsi:type="int" name="visitor_id" unsigned="true" nullable="false" identity="false" - default="0" comment="Visitor ID"/> + <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" + identity="true" comment="Compare List ID"/> <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false" comment="Customer ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> - <column name="id"/> + <column name="list_id"/> </constraint> <constraint xsi:type="foreign" referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="catalog_compare_list" column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <index referenceId="CATALOG_COMPARE_LIST_LIST_ID" indexType="btree"> - <column name="list_id"/> - </index> <index referenceId="CATALOG_COMPARE_LIST_VISITOR_ID_CUSTOMER_ID" indexType="btree"> - <column name="visitor_id"/> <column name="customer_id"/> </index> </table> + <table name="list_id_mask" resource="default" engine="innodb" comment="List ID and masked ID mapping"> + <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" + comment="Entity ID"/> + <column xsi:type="int" name="list_id" unsigned="true" nullable="false" identity="false" + comment="List ID"/> + <column xsi:type="varchar" name="masked_id" nullable="true" length="32" comment="Masked ID"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + <column name="list_id"/> + </constraint> + <constraint xsi:type="foreign" referenceId="LIST_ID_MASK_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID" table="list_id_mask" + column="list_id" referenceTable="catalog_compare_list" referenceColumn="list_id" onDelete="CASCADE"/> + <index referenceId="LIST_ID_MASK_LIST_ID" indexType="btree"> + <column name="list_id"/> + </index> + <index referenceId="LIST_ID_MASK_MASKED_ID" indexType="btree"> + <column name="masked_id"/> + </index> + </table> <table name="catalog_product_website" resource="default" engine="innodb" comment="Catalog Product To Website Linkage Table"> <column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false" diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index e4a49a4d81b0b..7ad6e9dda330a 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1127,18 +1127,30 @@ }, "catalog_compare_list": { "column": { - "id": true, "list_id": true, - "visitor_id": true, "customer_id": true }, "index": { - "CATALOG_COMPARE_LIST_LIST_ID": true, - "CATALOG_COMPARE_LIST_VISITOR_ID_CUSTOMER_ID": true + "CATALOG_COMPARE_LIST_CUSTOMER_ID": true }, "constraint": { "PRIMARY": true, "CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID": true } + }, + "list_id_mask": { + "column": { + "entity_id": true, + "list_id": true, + "masked_id": true + }, + "index": { + "LIST_ID_MASK_LIST_ID": true, + "LIST_ID_MASK_MASKED_ID": true + }, + "constraint": { + "PRIMARY": true, + "LIST_ID_MASK_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID": true + } } } \ No newline at end of file diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php similarity index 87% rename from app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php rename to app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index 06945d8acff7b..7aa1bdf36b82d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareListService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -12,11 +12,12 @@ use Magento\Catalog\Model\Product\Compare\ItemFactory; use Magento\Catalog\Model\ProductRepository; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Tests\NamingConvention\true\string; /** * Service add product to compare list */ -class AddToCompareListService +class AddProductsToCompareList { /** * Compare item factory @@ -43,14 +44,14 @@ public function __construct( } /** - * Add to compare list + * Add products to compare list * - * @param int $listId - * @param array $items + * @param string $listId + * @param array $products */ - public function addToCompareList(int $listId, array $items) + public function execute(string $listId, array $products) { - foreach ($items['items'] as $key) { + foreach ($products as $key) { /* @var $item Item */ $item = $this->compareItemFactory->create(); $item->loadByProduct($key); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php index e14678b9ca0e3..14bbc3586e37d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php @@ -10,7 +10,7 @@ use Magento\Catalog\Block\Product\Compare\ListCompare; use Magento\Catalog\Model\CompareList; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; use Magento\CatalogGraphQl\Model\Resolver\Product\Price\Discount; use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool as PriceProviderPool; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php new file mode 100644 index 0000000000000..429f012e7c422 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Service; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\CompareList as CatalogCompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\Product\Compare\Item; +use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; +use Magento\Customer\Model\Visitor; + +class CompareList +{ + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var CompareListResource + */ + private $compareListResource; + + /** + * @var Visitor + */ + private $customerVisitor; + + /** + * @param CompareListFactory $compareListFactory + * @param CompareListResource $compareListResource + * @param Visitor $customerVisitor + */ + public function __construct( + CompareListFactory $compareListFactory, + CompareListResource $compareListResource, + Visitor $customerVisitor + ) { + $this->compareListFactory = $compareListFactory; + $this->compareListResource = $compareListResource; + $this->customerVisitor = $customerVisitor; + } + + public function createCompareList(string $listId, int $customerId) + { + /* @var $compareListModel CatalogCompareList */ + $compareListModel = $this->compareListFactory->create(); + $compareListModel->setListId($listId); + $this->addVisitorToItem($compareListModel, $customerId); + $compareListModel->save(); + } + + private function addVisitorToItem($model,int $customerId) + { + $model->setVisitorId($this->customerVisitor->getId()); + if ($customerId) { + $model->setCustomerId($customerId); + } + + return $this; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php similarity index 100% rename from app/code/Magento/CompareListGraphQl/Model/Service/CompareListService.php rename to app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php From 5f4fd9face05aa1c7767628e32889ad0fb90dcff Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 14 Oct 2020 19:30:12 +0300 Subject: [PATCH 054/490] reverted changes --- .../Model/Product/Compare/CompareList.php | 110 ------------------ .../Model/Product/Compare/ListCompare.php | 10 -- 2 files changed, 120 deletions(-) delete mode 100644 app/code/Magento/Catalog/Model/Product/Compare/CompareList.php diff --git a/app/code/Magento/Catalog/Model/Product/Compare/CompareList.php b/app/code/Magento/Catalog/Model/Product/Compare/CompareList.php deleted file mode 100644 index 5fab205bbdabe..0000000000000 --- a/app/code/Magento/Catalog/Model/Product/Compare/CompareList.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\Catalog\Model\Product\Compare; - -use Magento\Catalog\Model\CompareList as CatalogCompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; - -class CompareList -{ - /** - * @var CompareListFactory - */ - private $compareListFactory; - - /** - * @var CompareListResource - */ - private $compareListResource; - - /** - * @param CompareListFactory $compareListFactory - * @param CompareListResource $compareListResource - */ - public function __construct( - CompareListFactory $compareListFactory, - CompareListResource $compareListResource - ) { - $this->compareListFactory = $compareListFactory; - $this->compareListResource = $compareListResource; - } - - /** - * Get list_id - * - * @param Item $item - * - * @return int - */ - public function getListId(Item $item) - { - if ($customerId = $item->getCustomerId()) { - return $this->getListIdByCustomerId($customerId); - } - - return $this->getListIdByVisitorId($item->getVisitorId()); - } - - /** - * Get list_id for visitor - * - * @param $visitorId - * - * @return int - */ - private function getListIdByVisitorId($visitorId) - { - $compareListModel = $this->compareListFactory->create(); - $this->compareListResource->load($compareListModel, $visitorId, 'visitor_id'); - if ($compareListId = $compareListModel->getId()) { - return (int)$compareListId; - } - - return $this->createCompareList($visitorId, null); - } - - /** - * Get list_id for logged customers - * - * @param $customerId - * - * @return int - */ - private function getListIdByCustomerId($customerId) - { - $compareListModel = $this->compareListFactory->create(); - $this->compareListResource->load($compareListModel, $customerId, 'customer_id'); - - if ($compareListId = $compareListModel->getId()) { - return (int)$compareListId; - } - - return $this->createCompareList(0, $customerId); - } - - /** - * Create new compare list - * - * @param $visitorId - * @param $customerId - * - * @return int - */ - private function createCompareList($visitorId, $customerId) - { - /* @var $compareList CatalogCompareList */ - $compareList = $this->compareListFactory->create(); - $compareList->setVisitorId($visitorId); - $compareList->setCustomerId($customerId); - $compareList->save(); - - return (int)$compareList->getId(); - } -} diff --git a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php index 356c8e701b21e..9ccb86441812c 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/ListCompare.php @@ -60,11 +60,6 @@ class ListCompare extends \Magento\Framework\DataObject */ private $productRepository; - /** - * @var CompareList - */ - private $compareList; - /** * Constructor * @@ -73,7 +68,6 @@ class ListCompare extends \Magento\Framework\DataObject * @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Visitor $customerVisitor - * @param \Magento\Catalog\Model\Product\Compare\CompareList $compareList * @param array $data * @param ProductRepository|null $productRepository */ @@ -83,7 +77,6 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Visitor $customerVisitor, - \Magento\Catalog\Model\Product\Compare\CompareList $compareList, array $data = [], ProductRepository $productRepository = null ) { @@ -92,7 +85,6 @@ public function __construct( $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_customerSession = $customerSession; $this->_customerVisitor = $customerVisitor; - $this->compareList = $compareList; $this->productRepository = $productRepository ?: ObjectManager::getInstance()->create(ProductRepository::class); parent::__construct($data); } @@ -110,11 +102,9 @@ public function addProduct($product) $item = $this->_compareItemFactory->create(); $this->_addVisitorToItem($item); $item->loadByProduct($product); - $listId = $this->compareList->getListId($item); if (!$item->getId() && $this->productExists($product)) { $item->addProductData($product); - $item->setListId($listId); $item->save(); } From 8be68b4098b01aea78d9f55b4cb9f3c03ede720a Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 14 Oct 2020 20:03:02 +0300 Subject: [PATCH 055/490] create compare list --- .../Model/CompareListIdToMaskedListId.php | 52 ++++++++++++++++ .../Model/Service/AddToCompareList.php | 57 ++++++++++-------- .../Model/Service/CreateCompareList.php | 59 +++++++++++-------- .../Model/Service/CustomerService.php | 40 ++++++++++++- .../Model/Service/GetCompareList.php | 23 +++++--- 5 files changed, 174 insertions(+), 57 deletions(-) create mode 100644 app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php diff --git a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php new file mode 100644 index 0000000000000..b915ca2f18d0b --- /dev/null +++ b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model; + +use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskMaskResource; + +/** + * CompareListId to MaskedListId resolver + */ +class CompareListIdToMaskedListId +{ + /** + * @var ListIdMaskFactory + */ + private $listIdMaskFactory; + + /** + * @var ListIdMaskMaskResource + */ + private $listIdMaskResource; + + /** + * @param ListIdMaskFactory $listIdMaskFactory + * @param ListIdMaskMaskResource $listIdMaskResource + */ + public function __construct( + ListIdMaskFactory $listIdMaskFactory, + ListIdMaskMaskResource $listIdMaskResource + ) { + $this->listIdMaskFactory = $listIdMaskFactory; + $this->listIdMaskResource = $listIdMaskResource; + } + + /** + * Get maskedId by listId + * + * @param int $listId + * + * @return string + */ + public function execute(int $listId): string + { + $listIdMask = $this->listIdMaskFactory->create(); + $this->listIdMaskResource->load($listIdMask, $listId, 'list_id'); + return $listIdMask->getMaskedId() ?? ''; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index 7aa1bdf36b82d..daba16b59dfd7 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -7,21 +7,17 @@ namespace Magento\CompareListGraphQl\Model\Service; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Compare\Item; use Magento\Catalog\Model\Product\Compare\ItemFactory; use Magento\Catalog\Model\ProductRepository; +use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Tests\NamingConvention\true\string; /** * Service add product to compare list */ -class AddProductsToCompareList +class AddToCompareList { /** - * Compare item factory - * * @var ItemFactory */ private $compareItemFactory; @@ -31,53 +27,66 @@ class AddProductsToCompareList */ private $productRepository; + /** + * @var Collection + */ + private $itemCollection; + /** * @param ItemFactory $compareItemFactory * @param ProductRepository $productRepository + * @param Collection $collection */ public function __construct( ItemFactory $compareItemFactory, - ProductRepository $productRepository + ProductRepository $productRepository, + Collection $collection ) { $this->compareItemFactory = $compareItemFactory; $this->productRepository = $productRepository; + $this->itemCollection = $collection; } /** * Add products to compare list * - * @param string $listId + * @param int $listId * @param array $products + * @param int $storeId + * + * @return int */ - public function execute(string $listId, array $products) + public function execute(int $listId, array $products, int $storeId): int { - foreach ($products as $key) { - /* @var $item Item */ - $item = $this->compareItemFactory->create(); - $item->loadByProduct($key); - if (!$item->getId() && $this->productExists($key)) { - $item->addProductData($key); - $item->setListId($listId); - $item->save(); + if (count($products)) { + $existedProducts = $this->itemCollection->getProductsByListId($listId); + foreach ($products as $productId) { + if (!array_search($productId, $existedProducts)) { + if ($this->productExists($productId)) { + $item = $this->compareItemFactory->create(); + $item->addProductData($productId); + $item->setStoreId($storeId); + $item->setListId($listId); + $item->save(); + } + } } } + + return (int)$listId; } /** * Check product exists. * - * @param int|Product $product + * @param int $productId * * @return bool */ - private function productExists($product) + private function productExists($productId) { - if ($product instanceof Product && $product->getId()) { - return true; - } - try { - $product = $this->productRepository->getById((int)$product); + $product = $this->productRepository->getById((int)$productId); return !empty($product->getId()); } catch (NoSuchEntityException $e) { return false; diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php index 429f012e7c422..c781651c99d8e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php @@ -7,14 +7,12 @@ namespace Magento\CompareListGraphQl\Model\Service; -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Catalog\Model\CompareList as CatalogCompareList; use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\Product\Compare\Item; -use Magento\Catalog\Model\ResourceModel\CompareList as CompareListResource; -use Magento\Customer\Model\Visitor; +use Magento\Catalog\Model\ListIdMaskFactory; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; +use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskResource; -class CompareList +class CreateCompareList { /** * @var CompareListFactory @@ -27,41 +25,52 @@ class CompareList private $compareListResource; /** - * @var Visitor + * @var ListIdMaskFactory */ - private $customerVisitor; + private $maskedListIdFactory; + + /** + * @var ListIdMaskResource + */ + private $maskedListIdResource; /** * @param CompareListFactory $compareListFactory * @param CompareListResource $compareListResource - * @param Visitor $customerVisitor + * @param ListIdMaskFactory $maskedListIdFactory + * @param ListIdMaskResource $maskedListIdResource */ public function __construct( CompareListFactory $compareListFactory, CompareListResource $compareListResource, - Visitor $customerVisitor + ListIdMaskFactory $maskedListIdFactory, + ListIdMaskResource $maskedListIdResource ) { $this->compareListFactory = $compareListFactory; $this->compareListResource = $compareListResource; - $this->customerVisitor = $customerVisitor; + $this->maskedListIdFactory = $maskedListIdFactory; + $this->maskedListIdResource = $maskedListIdResource; } - public function createCompareList(string $listId, int $customerId) + /** + * Created new compare list + * + * @param string $maskedId + * @param int $customerId + * + * @return int + */ + public function execute(string $maskedId, ?int $customerId = null): int { - /* @var $compareListModel CatalogCompareList */ - $compareListModel = $this->compareListFactory->create(); - $compareListModel->setListId($listId); - $this->addVisitorToItem($compareListModel, $customerId); - $compareListModel->save(); - } + $compareList = $this->compareListFactory->create(); + $compareList->setCustomerId($customerId); + $this->compareListResource->save($compareList); - private function addVisitorToItem($model,int $customerId) - { - $model->setVisitorId($this->customerVisitor->getId()); - if ($customerId) { - $model->setCustomerId($customerId); - } + $maskedListId = $this->maskedListIdFactory->create(); + $maskedListId->setListId($compareList->getListId()); + $maskedListId->setMaskedId($maskedId); + $this->maskedListIdResource->save($maskedListId); - return $this; + return (int)$compareList->getListId(); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php index 0eb05c3720eec..3d96013b96cf9 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php @@ -7,6 +7,9 @@ namespace Magento\CompareListGraphQl\Model\Service; +use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; @@ -37,19 +40,54 @@ class CustomerService */ private $accountManagement; + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @var CompareListFactory + */ + private $compareListFactory; + /** * @param AuthenticationInterface $authentication * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $accountManagement + * @param ResourceCompareList $resourceCompareList + * @param CompareListFactory $compareListFactory */ public function __construct( AuthenticationInterface $authentication, CustomerRepositoryInterface $customerRepository, - AccountManagementInterface $accountManagement + AccountManagementInterface $accountManagement, + ResourceCompareList $resourceCompareList, + CompareListFactory $compareListFactory ) { $this->authentication = $authentication; $this->customerRepository = $customerRepository; $this->accountManagement = $accountManagement; + $this->resourceCompareList = $resourceCompareList; + $this->compareListFactory = $compareListFactory; + } + + /** + * Get listId by Customer ID + * + * @param $customerId + * + * @return int|null + */ + public function getListIdByCustomerId($customerId) + { + if ($customerId) { + /** @var CompareList $compareListModel */ + $compareListModel = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareListModel, $customerId, 'customer_id'); + return (int)$compareListModel->getListId(); + } + + return null; } /** diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index a11b93a8fed39..05b5c85d8bce4 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -7,13 +7,13 @@ namespace Magento\CompareListGraphQl\Model\Service; +use Magento\Catalog\Model\CompareListIdToMaskedListId; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; -use Magento\Store\Api\Data\StoreInterface; /** * Get compare list */ -class CompareListService +class GetCompareList { /** * @var ComparableItemsService @@ -25,31 +25,40 @@ class CompareListService */ private $comparableAttributesService; + /** + * @var CompareListIdToMaskedListId + */ + private $compareListIdToMaskedListId; + /** * @param ComparableItemsService $comparableItemsService * @param ComparableAttributesService $comparableAttributesService + * @param CompareListIdToMaskedListId $compareListIdToMaskedListId */ public function __construct( ComparableItemsService $comparableItemsService, - ComparableAttributesService $comparableAttributesService + ComparableAttributesService $comparableAttributesService, + CompareListIdToMaskedListId $compareListIdToMaskedListId ) { $this->comparableItemsService = $comparableItemsService; $this->comparableAttributesService = $comparableAttributesService; + $this->compareListIdToMaskedListId = $compareListIdToMaskedListId; } /** - * Get compare list + * Get compare list information * * @param int $listId * @param ContextInterface $context - * @param StoreInterface $store * * @return array */ - public function getCompareList(int $listId, ContextInterface $context, StoreInterface $store) + public function execute(int $listId, ContextInterface $context) { + $store = $context->getExtensionAttributes()->getStore(); + $maskedListId = $this->compareListIdToMaskedListId->execute($listId); return [ - 'list_id' => $listId, + 'uid' => $maskedListId, 'items' => $this->comparableItemsService->getComparableItems($listId, $context, $store), 'attributes' => $this->comparableAttributesService->getComparableAttributes($listId, $context) ]; From c9815644c9633d5e08660d62525dda6f513d3a7e Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 14 Oct 2020 20:04:39 +0300 Subject: [PATCH 056/490] added resolver --- .../Model/Resolver/CreateCompareList.php | 75 ++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index 870b1a21f0c9d..f2453adc4bfd5 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -7,17 +7,68 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\Catalog\Model\Product\Compare\ItemFactory; +use Magento\CompareListGraphQl\Model\Service\AddToCompareList; +use Magento\CompareListGraphQl\Model\Service\CreateCompareList as CreateCompareListService; +use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\Math\Random; /** * Class for creating compare list */ class CreateCompareList implements ResolverInterface { + private $compareItemFactory; + + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var Random + */ + private $mathRandom; + + private $customerService; + + private $addProductToCompareList; + + private $getCompareList; + + private $maskedListIdToCompareListId; + + private $createCompareList; + + public function __construct( + ItemFactory $compareItemFactory, + CompareListFactory $compareListFactory, + Random $mathRandom, + CustomerService $customerService, + AddToCompareList $addProductToCompareList, + GetCompareList $getCompareList, + MaskedListIdToCompareListId $maskedListIdToCompareListId, + CreateCompareListService $createCompareList + ) { + $this->compareItemFactory = $compareItemFactory; + $this->compareListFactory = $compareListFactory; + $this->mathRandom = $mathRandom; + $this->customerService = $customerService; + $this->addProductToCompareList = $addProductToCompareList; + $this->getCompareList = $getCompareList; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + $this->createCompareList = $createCompareList; + } + /** * @param Field $field * @param ContextInterface $context @@ -34,6 +85,26 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + $customerId = $context->getUserId(); + $products = !empty($args['input']['products']) ? $args['input']['products'] : []; + $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); + $generatedListId = $this->mathRandom->getUniqueHash(); + + if ((0 === $customerId || null === $customerId)) { + $listId = $this->createCompareList->execute($generatedListId); + $this->addProductToCompareList->execute($listId, $products, $storeId); + } + + if ($customerId) { + $listId = $this->customerService->getListIdByCustomerId($customerId); + if ($listId) { + $this->addProductToCompareList->execute($listId, $products, $storeId); + } else { + $listId = $this->createCompareList->execute($generatedListId, $customerId); + $this->addProductToCompareList->execute($listId, $products, $storeId); + } + } + + return $this->getCompareList->execute($listId, $context); } -} \ No newline at end of file +} From b03318acd8892f0e51f1561e1ef163112dd461c8 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 14 Oct 2020 20:38:16 +0300 Subject: [PATCH 057/490] rename classes --- .../Model/Resolver/CreateCompareList.php | 38 +++++++++---------- ...s.php => GetComparableItemsCollection.php} | 4 +- ...ervice.php => GetComparableAttributes.php} | 8 ++-- ...temsService.php => GetComparableItems.php} | 8 ++-- .../Model/Service/GetCompareList.php | 14 +++---- 5 files changed, 36 insertions(+), 36 deletions(-) rename app/code/Magento/CompareListGraphQl/Model/Service/Collection/{ComparableItems.php => GetComparableItemsCollection.php} (95%) rename app/code/Magento/CompareListGraphQl/Model/Service/{ComparableAttributesService.php => GetComparableAttributes.php} (76%) rename app/code/Magento/CompareListGraphQl/Model/Service/{ComparableItemsService.php => GetComparableItems.php} (94%) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index f2453adc4bfd5..643098f535e75 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -7,10 +7,6 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\CompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\MaskedListIdToCompareListId; -use Magento\Catalog\Model\Product\Compare\ItemFactory; use Magento\CompareListGraphQl\Model\Service\AddToCompareList; use Magento\CompareListGraphQl\Model\Service\CreateCompareList as CreateCompareListService; use Magento\CompareListGraphQl\Model\Service\CustomerService; @@ -27,45 +23,49 @@ */ class CreateCompareList implements ResolverInterface { - private $compareItemFactory; - - /** - * @var CompareListFactory - */ - private $compareListFactory; - /** * @var Random */ private $mathRandom; + /** + * @var CustomerService + */ private $customerService; + /** + * @var AddToCompareList + */ private $addProductToCompareList; + /** + * @var GetCompareList + */ private $getCompareList; - private $maskedListIdToCompareListId; - + /** + * @var CreateCompareListService + */ private $createCompareList; + /** + * @param Random $mathRandom + * @param CustomerService $customerService + * @param AddToCompareList $addProductToCompareList + * @param GetCompareList $getCompareList + * @param CreateCompareListService $createCompareList + */ public function __construct( - ItemFactory $compareItemFactory, - CompareListFactory $compareListFactory, Random $mathRandom, CustomerService $customerService, AddToCompareList $addProductToCompareList, GetCompareList $getCompareList, - MaskedListIdToCompareListId $maskedListIdToCompareListId, CreateCompareListService $createCompareList ) { - $this->compareItemFactory = $compareItemFactory; - $this->compareListFactory = $compareListFactory; $this->mathRandom = $mathRandom; $this->customerService = $customerService; $this->addProductToCompareList = $addProductToCompareList; $this->getCompareList = $getCompareList; - $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; $this->createCompareList = $createCompareList; } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php similarity index 95% rename from app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php rename to app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php index 0e6c41f1c2aab..ec58aada4c9cd 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/Collection/ComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php @@ -17,7 +17,7 @@ /** * Get collection with comparable items */ -class ComparableItems +class GetComparableItemsCollection { /** * @var Collection @@ -70,7 +70,7 @@ public function __construct( * * @return Collection */ - public function getCollectionComparableItems(int $listId, ContextInterface $context): Collection + public function execute(int $listId, ContextInterface $context): Collection { $this->compareProduct->setAllowUsedFlat(false); /** @var Collection $comparableItems */ diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php similarity index 76% rename from app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php rename to app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php index 152c09f2bbd1f..9e4dcf5fdad1a 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableAttributesService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php @@ -7,13 +7,13 @@ namespace Magento\CompareListGraphQl\Model\Service; -use Magento\CompareListGraphQl\Model\Service\Collection\ComparableItems as ComparableItemsCollection; +use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** * Get comparable attributes */ -class ComparableAttributesService +class GetComparableAttributes { /** * @var ComparableItemsCollection @@ -37,10 +37,10 @@ public function __construct( * * @return array */ - public function getComparableAttributes(int $listId, ContextInterface $context): array + public function execute(int $listId, ContextInterface $context): array { $attributes = []; - $itemsCollection = $this->comparableItemsCollection->getCollectionComparableItems($listId, $context); + $itemsCollection = $this->comparableItemsCollection->execute($listId, $context); foreach ($itemsCollection->getComparableAttributes() as $item) { $attributes[] = [ 'code' => $item->getAttributeCode(), diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php similarity index 94% rename from app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php rename to app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 14bbc3586e37d..e2c2948cc71c4 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/ComparableItemsService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -16,13 +16,13 @@ use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\Pricing\SaleableInterface; use Magento\Store\Api\Data\StoreInterface; -use Magento\CompareListGraphQl\Model\Service\Collection\ComparableItems as ComparableItemsCollection; +use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; /** * Get comparable items */ -class ComparableItemsService +class GetComparableItems { /** * @var Discount @@ -90,7 +90,7 @@ public function __construct( public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) { $items = []; - foreach ($this->comparableItemsCollection->getCollectionComparableItems($listId, $context) as $item) { + foreach ($this->comparableItemsCollection->execute($listId, $context) as $item) { /** @var Product $item */ $items[] = [ 'productId' => $item->getId(), @@ -127,7 +127,7 @@ public function getComparableItems(int $listId, ContextInterface $context, Store private function getProductComparableAttributes(int $listId, Product $product, ContextInterface $context): array { $attributes = []; - $itemsCollection = $this->comparableItemsCollection->getCollectionComparableItems($listId, $context); + $itemsCollection = $this->comparableItemsCollection->execute($listId, $context); foreach ($itemsCollection->getComparableAttributes() as $item) { $attributes[] = [ 'code' => $item->getAttributeCode(), diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index 05b5c85d8bce4..c90dc1d9faf4d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -16,12 +16,12 @@ class GetCompareList { /** - * @var ComparableItemsService + * @var GetComparableItems */ private $comparableItemsService; /** - * @var ComparableAttributesService + * @var GetComparableAttributes */ private $comparableAttributesService; @@ -31,13 +31,13 @@ class GetCompareList private $compareListIdToMaskedListId; /** - * @param ComparableItemsService $comparableItemsService - * @param ComparableAttributesService $comparableAttributesService + * @param GetComparableItems $comparableItemsService + * @param GetComparableAttributes $comparableAttributesService * @param CompareListIdToMaskedListId $compareListIdToMaskedListId */ public function __construct( - ComparableItemsService $comparableItemsService, - ComparableAttributesService $comparableAttributesService, + GetComparableItems $comparableItemsService, + GetComparableAttributes $comparableAttributesService, CompareListIdToMaskedListId $compareListIdToMaskedListId ) { $this->comparableItemsService = $comparableItemsService; @@ -60,7 +60,7 @@ public function execute(int $listId, ContextInterface $context) return [ 'uid' => $maskedListId, 'items' => $this->comparableItemsService->getComparableItems($listId, $context, $store), - 'attributes' => $this->comparableAttributesService->getComparableAttributes($listId, $context) + 'attributes' => $this->comparableAttributesService->execute($listId, $context) ]; } } From 5e69a5145d77f76948e019371fc99f05dbcfe215 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 15 Oct 2020 22:46:55 +0300 Subject: [PATCH 058/490] Refactoring resolvers --- .../Resolver/AddProductsToCompareList.php | 83 ++++++++----------- .../Resolver/AssignCompareListToCustomer.php | 52 ++++-------- .../Model/Resolver/CompareList.php | 50 +++++------ .../Model/Resolver/CreateCompareList.php | 4 + .../Model/Resolver/CustomerCompareList.php | 60 ++++---------- .../Model/Resolver/DeleteCompareList.php | 1 + .../Model/Service/CustomerService.php | 47 ++++++++--- 7 files changed, 125 insertions(+), 172 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index 177652314c18b..c4f6521c42e10 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -7,19 +7,15 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\CompareList as ModelCompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\Product\Compare\CompareList; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\CompareListGraphQl\Model\Service\AddToCompareListService; +use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\CompareListGraphQl\Model\Service\AddToCompareList; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Api\Data\StoreInterface; -use Magento\CompareListGraphQl\Model\Service\CompareListService; /** * Class add products to compare list @@ -27,53 +23,37 @@ class AddProductsToCompareList implements ResolverInterface { /** - * @var CompareListFactory + * @var AddToCompareList */ - private $compareListFactory; + private $addProductToCompareList; /** - * @var ResourceCompareList + * @var GetCompareList */ - private $resourceCompareList; + private $getCompareList; /** - * @var CompareList + * @var MaskedListIdToCompareListId */ - private $compareList; + private $maskedListIdToCompareListId; /** - * @var AddToCompareListService - */ - private $addToCompareListService; - - /** - * @var CompareListService - */ - private $compareListService; - - /** - * @param CompareListFactory $compareListFactory - * @param ResourceCompareList $resourceCompareList - * @param CompareList $compareList - * @param AddToCompareListService $addToCompareListService - * @param CompareListService $compareListService + * @param AddToCompareList $addProductToCompareList + * @param GetCompareList $getCompareList + * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( - CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList, - CompareList $compareList, - AddToCompareListService $addToCompareListService, - CompareListService $compareListService + AddToCompareList $addProductToCompareList, + GetCompareList $getCompareList, + MaskedListIdToCompareListId $maskedListIdToCompareListId ) { - $this->compareListFactory = $compareListFactory; - $this->resourceCompareList = $resourceCompareList; - $this->compareList = $compareList; - $this->addToCompareListService = $addToCompareListService; - $this->compareListService = $compareListService; + $this->addProductToCompareList = $addProductToCompareList; + $this->getCompareList = $getCompareList; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; } /** - * Add items to compare list + * Add products to compare list * * @param Field $field * @param ContextInterface $context @@ -84,6 +64,7 @@ public function __construct( * @return Value|mixed|void * * @throws GraphQlInputException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( Field $field, @@ -92,19 +73,23 @@ public function resolve( array $value = null, array $args = null ) { - $listId = (int)$args['id']; - /** @var StoreInterface $store */ - $store = $context->getExtensionAttributes()->getStore(); - /** @var $compareListModel ModelCompareList*/ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $args['id']); + $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); + if (!isset($args['input']['uid'])) { + throw new GraphQlInputException(__('"uid" value must be specified.')); + } + + if (!isset($args['input']['products'])) { + throw new GraphQlInputException(__('"products" value must be specified.')); + } + + $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid']); - if (!$compareListModel->getId()) { - throw new GraphQlInputException(__('Can\'t load compare list.')); + if (!$listId) { + throw new GraphQlInputException(__('"uid" value does not exist')); } - $this->addToCompareListService->addToCompareList($listId, $args); + $this->addProductToCompareList->execute($listId, $args['input']['products'], $storeId); - return $this->compareListService->getCompareList($listId, $context, $store); + return $this->getCompareList->execute($listId, $context); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index ed4eb724ea14c..c5325673e69f8 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -7,9 +7,7 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\CompareList as ModelCompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; +use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\CompareListGraphQl\Model\Service\CustomerService; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -24,33 +22,25 @@ class AssignCompareListToCustomer implements ResolverInterface { /** - * @var CompareListFactory + * @var CustomerService */ - private $compareListFactory; + private $customerService; /** - * @var ResourceCompareList + * @var MaskedListIdToCompareListId */ - private $resourceCompareList; + private $maskedListIdToCompareListId; /** - * @var CustomerService - */ - private $customerService; - - /** - * @param CompareListFactory $compareListFactory - * @param ResourceCompareList $resourceCompareList * @param CustomerService $customerService + * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( - CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList, - CustomerService $customerService + CustomerService $customerService, + MaskedListIdToCompareListId $maskedListIdToCompareListId ) { - $this->compareListFactory = $compareListFactory; - $this->resourceCompareList = $resourceCompareList; $this->customerService = $customerService; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; } /** @@ -65,6 +55,7 @@ public function __construct( * @return Value|mixed|void * * @throws GraphQlInputException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( Field $field, @@ -73,27 +64,16 @@ public function resolve( array $value = null, array $args = null ) { - if (!isset($args['customerId'])) { - throw new GraphQlInputException(__('"customerId" value must be specified')); - } - - if (!isset($args['listId'])) { - throw new GraphQlInputException(__('"listId" value must be specified')); + if (!isset($args['uid'])) { + throw new GraphQlInputException(__('"uid" value must be specified')); } - $customer = $this->customerService->validateCustomer($args['customerId']); - - /** @var $compareListModel ModelCompareList*/ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $args['listId']); - - if (!$compareListModel->getId()) { - return false; + if (!$context->getUserId()) { + throw new GraphQlInputException(__('Customer must be logged')); } - $compareListModel->setCustomerId($customer->getId()); - $this->resourceCompareList->save($compareListModel); + $listId = $this->maskedListIdToCompareListId->execute($args['uid']); - return true; + return $this->customerService->setCustomerToCompareList($listId, $context->getUserId()); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index 4edb20ab3d2b9..3bb800dda5e7d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -7,16 +7,14 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\CompareListGraphQl\Model\Service\CompareListService; +use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Catalog\Model\CompareList as ModelCompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Store\Api\Data\StoreInterface; /** * Get compare list @@ -24,33 +22,25 @@ class CompareList implements ResolverInterface { /** - * @var CompareListFactory + * @var GetCompareList */ - private $compareListFactory; + private $getCompareList; /** - * @var ResourceCompareList + * @var MaskedListIdToCompareListId */ - private $resourceCompareList; + private $maskedListIdToCompareListId; /** - * @var CompareListService - */ - private $compareListService; - - /** - * @param CompareListFactory $compareListFactory - * @param ResourceCompareList $resourceCompareList - * @param CompareListService $compareListService + * @param GetCompareList $getCompareList + * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( - CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList, - CompareListService $compareListService + GetCompareList $getCompareList, + MaskedListIdToCompareListId $maskedListIdToCompareListId ) { - $this->compareListFactory = $compareListFactory; - $this->resourceCompareList = $resourceCompareList; - $this->compareListService = $compareListService; + $this->getCompareList = $getCompareList; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; } /** @@ -66,6 +56,7 @@ public function __construct( * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * + * @throws GraphQlInputException */ public function resolve( Field $field, @@ -74,17 +65,16 @@ public function resolve( array $value = null, array $args = null ) { - /** @var StoreInterface $store */ - $store = $context->getExtensionAttributes()->getStore(); - /** @var $compareListModel ModelCompareList*/ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $args['id']); - $listId = (int)$compareListModel->getId(); + if (!isset($args['uid'])) { + throw new GraphQlInputException(__('"uid" value must be specified')); + } + + $listId = $this->maskedListIdToCompareListId->execute($args['uid']); if (!$listId) { return null; } - return $this->compareListService->getCompareList($listId, $context, $store); + return $this->getCompareList->execute($listId, $context); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index 643098f535e75..cb7a800cc69cc 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -70,6 +70,8 @@ public function __construct( } /** + * Create compare list + * * @param Field $field * @param ContextInterface $context * @param ResolveInfo $info @@ -77,6 +79,8 @@ public function __construct( * @param array|null $args * * @return Value|mixed|void + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( Field $field, diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php index cd115ecb53ea4..c81a1775e82e7 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php @@ -7,16 +7,13 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\CompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\CompareListGraphQl\Model\Service\CompareListService; +use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Api\Data\StoreInterface; /** * Get customer compare list @@ -24,33 +21,25 @@ class CustomerCompareList implements ResolverInterface { /** - * @var ResourceCompareList + * @var GetCompareList */ - private $resourceCompareList; + private $getCompareList; /** - * @var CompareListFactory + * @var CustomerService */ - private $compareListFactory; + private $customerService; /** - * @var CompareListService - */ - private $compareListService; - - /** - * @param ResourceCompareList $resourceCompareList - * @param CompareListFactory $compareListFactory - * @param CompareListService $compareListService + * @param GetCompareList $getCompareList + * @param CustomerService $customerService */ public function __construct( - ResourceCompareList $resourceCompareList, - CompareListFactory $compareListFactory, - CompareListService $compareListService + GetCompareList $getCompareList, + CustomerService $customerService ) { - $this->resourceCompareList = $resourceCompareList; - $this->compareListFactory = $compareListFactory; - $this->compareListService = $compareListService; + $this->getCompareList = $getCompareList; + $this->customerService = $customerService; } /** @@ -73,33 +62,12 @@ public function resolve( array $value = null, array $args = null ) { - /** @var StoreInterface $store */ - $store = $context->getExtensionAttributes()->getStore(); - $listId = (int)$this->getListIdByCustomerId($context->getUserId()); + $listId = $this->customerService->getListIdByCustomerId($context->getUserId()); if (!$listId) { return null; } - return $this->compareListService->getCompareList($listId, $context, $store); - } - - /** - * Get listId by Customer ID - * - * @param $customerId - * - * @return int|null - */ - private function getListIdByCustomerId($customerId) - { - if ($customerId) { - /** @var CompareList $compareListModel */ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $customerId, 'customer_id'); - return (int)$compareListModel->getId(); - } - - return null; + return $this->getCompareList->execute($listId, $context); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index a0f313837ceef..9bdc7fca6bebd 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -26,6 +26,7 @@ class DeleteCompareList implements ResolverInterface * @param array|null $args * * @return Value|mixed|void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( Field $field, diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php index 3d96013b96cf9..729a86177e651 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php @@ -12,7 +12,6 @@ use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\AuthenticationInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; @@ -74,34 +73,60 @@ public function __construct( /** * Get listId by Customer ID * - * @param $customerId + * @param int $customerId * * @return int|null */ - public function getListIdByCustomerId($customerId) + public function getListIdByCustomerId(int $customerId) { if ($customerId) { - /** @var CompareList $compareListModel */ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $customerId, 'customer_id'); - return (int)$compareListModel->getListId(); + /** @var CompareList $compareList */ + $compareList = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareList, $customerId, 'customer_id'); + return (int)$compareList->getListId(); } return null; } + /** + * Set customer to compare list + * + * @param int $listId + * @param int $customerId + * + * @return bool + * + * @throws GraphQlAuthenticationException + * @throws GraphQlInputException + * @throws GraphQlNoSuchEntityException + */ + public function setCustomerToCompareList(int $listId, int $customerId): bool + { + if ($this->validateCustomer($customerId)) { + /** @var CompareList $compareListModel */ + $compareList = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareList, $listId, 'list_id'); + $compareList->setCustomerId($customerId); + $this->resourceCompareList->save($compareList); + return true; + } + + return false; + } + /** * Customer validate * - * @param $customerId + * @param int $customerId * - * @return CustomerInterface + * @return int * * @throws GraphQlAuthenticationException * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException */ - public function validateCustomer($customerId) + public function validateCustomer(int $customerId): int { try { $customer = $this->customerRepository->getById($customerId); @@ -128,6 +153,6 @@ public function validateCustomer($customerId) throw new GraphQlAuthenticationException(__("This account isn't confirmed. Verify and try again.")); } - return $customer; + return (int)$customer->getId(); } } From 40d5bf6fe3dfa5dfe60f03a7dd32becd5a964a89 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 16 Oct 2020 20:24:17 +0300 Subject: [PATCH 059/490] removing product from compare list and compare list --- .../ResourceModel/Product/Compare/Item.php | 4 + .../Resolver/AssignCompareListToCustomer.php | 14 ++- .../Model/Resolver/CreateCompareList.php | 32 ++++--- .../Model/Resolver/DeleteCompareList.php | 59 ++++++++++++- .../RemoveProductsFromCompareList.php | 87 ++++++++----------- .../GetComparableItemsCollection.php | 1 - .../Model/Service/CreateCompareList.php | 3 + .../Model/Service/GetComparableItems.php | 1 - .../Model/Service/RemoveFromCompareList.php | 59 +++++++++++++ 9 files changed, 195 insertions(+), 65 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/RemoveFromCompareList.php diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php index 7eb0552e355fc..715abd1884abf 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php @@ -45,6 +45,10 @@ public function loadByProduct(\Magento\Catalog\Model\Product\Compare\Item $objec $select->where('visitor_id = ?', (int)$object->getVisitorId()); } + if ($object->getListId()) { + $select->where('list_id = ?', (int)$object->getListId()); + } + $data = $connection->fetchRow($select); if (!$data) { diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index c5325673e69f8..cd9f7007f8549 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -73,7 +74,18 @@ public function resolve( } $listId = $this->maskedListIdToCompareListId->execute($args['uid']); + $result = false; - return $this->customerService->setCustomerToCompareList($listId, $context->getUserId()); + if ($listId) { + try { + $result = $this->customerService->setCustomerToCompareList($listId, $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during assigning customer.') + ); + } + } + + return $result; } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index cb7a800cc69cc..a731b22788563 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -11,7 +11,9 @@ use Magento\CompareListGraphQl\Model\Service\CreateCompareList as CreateCompareListService; use Magento\CompareListGraphQl\Model\Service\CustomerService; use Magento\CompareListGraphQl\Model\Service\GetCompareList; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; @@ -81,6 +83,8 @@ public function __construct( * @return Value|mixed|void * * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws GraphQlInputException + * @throws LocalizedException */ public function resolve( Field $field, @@ -94,19 +98,25 @@ public function resolve( $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); $generatedListId = $this->mathRandom->getUniqueHash(); - if ((0 === $customerId || null === $customerId)) { - $listId = $this->createCompareList->execute($generatedListId); - $this->addProductToCompareList->execute($listId, $products, $storeId); - } - - if ($customerId) { - $listId = $this->customerService->getListIdByCustomerId($customerId); - if ($listId) { - $this->addProductToCompareList->execute($listId, $products, $storeId); - } else { - $listId = $this->createCompareList->execute($generatedListId, $customerId); + try { + if ((0 === $customerId || null === $customerId)) { + $listId = $this->createCompareList->execute($generatedListId); $this->addProductToCompareList->execute($listId, $products, $storeId); } + + if ($customerId) { + $listId = $this->customerService->getListIdByCustomerId($customerId); + if ($listId) { + $this->addProductToCompareList->execute($listId, $products, $storeId); + } else { + $listId = $this->createCompareList->execute($generatedListId, $customerId); + $this->addProductToCompareList->execute($listId, $products, $storeId); + } + } + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during creating compare list') + ); } return $this->getCompareList->execute($listId, $context); diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index 9bdc7fca6bebd..9b3cd0fee9525 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -7,7 +7,12 @@ namespace Magento\CompareListGraphQl\Model\Resolver; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; @@ -18,6 +23,36 @@ */ class DeleteCompareList implements ResolverInterface { + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var CompareListResource + */ + private $compareListResource; + + /** + * @var MaskedListIdToCompareListId + */ + private $maskedListIdToCompareListId; + + /** + * @param CompareListFactory $compareListFactory + * @param CompareListResource $compareListResource + * @param MaskedListIdToCompareListId $maskedListIdToCompareListId + */ + public function __construct( + CompareListFactory $compareListFactory, + CompareListResource $compareListResource, + MaskedListIdToCompareListId $maskedListIdToCompareListId + ) { + $this->compareListFactory = $compareListFactory; + $this->compareListResource = $compareListResource; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + } + /** * @param Field $field * @param ContextInterface $context @@ -26,7 +61,9 @@ class DeleteCompareList implements ResolverInterface * @param array|null $args * * @return Value|mixed|void + * * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws GraphQlInputException */ public function resolve( Field $field, @@ -35,6 +72,26 @@ public function resolve( array $value = null, array $args = null ) { - // TODO: Implement resolve() method. + if (!isset($args['uid'])) { + throw new GraphQlInputException(__('"uid" value must be specified')); + } + + $listId = $this->maskedListIdToCompareListId->execute($args['uid']); + $removed = ['result' => false]; + + if ($listId) { + try { + $compareList = $this->compareListFactory->create(); + $compareList->setListId($listId); + $this->compareListResource->delete($compareList); + $removed['result'] = true; + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during removing compare list') + ); + } + } + + return $removed; } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php index 35baeb4996048..0ca47c0f4b6e4 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php @@ -7,19 +7,16 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\Catalog\Model\CompareList as ModelCompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\Product\Compare\Item; -use Magento\Catalog\Model\Product\Compare\ItemFactory; -use Magento\Catalog\Model\ResourceModel\CompareList as ResourceCompareList; -use Magento\CompareListGraphQl\Model\Service\CompareListService; +use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; +use Magento\CompareListGraphQl\Model\Service\RemoveFromCompareList; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Api\Data\StoreInterface; /** * Remove items from compare list @@ -27,47 +24,37 @@ class RemoveProductsFromCompareList implements ResolverInterface { /** - * @var CompareListFactory + * @var GetCompareList */ - private $compareListFactory; + private $getCompareList; /** - * @var ResourceCompareList + * @var RemoveFromCompareList */ - private $resourceCompareList; + private $removeFromCompareList; /** - * Compare item factory - * - * @var ItemFactory - */ - private $compareItemFactory; - - /** - * @var CompareListService + * @var MaskedListIdToCompareListId */ - private $compareListService; + private $maskedListIdToCompareListId; /** - * @param CompareListFactory $compareListFactory - * @param ResourceCompareList $resourceCompareList - * @param ItemFactory $compareItemFactory - * @param CompareListService $compareListService + * @param GetCompareList $getCompareList + * @param RemoveFromCompareList $removeFromCompareList + * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( - CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList, - ItemFactory $compareItemFactory, - CompareListService $compareListService + GetCompareList $getCompareList, + RemoveFromCompareList $removeFromCompareList, + MaskedListIdToCompareListId $maskedListIdToCompareListId ) { - $this->compareListFactory = $compareListFactory; - $this->resourceCompareList = $resourceCompareList; - $this->compareItemFactory = $compareItemFactory; - $this->compareListService = $compareListService; + $this->getCompareList = $getCompareList; + $this->removeFromCompareList = $removeFromCompareList; + $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; } /** - * Remove items from compare list + * Remove products from compare list * * @param Field $field * @param ContextInterface $context @@ -88,28 +75,28 @@ public function resolve( array $value = null, array $args = null ) { - $listId = (int)$args['id']; - /** @var StoreInterface $store */ - $store = $context->getExtensionAttributes()->getStore(); - /** @var $compareListModel ModelCompareList*/ - $compareListModel = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareListModel, $args['id']); + if (!isset($args['input']['products'])) { + throw new GraphQlInputException(__('"products" value must be specified.')); + } - if (!$compareListModel->getId()) { - throw new GraphQlInputException(__('Can\'t load compare list.')); + if (!isset($args['input']['uid'])) { + throw new GraphQlInputException(__('"uid" value must be specified.')); } - foreach ($args['items'] as $key) { - /* @var $item Item */ - $item = $this->compareItemFactory->create(); - $item->setListId($listId); - $item->loadByProduct($key); + $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid']); + + if (!$listId) { + throw new GraphQlInputException(__('"uid" value does not exist')); + } - if ($item->getId()) { - $item->delete(); - } + try { + $this->removeFromCompareList->execute($listId, $args['input']['products']); + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during removing products from compare list') + ); } - return $this->compareListService->getCompareList($listId, $context, $store); + return $this->getCompareList->execute($listId, $context); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php index ec58aada4c9cd..e766ec85248a1 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php @@ -73,7 +73,6 @@ public function __construct( public function execute(int $listId, ContextInterface $context): Collection { $this->compareProduct->setAllowUsedFlat(false); - /** @var Collection $comparableItems */ $this->items = $this->itemCollectionFactory->create(); $this->items->setListId($listId); $this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId()); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php index c781651c99d8e..c92eb777c5b05 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php @@ -12,6 +12,9 @@ use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskResource; +/** + * Create new Compare List + */ class CreateCompareList { /** diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index e2c2948cc71c4..9e5516ba0f557 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -18,7 +18,6 @@ use Magento\Store\Api\Data\StoreInterface; use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; - /** * Get comparable items */ diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/RemoveFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/RemoveFromCompareList.php new file mode 100644 index 0000000000000..dda400559a412 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/RemoveFromCompareList.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Service; + +use Magento\Catalog\Model\Product\Compare\Item; +use Magento\Catalog\Model\ResourceModel\Product\Compare\Item as CompareItemResource; +use Magento\Catalog\Model\Product\Compare\ItemFactory; + +/** + * Remove product from compare list + */ +class RemoveFromCompareList +{ + /** + * @var ItemFactory + */ + private $compareItemFactory; + + /** + * @var CompareItemResource + */ + private $compareItemResource; + + /** + * @param ItemFactory $compareItemFactory + * @param CompareItemResource $compareItemResource + */ + public function __construct( + ItemFactory $compareItemFactory, + CompareItemResource $compareItemResource + ) { + $this->compareItemFactory = $compareItemFactory; + $this->compareItemResource = $compareItemResource; + } + + /** + * Remove products from compare list + * + * @param int $listId + * @param array $products + */ + public function execute(int $listId, array $products) + { + foreach ($products as $productId) { + /* @var $item Item */ + $item = $this->compareItemFactory->create(); + $item->setListId($listId); + $this->compareItemResource->loadByProduct($item, $productId); + if ($item->getId()) { + $this->compareItemResource->delete($item); + } + } + } +} From eb4de34cfd1c72b68fe202233bc28ffe640958f8 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 16 Oct 2020 20:32:29 +0300 Subject: [PATCH 060/490] fix static issues --- .../Model/Resolver/AddProductsToCompareList.php | 2 +- .../CompareListGraphQl/Model/Service/AddToCompareList.php | 2 +- .../Model/Service/GetComparableAttributes.php | 2 +- .../CompareListGraphQl/Model/Service/GetComparableItems.php | 2 +- .../Magento/CompareListGraphQl/Model/Service/GetCompareList.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index c4f6521c42e10..e0b27157ff3ac 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -18,7 +18,7 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** - * Class add products to compare list + * Add products item to compare list */ class AddProductsToCompareList implements ResolverInterface { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index daba16b59dfd7..88893b23c3d65 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -61,7 +61,7 @@ public function execute(int $listId, array $products, int $storeId): int if (count($products)) { $existedProducts = $this->itemCollection->getProductsByListId($listId); foreach ($products as $productId) { - if (!array_search($productId, $existedProducts)) { + if (array_search($productId, $existedProducts) === false) { if ($this->productExists($productId)) { $item = $this->compareItemFactory->create(); $item->addProductData($productId); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php index 9e4dcf5fdad1a..a9c93d37c6d74 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php @@ -11,7 +11,7 @@ use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** - * Get comparable attributes + * Get products comparable attributes */ class GetComparableAttributes { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 9e5516ba0f557..6646a2e9e111c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -19,7 +19,7 @@ use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; /** - * Get comparable items + * Get comparable products */ class GetComparableItems { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index c90dc1d9faf4d..bdf24576ef516 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -11,7 +11,7 @@ use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** - * Get compare list + * Get products compare list */ class GetCompareList { From 35b8645a48dc1ad61939697e8f004a1e532ebc20 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Fri, 16 Oct 2020 17:34:34 -0500 Subject: [PATCH 061/490] MC-37484: Cart query error when trying to switch store view --- app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php | 2 +- .../QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index fa5ab69b67e3c..d4ced5b8b97b0 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -60,7 +60,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value return [ 'price' => [ 'currency' => $currencyCode, - 'value' => $cartItem->getConvertedPrice(), + 'value' => $cartItem->getCalculationPrice(), ], 'row_total' => [ 'currency' => $currencyCode, diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php index d86244b2d8fc3..66bea8e886a57 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php @@ -69,6 +69,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->checkCartCheckoutAllowance->execute($cart); $this->setShippingAddressesOnCart->execute($context, $cart, $shippingAddresses); + // reload updated cart + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ From 261e00c408d5ee4b459f413b16c05fcb3f35c16c Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 17 Oct 2020 10:05:01 +0300 Subject: [PATCH 062/490] static issue fixes --- app/code/Magento/Catalog/Model/ListIdMask.php | 33 ------------------- .../ResourceModel/Product/Compare/Item.php | 1 + .../Product/Compare/Item/Collection.php | 6 ++-- .../Model/Resolver/CreateCompareList.php | 1 + .../Model/Resolver/DeleteCompareList.php | 2 ++ .../Model/Service/CustomerService.php | 16 ++++----- app/code/Magento/CompareListGraphQl/README.md | 4 +++ .../Magento/CompareListGraphQl/composer.json | 3 +- composer.json | 1 + 9 files changed, 22 insertions(+), 45 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/README.md diff --git a/app/code/Magento/Catalog/Model/ListIdMask.php b/app/code/Magento/Catalog/Model/ListIdMask.php index 160dc703ca876..06fc825a29d1b 100644 --- a/app/code/Magento/Catalog/Model/ListIdMask.php +++ b/app/code/Magento/Catalog/Model/ListIdMask.php @@ -7,46 +7,13 @@ namespace Magento\Catalog\Model; -use Magento\Framework\Data\Collection\AbstractDb; -use Magento\Framework\Math\Random; use Magento\Framework\Model\AbstractModel; -use Magento\Framework\Model\Context; -use Magento\Framework\Model\ResourceModel\AbstractResource; -use Magento\Framework\Registry; /** * ListIdMask model - * - * @method string getMaskedId() - * @method ListIdMask setMaskedId() */ class ListIdMask extends AbstractModel { - /** - * @var Random - */ - protected $randomDataGenerator; - - /** - * @param Context $context - * @param Registry $registry - * @param Random $randomDataGenerator - * @param AbstractResource $resource - * @param AbstractDb $resourceCollection - * @param array $data - */ - public function __construct( - Context $context, - Registry $registry, - Random $randomDataGenerator, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, - array $data = [] - ) { - $this->randomDataGenerator = $randomDataGenerator; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - /** * Initialize resource * diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php index 715abd1884abf..ff29a5afa7eda 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php @@ -144,6 +144,7 @@ public function purgeVisitorByCustomer($object) /** * Update (Merge) customer data from visitor + * * After Login process * * @param \Magento\Catalog\Model\Product\Compare\Item $object diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 8e50fb466d426..59ef50af74b33 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -166,13 +166,13 @@ public function setCustomerId($customerId) /** * Set listId filter to collection * - * @param $listId + * @param int $listId * * @return $this */ - public function setListId($listId) + public function setListId(int $listId) { - $this->listId = (int)$listId; + $this->listId = $listId; $this->_addJoinToSelect(); return $this; } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index a731b22788563..dd90fab117fd1 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -97,6 +97,7 @@ public function resolve( $products = !empty($args['input']['products']) ? $args['input']['products'] : []; $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); $generatedListId = $this->mathRandom->getUniqueHash(); + $listId = 0; try { if ((0 === $customerId || null === $customerId)) { diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index 9b3cd0fee9525..7278c6c0ef0d1 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -54,6 +54,8 @@ public function __construct( } /** + * Remove compare list + * * @param Field $field * @param ContextInterface $context * @param ResolveInfo $info diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php index 729a86177e651..201faf078d243 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php @@ -51,23 +51,23 @@ class CustomerService /** * @param AuthenticationInterface $authentication - * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $accountManagement - * @param ResourceCompareList $resourceCompareList - * @param CompareListFactory $compareListFactory + * @param CustomerRepositoryInterface $customerRepository + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList */ public function __construct( AuthenticationInterface $authentication, - CustomerRepositoryInterface $customerRepository, AccountManagementInterface $accountManagement, - ResourceCompareList $resourceCompareList, - CompareListFactory $compareListFactory + CustomerRepositoryInterface $customerRepository, + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList ) { $this->authentication = $authentication; - $this->customerRepository = $customerRepository; $this->accountManagement = $accountManagement; - $this->resourceCompareList = $resourceCompareList; + $this->customerRepository = $customerRepository; $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; } /** diff --git a/app/code/Magento/CompareListGraphQl/README.md b/app/code/Magento/CompareListGraphQl/README.md new file mode 100644 index 0000000000000..ed1c38ab33a3b --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/README.md @@ -0,0 +1,4 @@ +# CompareListGraphQl module + +The CompareListGraphQl module is designed to implement compare product functionality. + diff --git a/app/code/Magento/CompareListGraphQl/composer.json b/app/code/Magento/CompareListGraphQl/composer.json index fe4b67107c06d..af0863f4d4dbf 100644 --- a/app/code/Magento/CompareListGraphQl/composer.json +++ b/app/code/Magento/CompareListGraphQl/composer.json @@ -7,7 +7,8 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-catalog": "*", - "magento/module-customer": "*" + "magento/module-customer": "*", + "magento/module-store": "*" }, "license": [ "OSL-3.0", diff --git a/composer.json b/composer.json index 57fbfaaa35c2b..2ae82b6bcb538 100644 --- a/composer.json +++ b/composer.json @@ -136,6 +136,7 @@ "magento/module-checkout-agreements-graph-ql": "*", "magento/module-cms": "*", "magento/module-cms-url-rewrite": "*", + "magento/compare-list-graph-ql": "*", "magento/module-config": "*", "magento/module-configurable-import-export": "*", "magento/module-configurable-product": "*", From 89d77bb83a8fbb4155c151231fc51ff5f9a6febb Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 17 Oct 2020 10:11:44 +0300 Subject: [PATCH 063/490] changes in DB scheme --- app/code/Magento/Catalog/etc/db_schema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index 146a84e3045bd..1bd59e6236d69 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -547,7 +547,7 @@ default="0" comment="Product ID"/> <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false" comment="Store ID"/> - <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" identity="false" + <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="true" identity="false" comment="List ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="catalog_compare_item_id"/> From 48197d4b2e4fd8e1fe911d5051ecf17a3367df82 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 21 Oct 2020 20:43:52 +0300 Subject: [PATCH 064/490] Minor changes in schema --- .../Model/Service/GetComparableAttributes.php | 2 +- .../CompareListGraphQl/Model/Service/GetComparableItems.php | 2 +- app/code/Magento/CompareListGraphQl/etc/schema.graphqls | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php index a9c93d37c6d74..5b051a3825aac 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableAttributes.php @@ -44,7 +44,7 @@ public function execute(int $listId, ContextInterface $context): array foreach ($itemsCollection->getComparableAttributes() as $item) { $attributes[] = [ 'code' => $item->getAttributeCode(), - 'title' => $item->getStoreLabel() + 'label' => $item->getStoreLabel() ]; } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 6646a2e9e111c..3a797316583f3 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -95,7 +95,7 @@ public function getComparableItems(int $listId, ContextInterface $context, Store 'productId' => $item->getId(), 'name' => $item->getName(), 'sku' => $item->getSku(), - 'priceRange' => [ + 'price_range' => [ 'minimum_price' => $this->getMinimumProductPrice($item, $store), 'maximum_price' => $this->getMaximumProductPrice($item, $store) ], diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 46100d0a61bb7..497cdb35ce01c 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -5,7 +5,7 @@ type ComparableItem { productId: ID! @doc(description: "Product Id") name: String! @doc(description: "Product name") sku: String! @doc(description: "Product SKU") - priceRange: PriceRange! @doc(description: "Product prices") + price_range: PriceRange! @doc(description: "Product prices") canonical_url: String @doc(description: "Product URL") images: [ProductImage]! @doc(description: "Product Images") values: [ProductAttribute]! @doc(description: "Product comparable attributes") @@ -18,7 +18,7 @@ type ProductAttribute { type ComparableAttribute { code: String! @doc(description: "Attribute code") - title: String! @doc(description: "Attribute display title") + label: String! @doc(description: "Attribute label") } type CompareList { From 87be948915016ff3398a3eec9af903cfd4dbc844 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 065/490] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 4 +- ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 7 files changed, 73 insertions(+), 43 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml +++ /dev/null @@ -1,38 +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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 373274aef8584..ea2a858c63885 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -40,9 +40,7 @@ <element name="displayMode" type="select" selector="select[id*='display_mode']"/> <element name="restrictTypes" type="select" selector="select[id*='types']"/> <element name="saveAndContinue" type="button" selector="#save_and_edit_button" timeout="30"/> - <element name="deleteActionFirst" type="button" selector="#page_group_container_0 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> - <element name="deleteActionSecond" type="button" selector="#page_group_container_1 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> - <element name="deleteActionThird" type="button" selector="#page_group_container_2 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 4c5a1303fe4c7826024fd0d2119cec4de2a77d26 Mon Sep 17 00:00:00 2001 From: Chandresh Chauhan <47473360+Chandresh22@users.noreply.github.com> Date: Tue, 13 Oct 2020 09:16:46 +0530 Subject: [PATCH 066/490] Update ReviewDataProvider.php --- .../Ui/DataProvider/Product/ReviewDataProvider.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index a9c011d4a4865..d23f4359972dc 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -12,7 +12,7 @@ use Magento\Review\Model\Review; /** - * Class ReviewDataProvider + * DataProvider Product ReviewDataProvider * * @api * @@ -58,7 +58,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @since 100.1.0 */ public function getData() @@ -66,6 +66,14 @@ public function getData() $this->getCollection()->addEntityFilter($this->request->getParam('current_product_id', 0)) ->addStoreData(); + $params = $this->request->getParams(); + if (isset($params['sorting'])) { + $sorting = $params['sorting']; + $field = $sorting['field']; + $direction = $sorting['direction']; + $this->getCollection()->getSelect()->order($field . ' ' . $direction); + } + $arrItems = [ 'totalRecords' => $this->getCollection()->getSize(), 'items' => [], @@ -79,7 +87,7 @@ public function getData() } /** - * {@inheritdoc} + * @inheritdoc * @since 100.1.0 */ public function addFilter(\Magento\Framework\Api\Filter $filter) From ef3f6842448c9693f4593aba986f4a71691e152d Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Sat, 24 Oct 2020 01:54:17 +0200 Subject: [PATCH 067/490] Commit initial version of the fix "in" condition not tested --- .../Model/Resolver/Product/Identity.php | 16 +++++++++++++--- .../CatalogGraphQl/Model/Resolver/Products.php | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Identity.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Identity.php index 7aec66ccb699f..aff8fa8a6fc6d 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Identity.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Identity.php @@ -8,6 +8,8 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; use Magento\Framework\GraphQl\Query\Resolver\IdentityInterface; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\Product; /** * Identity for resolved products @@ -15,7 +17,8 @@ class Identity implements IdentityInterface { /** @var string */ - private $cacheTag = \Magento\Catalog\Model\Product::CACHE_TAG; + private $cacheTagProduct = Product::CACHE_TAG; + private $cacheTagCategory = Category::CACHE_TAG; /** * Get product ids for cache tag @@ -26,12 +29,19 @@ class Identity implements IdentityInterface public function getIdentities(array $resolvedData): array { $ids = []; + $categories = $resolvedData['categories'] ?? []; $items = $resolvedData['items'] ?? []; + foreach ($categories as $category) { + $ids[] = sprintf('%s_%s', $this->cacheTagCategory, $category); + } + if (!empty($categories)) { + array_unshift($ids, $this->cacheTagCategory); + } foreach ($items as $item) { - $ids[] = sprintf('%s_%s', $this->cacheTag, $item['entity_id']); + $ids[] = sprintf('%s_%s', $this->cacheTagProduct, $item['entity_id']); } if (!empty($ids)) { - array_unshift($ids, $this->cacheTag); + array_unshift($ids, $this->cacheTagProduct); } return $ids; diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php index ba158fab0120c..3e88b709ebdfb 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php @@ -79,6 +79,10 @@ public function resolve( 'layer_type' => isset($args['search']) ? Resolver::CATALOG_LAYER_SEARCH : Resolver::CATALOG_LAYER_CATEGORY, ]; + if (isset($args['filter'])) { + $data['categories'] = [$args['filter']['category_id']['eq'] ?? $args['filter']['category_id']['in']]; + } + return $data; } From e8268625bc7c68a6affe764103f8402e4dc862e1 Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Sat, 24 Oct 2020 14:31:58 +0200 Subject: [PATCH 068/490] Fix in condition filtering logic --- app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php index 3e88b709ebdfb..b148b4b20c236 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php @@ -80,7 +80,8 @@ public function resolve( ]; if (isset($args['filter'])) { - $data['categories'] = [$args['filter']['category_id']['eq'] ?? $args['filter']['category_id']['in']]; + $data['categories'] = $args['filter']['category_id']['eq'] ?? $args['filter']['category_id']['in']; + $data['categories'] = is_array($data['categories']) ? $data['categories'] : [$data['categories']]; } return $data; From 9f9d2cbf492634a89cb97326fba68a02d9e7c175 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 069/490] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From 89d3814530f20248a32b678fd9636bd990a5f9fb Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 070/490] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 2 + ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <waitForAjaxLoad stepKey="waitForLoad2"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> + <waitForAjaxLoad stepKey="waitForLoad3"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 4064f8eb394ca..d6b1601854683 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -49,6 +49,8 @@ <element name="displayPageControl" type="select" selector="[name='parameters[show_pager]']"/> <element name="numberOfProductsToDisplay" type="input" selector="[name='parameters[products_count]']"/> <element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/> + <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ +<?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="AdminWidgetAddAndDeleteMultipleLayoutSectionsTest"> + <annotations> + <features value="Widget"/> + <stories value="Add and Delete multiple layouts when creating a Widget"/> + <title value="Add and Delete multiple layouts"/> + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From 08ca835531a52d74649e1dd01bccd3b1c9f1cf8f Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 071/490] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 6 files changed, 72 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml +++ /dev/null @@ -1,38 +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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 788c26c8ed32630e8ab352c3f48d0764708cc0c6 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Mon, 26 Oct 2020 17:32:16 +0530 Subject: [PATCH 072/490] Added event prevent code --- .../Magento/Framework/View/Helper/SecureHtmlRenderer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index 87d4e88295356..d3d94dbb7f1eb 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -116,6 +116,7 @@ function {$listenerFunction} () { {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { + event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; From 455a28e150e5b5afcdbf7d5401a71ce910ef9667 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 26 Oct 2020 19:30:33 +0200 Subject: [PATCH 073/490] Add changes after schema updating --- .../Model/Service/GetComparableItems.php | 161 ++++++------------ .../Magento/CompareListGraphQl/composer.json | 5 +- .../CompareListGraphQl/etc/schema.graphqls | 10 +- composer.json | 2 +- .../GraphQl/CompareList/CompareListTest.php | 65 +++++++ 5 files changed, 122 insertions(+), 121 deletions(-) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 3a797316583f3..cfbf921ed50ba 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -8,15 +8,14 @@ namespace Magento\CompareListGraphQl\Model\Service; use Magento\Catalog\Block\Product\Compare\ListCompare; -use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListIdToMaskedListId; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\Discount; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool as PriceProviderPool; +use Magento\Catalog\Model\ProductRepository; +use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; -use Magento\Framework\Pricing\SaleableInterface; use Magento\Store\Api\Data\StoreInterface; -use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; /** * Get comparable products @@ -24,57 +23,41 @@ class GetComparableItems { /** - * @var Discount - */ - private $discount; - - /** - * @var PriceProviderPool + * @var ListCompare */ - private $priceProviderPool; + private $blockListCompare; /** - * @var ResourceCompareList + * @var ComparableItemsCollection */ - private $resourceCompareList; + private $comparableItemsCollection; /** - * @var CompareList + * @var ProductRepository */ - private $modelCompareList; + private $productRepository; /** - * @var ListCompare + * @var CompareListIdToMaskedListId */ - private $blockListCompare; + private $compareListIdToMaskedListId; /** - * @var ComparableItemsCollection - */ - private $comparableItemsCollection; - - /** - * @param PriceProviderPool $priceProviderPool - * @param Discount $discount - * @param ResourceCompareList $resourceCompareList - * @param CompareList $compareList - * @param ListCompare $listCompare - * @param ComparableItemsCollection $comparableItemsCollection + * @param ListCompare $listCompare + * @param ComparableItemsCollection $comparableItemsCollection + * @param ProductRepository $productRepository + * @param CompareListIdToMaskedListId $compareListIdToMaskedListId */ public function __construct( - PriceProviderPool $priceProviderPool, - Discount $discount, - ResourceCompareList $resourceCompareList, - CompareList $compareList, ListCompare $listCompare, - ComparableItemsCollection $comparableItemsCollection + ComparableItemsCollection $comparableItemsCollection, + ProductRepository $productRepository, + CompareListIdToMaskedListId $compareListIdToMaskedListId ) { - $this->priceProviderPool = $priceProviderPool; - $this->discount = $discount; - $this->resourceCompareList = $resourceCompareList; - $this->modelCompareList = $compareList; $this->blockListCompare = $listCompare; $this->comparableItemsCollection = $comparableItemsCollection; + $this->productRepository = $productRepository; + $this->compareListIdToMaskedListId = $compareListIdToMaskedListId; } /** @@ -85,35 +68,47 @@ public function __construct( * @param StoreInterface $store * * @return array + * @throws GraphQlInputException */ public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) { $items = []; + $maskedListId = $this->compareListIdToMaskedListId->execute($listId); foreach ($this->comparableItemsCollection->execute($listId, $context) as $item) { /** @var Product $item */ $items[] = [ - 'productId' => $item->getId(), - 'name' => $item->getName(), - 'sku' => $item->getSku(), - 'price_range' => [ - 'minimum_price' => $this->getMinimumProductPrice($item, $store), - 'maximum_price' => $this->getMaximumProductPrice($item, $store) - ], - 'canonical_url' => $item->getUrlKey(), - 'images' => [ - 'url' => [ - 'model' => $item, - 'image_type' => 'image', - 'label' => $item->getImageLabel() - ], - ], - 'values' => $this->getProductComparableAttributes($listId, $item, $context) + 'uid' => $maskedListId, + 'product' => $this->getProductData((int)$item->getId()), + 'attributes' => $this->getProductComparableAttributes($listId, $item, $context) ]; } return $items; } + /** + * Get product data + * + * @param int $productId + * + * @return array + * + * @throws GraphQlInputException + */ + private function getProductData(int $productId): array + { + $productData = []; + try { + $item = $this->productRepository->getById($productId); + $productData = $item->getData(); + $productData['model'] = $item; + } catch (LocalizedException $e) { + throw new GraphQlInputException(__($e->getMessage())); + } + + return $productData; + } + /** * Get comparable attributes for product * @@ -136,60 +131,4 @@ private function getProductComparableAttributes(int $listId, Product $product, C return $attributes; } - - /** - * Get formatted minimum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Get formatted maximum product price - * - * @param SaleableInterface $product - * @param StoreInterface $store - * - * @return array - */ - private function getMaximumProductPrice(SaleableInterface $product, StoreInterface $store): array - { - $priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId()); - $regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue(); - $finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue(); - return $this->formatPrice((float) $regularPrice, (float) $finalPrice, $store); - } - - /** - * Format price for GraphQl output - * - * @param float $regularPrice - * @param float $finalPrice - * @param StoreInterface $store - * - * @return array - */ - private function formatPrice(float $regularPrice, float $finalPrice, StoreInterface $store): array - { - return [ - 'regular_price' => [ - 'value' => $regularPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'final_price' => [ - 'value' => $finalPrice, - 'currency' => $store->getCurrentCurrencyCode() - ], - 'discount' => $this->discount->getDiscountByDifference($regularPrice, $finalPrice), - ]; - } } diff --git a/app/code/Magento/CompareListGraphQl/composer.json b/app/code/Magento/CompareListGraphQl/composer.json index af0863f4d4dbf..dcefc6acfa8b4 100644 --- a/app/code/Magento/CompareListGraphQl/composer.json +++ b/app/code/Magento/CompareListGraphQl/composer.json @@ -1,5 +1,5 @@ { - "name": "magento/compare-list-graph-ql", + "name": "magento/module-compare-list-graph-ql", "version": "1.0.0", "description": "N/A", "type": "magento2-module", @@ -8,7 +8,8 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-customer": "*", - "magento/module-store": "*" + "magento/module-store": "*", + "magento/module-catalog-graph-ql": "*" }, "license": [ "OSL-3.0", diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 497cdb35ce01c..8634b05aa2bdb 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -2,13 +2,9 @@ # See COPYING.txt for license details. type ComparableItem { - productId: ID! @doc(description: "Product Id") - name: String! @doc(description: "Product name") - sku: String! @doc(description: "Product SKU") - price_range: PriceRange! @doc(description: "Product prices") - canonical_url: String @doc(description: "Product URL") - images: [ProductImage]! @doc(description: "Product Images") - values: [ProductAttribute]! @doc(description: "Product comparable attributes") + uid: ID! + product: ProductInterface! + attributes: [ProductAttribute]! @doc(description: "Product comparable attributes") } type ProductAttribute { diff --git a/composer.json b/composer.json index 2ae82b6bcb538..c6db41663e778 100644 --- a/composer.json +++ b/composer.json @@ -136,7 +136,7 @@ "magento/module-checkout-agreements-graph-ql": "*", "magento/module-cms": "*", "magento/module-cms-url-rewrite": "*", - "magento/compare-list-graph-ql": "*", + "magento/module-compare-list-graph-ql": "*", "magento/module-config": "*", "magento/module-configurable-import-export": "*", "magento/module-configurable-product": "*", diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php new file mode 100644 index 0000000000000..6ac127b69875b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\CompareList; + +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test for Compare list feature + */ +class CompareListTest extends GraphQlAbstract +{ + /** + * Create compare list without product + */ + public function testCreateCompareListWithoutProducts() + { + $mutation = <<<MUTATION +mutation{ + createCompareList { + uid + items { + sku + } + } +} +MUTATION; + $response = $this->graphQlMutation($mutation); + $uid = $response['createCompareList']['uid']; + $this->uidAssertion($uid); + } + + /** + * Create compare list with products + */ + public function testCreateCompareListWithProducts() + { + $mutation = <<<MUTATION +mutation{ + createCompareList(input:{products: [?, ?]}){ + uid + items { + sku + } + } +} +MUTATION; + } + + + /** + * Assert UID + * + * @param string $uid + */ + private function uidAssertion(string $uid) + { + $this->assertIsString($uid); + $this->assertEquals(32, strlen($uid)); + } +} \ No newline at end of file From d436687801481990b8028b347d6a52187e72b4d0 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 26 Oct 2020 21:00:18 +0200 Subject: [PATCH 074/490] Add test coverage --- .../Magento/CompareListGraphQl/etc/module.xml | 1 - .../GraphQl/CompareList/CompareListTest.php | 188 +++++++++++++++++- 2 files changed, 179 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/etc/module.xml b/app/code/Magento/CompareListGraphQl/etc/module.xml index b3c330fc38df2..050093c2032ec 100644 --- a/app/code/Magento/CompareListGraphQl/etc/module.xml +++ b/app/code/Magento/CompareListGraphQl/etc/module.xml @@ -12,7 +12,6 @@ <module name="Magento_Catalog"/> <module name="Magento_Customer"/> <module name="Magento_GraphQl"/> - <module name="Magento_CatalogGraphQl"/> </sequence> </module> </config> diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php index 6ac127b69875b..b2238ffb42423 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php @@ -7,6 +7,8 @@ namespace Magento\GraphQl\CompareList; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; /** @@ -14,17 +16,47 @@ */ class CompareListTest extends GraphQlAbstract { + private const PRODUCT_SKU_1 = 'simple1'; + private const PRODUCT_SKU_2 = 'simple2'; + + /** + * @var mixed + */ + private $productRepository; + + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $objectManager->get(ProductRepositoryInterface::class); + } /** * Create compare list without product */ public function testCreateCompareListWithoutProducts() { + $response = $this->createCompareList(); + $uid = $response['createCompareList']['uid']; + $this->uidAssertion($uid); + } + + /** + * Create compare list with products + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + */ + public function testCreateCompareListWithProducts() + { + $product1 = $this->productRepository->get(self::PRODUCT_SKU_1); + $product2 = $this->productRepository->get(self::PRODUCT_SKU_2); + $mutation = <<<MUTATION mutation{ - createCompareList { + createCompareList(input:{products: [{$product1->getId()}, {$product2->getId()}]}){ uid items { - sku + product { + sku + } } } } @@ -32,25 +64,150 @@ public function testCreateCompareListWithoutProducts() $response = $this->graphQlMutation($mutation); $uid = $response['createCompareList']['uid']; $this->uidAssertion($uid); + $this->itemsAssertion($response['createCompareList']['items']); } /** - * Create compare list with products + * Add products to compare list + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php */ - public function testCreateCompareListWithProducts() + public function testAddProductToCompareList() + { + $compareList = $this->createCompareList(); + $uid = $compareList['createCompareList']['uid']; + $this->uidAssertion($uid); + $response = $this->addProductsToCompareList($uid); + $resultUid = $response['addProductsToCompareList']['uid']; + $this->uidAssertion($resultUid); + $this->itemsAssertion($response['addProductsToCompareList']['items']); + } + + /** + * Remove products from compare list + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + */ + public function testRemoveProductFromCompareList() + { + $compareList = $this->createCompareList(); + $uid = $compareList['createCompareList']['uid']; + $this->uidAssertion($uid); + $addProducts = $this->addProductsToCompareList($uid); + $this->itemsAssertion($addProducts['addProductsToCompareList']['items']); + $this->assertCount(2, $addProducts['addProductsToCompareList']['items']); + $product = $this->productRepository->get(self::PRODUCT_SKU_1); + $removeFromCompareList = <<<MUTATION +mutation{ + removeProductsFromCompareList(input: {uid: "{$uid}", products: [{$product->getId()}]}) { + uid + items { + product { + sku + } + } + } +} +MUTATION; + $response = $this->graphQlMutation($removeFromCompareList); + $this->assertCount(1, $response['removeProductsFromCompareList']['items']); + } + + /** + * Get compare list query + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + */ + public function testGetCompareList() + { + $compareList = $this->createCompareList(); + $uid = $compareList['createCompareList']['uid']; + $this->uidAssertion($uid); + $addProducts = $this->addProductsToCompareList($uid); + $this->itemsAssertion($addProducts['addProductsToCompareList']['items']); + $query = <<<QUERY +{ + compareList(uid: "{$uid}") { + uid + items { + product { + sku + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->itemsAssertion($response['compareList']['items']); + } + + /** + * Remove compare list + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + */ + public function testDeleteCompareList() + { + $compareList = $this->createCompareList(); + $uid = $compareList['createCompareList']['uid']; + $this->uidAssertion($uid); + $addProducts = $this->addProductsToCompareList($uid); + $this->itemsAssertion($addProducts['addProductsToCompareList']['items']); + $deleteCompareList = <<<MUTATION +mutation{ + deleteCompareList(uid:"{$uid}") { + result + } +} +MUTATION; + $response = $this->graphQlMutation($deleteCompareList); + $this->assertTrue($response['deleteCompareList']['result']); + $response1 = $this->graphQlMutation($deleteCompareList); + $this->assertFalse($response1['deleteCompareList']['result']); + } + + /** + * Create compare list + * + * @return array + */ + private function createCompareList(): array { $mutation = <<<MUTATION mutation{ - createCompareList(input:{products: [?, ?]}){ + createCompareList { uid - items { - sku - } } } MUTATION; + return $this->graphQlMutation($mutation); } + /** + * Add products to compare list + * + * @param $uid + * + * @return array + */ + private function addProductsToCompareList($uid): array + { + $product1 = $this->productRepository->get(self::PRODUCT_SKU_1); + $product2 = $this->productRepository->get(self::PRODUCT_SKU_2); + $addProductsToCompareList = <<<MUTATION +mutation{ + addProductsToCompareList(input: { uid: "{$uid}", products: [{$product1->getId()}, {$product2->getId()}]}) { + uid + items { + product { + sku + } + } + } +} +MUTATION; + return $this->graphQlMutation($addProductsToCompareList); + } /** * Assert UID @@ -62,4 +219,17 @@ private function uidAssertion(string $uid) $this->assertIsString($uid); $this->assertEquals(32, strlen($uid)); } -} \ No newline at end of file + + /** + * Assert products + * + * @param array $items + */ + private function itemsAssertion(array $items) + { + $this->assertArrayHasKey(0, $items); + $this->assertArrayHasKey(1, $items); + $this->assertEquals(self::PRODUCT_SKU_1, $items[0]['product']['sku']); + $this->assertEquals(self::PRODUCT_SKU_2, $items[1]['product']['sku']); + } +} From a4a8e42d126085c119ef34b09b1f77355c1ae89c Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Tue, 27 Oct 2020 14:41:50 -0500 Subject: [PATCH 075/490] MC-37484: Cart query error when trying to switch store view --- .../Resolver/AddSimpleProductsToCart.php | 1 + .../Guest/AddSimpleProductToCartTest.php | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php index 2948994cf0ba3..2135f3798d190 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php @@ -63,6 +63,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->addProductsToCart->execute($cart, $cartItems); + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ 'model' => $cart, diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php index 1f6c8aca54ea5..1468730028b6a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php @@ -81,6 +81,56 @@ public function testAddSimpleProductToCart() self::assertEquals('USD', $rowTotalIncludingTax['currency']); } + /** + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/Store/_files/second_store.php + */ + public function testAddSimpleProductWithDifferentStoreHeader() + { + $sku = 'simple_product'; + $quantity = 2; + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $headerMap = ['Store' => 'fixture_second_store']; + $query = $this->getQuery($maskedQuoteId, $sku, $quantity); + $response = $this->graphQlMutation($query, [], '', $headerMap); + self::assertArrayHasKey('cart', $response['addSimpleProductsToCart']); + + self::assertArrayHasKey('shipping_addresses', $response['addSimpleProductsToCart']['cart']); + self::assertEmpty($response['addSimpleProductsToCart']['cart']['shipping_addresses']); + self::assertEquals($quantity, $response['addSimpleProductsToCart']['cart']['items'][0]['quantity']); + self::assertEquals($sku, $response['addSimpleProductsToCart']['cart']['items'][0]['product']['sku']); + self::assertArrayHasKey('prices', $response['addSimpleProductsToCart']['cart']['items'][0]); + self::assertArrayHasKey('id', $response['addSimpleProductsToCart']['cart']); + self::assertEquals($maskedQuoteId, $response['addSimpleProductsToCart']['cart']['id']); + + self::assertArrayHasKey('price', $response['addSimpleProductsToCart']['cart']['items'][0]['prices']); + $price = $response['addSimpleProductsToCart']['cart']['items'][0]['prices']['price']; + self::assertArrayHasKey('value', $price); + self::assertEquals(10, $price['value']); + self::assertArrayHasKey('currency', $price); + self::assertEquals('USD', $price['currency']); + + self::assertArrayHasKey('row_total', $response['addSimpleProductsToCart']['cart']['items'][0]['prices']); + $rowTotal = $response['addSimpleProductsToCart']['cart']['items'][0]['prices']['row_total']; + self::assertArrayHasKey('value', $rowTotal); + self::assertEquals(20, $rowTotal['value']); + self::assertArrayHasKey('currency', $rowTotal); + self::assertEquals('USD', $rowTotal['currency']); + + self::assertArrayHasKey( + 'row_total_including_tax', + $response['addSimpleProductsToCart']['cart']['items'][0]['prices'] + ); + $rowTotalIncludingTax = + $response['addSimpleProductsToCart']['cart']['items'][0]['prices']['row_total_including_tax']; + self::assertArrayHasKey('value', $rowTotalIncludingTax); + self::assertEquals(20, $rowTotalIncludingTax['value']); + self::assertArrayHasKey('currency', $rowTotalIncludingTax); + self::assertEquals('USD', $rowTotalIncludingTax['currency']); + } + /** * @magentoApiDataFixture Magento/Catalog/_files/product_with_image_no_options.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php From 880e45404581f8fe57abc3a5ffffee871b3117b8 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 28 Oct 2020 11:28:39 +0200 Subject: [PATCH 076/490] add new scenario to test coverage --- .../Model/Service/GetComparableItems.php | 3 +- .../Model/Service/GetCompareList.php | 5 +- .../Magento/CompareListGraphQl/composer.json | 3 +- .../GraphQl/CompareList/CompareListTest.php | 88 ++++++++++++++++++- 4 files changed, 92 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index cfbf921ed50ba..2b458db70a3b9 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -65,12 +65,11 @@ public function __construct( * * @param int $listId * @param ContextInterface $context - * @param StoreInterface $store * * @return array * @throws GraphQlInputException */ - public function getComparableItems(int $listId, ContextInterface $context, StoreInterface $store) + public function getComparableItems(int $listId, ContextInterface $context) { $items = []; $maskedListId = $this->compareListIdToMaskedListId->execute($listId); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index bdf24576ef516..5cd785368f8a6 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -8,6 +8,7 @@ namespace Magento\CompareListGraphQl\Model\Service; use Magento\Catalog\Model\CompareListIdToMaskedListId; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** @@ -52,14 +53,14 @@ public function __construct( * @param ContextInterface $context * * @return array + * @throws GraphQlInputException */ public function execute(int $listId, ContextInterface $context) { - $store = $context->getExtensionAttributes()->getStore(); $maskedListId = $this->compareListIdToMaskedListId->execute($listId); return [ 'uid' => $maskedListId, - 'items' => $this->comparableItemsService->getComparableItems($listId, $context, $store), + 'items' => $this->comparableItemsService->getComparableItems($listId, $context), 'attributes' => $this->comparableAttributesService->execute($listId, $context) ]; } diff --git a/app/code/Magento/CompareListGraphQl/composer.json b/app/code/Magento/CompareListGraphQl/composer.json index dcefc6acfa8b4..0c3c76e49f85d 100644 --- a/app/code/Magento/CompareListGraphQl/composer.json +++ b/app/code/Magento/CompareListGraphQl/composer.json @@ -8,8 +8,7 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-customer": "*", - "magento/module-store": "*", - "magento/module-catalog-graph-ql": "*" + "magento/module-store": "*" }, "license": [ "OSL-3.0", diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php index b2238ffb42423..a8543fee28d47 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php @@ -8,6 +8,7 @@ namespace Magento\GraphQl\CompareList; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -20,14 +21,20 @@ class CompareListTest extends GraphQlAbstract private const PRODUCT_SKU_2 = 'simple2'; /** - * @var mixed + * @var ProductRepositoryInterface */ private $productRepository; + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + protected function setUp(): void { $objectManager = Bootstrap::getObjectManager(); $this->productRepository = $objectManager->get(ProductRepositoryInterface::class); + $this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class); } /** * Create compare list without product @@ -166,6 +173,85 @@ public function testDeleteCompareList() $this->assertFalse($response1['deleteCompareList']['result']); } + /** + * Assign compare list to customer + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoApiDataFixture Magento/Customer/_files/customer.php + */ + public function testAssignCompareListToCustomer() + { + $compareList = $this->createCompareList(); + $uid = $compareList['createCompareList']['uid']; + $this->uidAssertion($uid); + $addProducts = $this->addProductsToCompareList($uid); + $this->itemsAssertion($addProducts['addProductsToCompareList']['items']); + $currentEmail = 'customer@example.com'; + $currentPassword = 'password'; + $customerQuery = <<<QUERY +{ + customer { + firstname + lastname + compare_list { + uid + items { + product { + sku + } + } + } + } +} +QUERY; + $customerResponse = $this->graphQlQuery( + $customerQuery, + [], + '', + $this->getCustomerAuthHeaders($currentEmail, $currentPassword) + ); + $this->assertArrayHasKey('compare_list', $customerResponse['customer']); + $this->assertNull($customerResponse['customer']['compare_list']); + + $assignCompareListToCustomer = <<<MUTATION +mutation { + assignCompareListToCustomer(uid: "{$uid}") +} +MUTATION; + $assignResponse = $this->graphQlMutation( + $assignCompareListToCustomer, + [], + '', + $this->getCustomerAuthHeaders($currentEmail, $currentPassword) + ); + $this->assertTrue($assignResponse['assignCompareListToCustomer']); + + $customerAssignedResponse = $this->graphQlQuery( + $customerQuery, + [], + '', + $this->getCustomerAuthHeaders($currentEmail, $currentPassword) + ); + + $this->assertArrayHasKey('compare_list', $customerAssignedResponse['customer']); + $this->uidAssertion($customerAssignedResponse['customer']['compare_list']['uid']); + $this->itemsAssertion($customerAssignedResponse['customer']['compare_list']['items']); + } + + /** + * Get customer Header + * + * @param string $email + * @param string $password + * + * @return array + */ + private function getCustomerAuthHeaders(string $email, string $password): array + { + $customerToken = $this->customerTokenService->createCustomerAccessToken($email, $password); + return ['Authorization' => 'Bearer ' . $customerToken]; + } + /** * Create compare list * From 0ad43113fd22031399b99d225858b69d7f1df515 Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Wed, 28 Oct 2020 17:27:40 +0200 Subject: [PATCH 077/490] CE#30625: The fields that described below has been deprecated - special_from_date - attribute_set_id - new_from_date - new_to_date - created_at - updated_at --- .../CatalogGraphQl/etc/schema.graphqls | 12 ++-- .../CategoriesQuery/CategoryTreeTest.php | 40 ------------- .../Magento/GraphQl/Catalog/CategoryTest.php | 43 +------------- .../GraphQl/Catalog/ProductViewTest.php | 59 +------------------ .../Framework/QueryComplexityLimiterTest.php | 25 -------- 5 files changed, 9 insertions(+), 170 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 35067a6cb99af..7c52f2ff959b2 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -89,21 +89,21 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ description: ComplexTextValue @doc(description: "Detailed information about the product. The value can include simple HTML tags.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute") short_description: ComplexTextValue @doc(description: "A short description of the product. Its use depends on the theme.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute") special_price: Float @doc(description: "The discounted price of the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SpecialPrice") - special_from_date: String @doc(description: "The beginning date that a product has a special price.") + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The beginning date that a product has a special price.") special_to_date: String @doc(description: "The end date that a product has a special price.") - attribute_set_id: Int @doc(description: "The attribute set assigned to the product.") + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The attribute set assigned to the product.") meta_title: String @doc(description: "A string that is displayed in the title bar and tab of the browser and in search results lists.") meta_keyword: String @doc(description: "A comma-separated list of keywords that are visible only to search engines.") meta_description: String @doc(description: "A brief overview of the product for search results listings, maximum 255 characters.") image: ProductImage @doc(description: "The relative path to the main image on the product page.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductImage") small_image: ProductImage @doc(description: "The relative path to the small image, which is used on catalog pages.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductImage") thumbnail: ProductImage @doc(description: "The relative path to the product's thumbnail image.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductImage") - new_from_date: String @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") - new_to_date: String @doc(description: "The end date for new product listings.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The end date for new product listings.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") @doc(description: "The price when tier pricing is in effect and the items purchased threshold has been reached.") options_container: String @doc(description: "If the product has multiple options, determines where they appear on the product page.") - created_at: String @doc(description: "Timestamp indicating when the product was created.") - updated_at: String @doc(description: "Timestamp indicating when the product was updated.") + created_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the product was created.") + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the product was updated.") country_of_manufacture: String @doc(description: "The product's country of origin.") type_id: String @doc(description: "One of simple, virtual, bundle, downloadable, grouped, or configurable.") @deprecated(reason: "Use __typename instead.") websites: [Website] @doc(description: "An array of websites in which the product is available.") @deprecated(reason: "The field should not be used on the storefront.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Websites") diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php index 641253cc34c2c..40890a5ac0186 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php @@ -308,9 +308,7 @@ public function testCategoryProducts() page_size } items { - attribute_set_id country_of_manufacture - created_at description { html } @@ -349,8 +347,6 @@ public function testCategoryProducts() } } name - new_from_date - new_to_date options_container price { minimalPrice { @@ -409,7 +405,6 @@ public function testCategoryProducts() sku small_image { url, label } thumbnail { url, label } - special_from_date special_price special_to_date swatch_image @@ -422,17 +417,8 @@ public function testCategoryProducts() website_id } type_id - updated_at url_key url_path - websites { - id - name - code - sort_order - default_group_id - is_default - } } } } @@ -453,7 +439,6 @@ public function testCategoryProducts() $firstProductModel = $productRepository->get($firstProduct['sku'], false, null, true); $this->assertBaseFields($firstProductModel, $firstProduct); $this->assertAttributes($firstProduct); - $this->assertWebsites($firstProductModel, $firstProduct['websites']); $this->assertEquals('Category 1', $firstProduct['categories'][0]['name']); $this->assertEquals('category-1/category-1-1', $firstProduct['categories'][1]['url_path']); $this->assertCount(3, $firstProduct['categories']); @@ -664,8 +649,6 @@ public function categoryImageDataProvider(): array private function assertBaseFields($product, $actualResponse) { $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'price', 'expected_value' => [ 'minimalPrice' => [ @@ -693,30 +676,10 @@ private function assertBaseFields($product, $actualResponse) ], ['response_field' => 'sku', 'expected_value' => $product->getSku()], ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], - ['response_field' => 'updated_at', 'expected_value' => $product->getUpdatedAt()], ]; $this->assertResponseFields($actualResponse, $assertionMap); } - /** - * @param ProductInterface $product - * @param array $actualResponse - */ - private function assertWebsites($product, $actualResponse) - { - $assertionMap = [ - [ - 'id' => current($product->getExtensionAttributes()->getWebsiteIds()), - 'name' => 'Main Website', - 'code' => 'base', - 'sort_order' => 0, - 'default_group_id' => '1', - 'is_default' => true, - ] - ]; - $this->assertEquals($actualResponse, $assertionMap); - } - /** * @param array $actualResponse */ @@ -731,11 +694,8 @@ private function assertAttributes($actualResponse) 'short_description', 'country_of_manufacture', 'gift_message_available', - 'new_from_date', - 'new_to_date', 'options_container', 'special_price', - 'special_from_date', 'special_to_date', ]; foreach ($eavAttributes as $eavAttribute) { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index f086a2211b51d..b8d2a8cf4b0d0 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -333,9 +333,7 @@ public function testCategoryProducts() page_size } items { - attribute_set_id country_of_manufacture - created_at description { html } @@ -374,8 +372,6 @@ public function testCategoryProducts() } } name - new_from_date - new_to_date options_container price { minimalPrice { @@ -434,7 +430,6 @@ public function testCategoryProducts() sku small_image { url, label } thumbnail { url, label } - special_from_date special_price special_to_date swatch_image @@ -447,17 +442,8 @@ public function testCategoryProducts() website_id } type_id - updated_at url_key url_path - websites { - id - name - code - sort_order - default_group_id - is_default - } } } } @@ -478,7 +464,6 @@ public function testCategoryProducts() $firstProduct = $productRepository->get($firstProductSku, false, null, true); $this->assertBaseFields($firstProduct, $response['category']['products']['items'][0]); $this->assertAttributes($response['category']['products']['items'][0]); - $this->assertWebsites($firstProduct, $response['category']['products']['items'][0]['websites']); } /** @@ -688,8 +673,6 @@ public function categoryImageDataProvider(): array private function assertBaseFields($product, $actualResponse) { $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'price', 'expected_value' => [ 'minimalPrice' => [ @@ -717,30 +700,10 @@ private function assertBaseFields($product, $actualResponse) ], ['response_field' => 'sku', 'expected_value' => $product->getSku()], ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], - ['response_field' => 'updated_at', 'expected_value' => $product->getUpdatedAt()], ]; $this->assertResponseFields($actualResponse, $assertionMap); } - /** - * @param ProductInterface $product - * @param array $actualResponse - */ - private function assertWebsites($product, $actualResponse) - { - $assertionMap = [ - [ - 'id' => current($product->getExtensionAttributes()->getWebsiteIds()), - 'name' => 'Main Website', - 'code' => 'base', - 'sort_order' => 0, - 'default_group_id' => '1', - 'is_default' => true, - ] - ]; - $this->assertEquals($actualResponse, $assertionMap); - } - /** * @param array $actualResponse */ @@ -755,12 +718,8 @@ private function assertAttributes($actualResponse) 'short_description', 'country_of_manufacture', 'gift_message_available', - 'new_from_date', - 'new_to_date', 'options_container', - 'special_price', - 'special_from_date', - 'special_to_date', + 'special_price' ]; foreach ($eavAttributes as $eavAttribute) { $this->assertArrayHasKey($eavAttribute, $actualResponse); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 9946e74a24994..a05cca6920a5c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -45,9 +45,7 @@ public function testQueryAllFieldsSimpleProduct() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id country_of_manufacture - created_at gift_message_available id categories { @@ -86,8 +84,6 @@ public function testQueryAllFieldsSimpleProduct() } } name - new_from_date - new_to_date options_container ... on CustomizableProductInterface { options { @@ -229,10 +225,9 @@ public function testQueryAllFieldsSimpleProduct() sku small_image{ url, label } thumbnail { url, label } - special_from_date special_price special_to_date - swatch_image + swatch_image tier_price tier_prices { @@ -243,11 +238,9 @@ public function testQueryAllFieldsSimpleProduct() website_id } type_id - updated_at url_key url_path canonical_url - websites { id name code sort_order default_group_id is_default } ... on PhysicalProductInterface { weight } @@ -276,8 +269,6 @@ public function testQueryAllFieldsSimpleProduct() $this->assertBaseFields($product, $response['products']['items'][0]); $this->assertEavAttributes($product, $response['products']['items'][0]); $this->assertOptions($product, $response['products']['items'][0]); - $this->assertArrayHasKey('websites', $response['products']['items'][0]); - $this->assertWebsites($product, $response['products']['items'][0]['websites']); self::assertEquals( 'Movable Position 2', $responseObject->getData('products/items/0/categories/0/name') @@ -303,13 +294,11 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() products(filter: {sku: {eq: "{$productSku}"}}) { items{ - attribute_set_id categories { id } country_of_manufacture - created_at gift_message_available id image {url, label} @@ -342,8 +331,6 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() } } name - new_from_date - new_to_date options_container ... on CustomizableProductInterface { field_options: options { @@ -462,7 +449,6 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() } sku small_image { url, label } - special_from_date special_price special_to_date swatch_image @@ -477,10 +463,8 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() website_id } type_id - updated_at url_key url_path - websites { id name code sort_order default_group_id is_default } ... on PhysicalProductInterface { weight } @@ -501,8 +485,6 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() $this->assertCount(1, $response['products']['items']); $this->assertArrayHasKey(0, $response['products']['items']); $this->assertMediaGalleryEntries($product, $response['products']['items'][0]); - $this->assertArrayHasKey('websites', $response['products']['items'][0]); - $this->assertWebsites($product, $response['products']['items'][0]['websites']); } /** @@ -548,7 +530,6 @@ public function testProductLinks() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id type_id product_links { @@ -585,8 +566,6 @@ public function testProductPrices() products(filter: {price: {from: "150.0", to: "250.0"}}) { items { - attribute_set_id - created_at id name price { @@ -635,7 +614,6 @@ public function testProductPrices() } sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -815,8 +793,6 @@ private function assertBaseFields($product, $actualResponse) { $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], ['response_field' => 'id', 'expected_value' => $product->getId()], ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'price', 'expected_value' => @@ -846,33 +822,12 @@ private function assertBaseFields($product, $actualResponse) ], ['response_field' => 'sku', 'expected_value' => $product->getSku()], ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], - ['response_field' => 'updated_at', 'expected_value' => $product->getUpdatedAt()], ['response_field' => 'weight', 'expected_value' => $product->getWeight()], ]; $this->assertResponseFields($actualResponse, $assertionMap); } - /** - * @param ProductInterface $product - * @param array $actualResponse - */ - private function assertWebsites($product, $actualResponse) - { - $assertionMap = [ - [ - 'id' => current($product->getExtensionAttributes()->getWebsiteIds()), - 'name' => 'Main Website', - 'code' => 'base', - 'sort_order' => 0, - 'default_group_id' => '1', - 'is_default' => true, - ] - ]; - - $this->assertEquals($actualResponse, $assertionMap); - } - /** * @param ProductInterface $product * @param array $actualResponse @@ -905,10 +860,8 @@ private function assertEavAttributes($product, $actualResponse) 'meta_title', 'country_of_manufacture', 'gift_message_available', - 'news_from_date', 'options_container', 'special_price', - 'special_from_date', 'special_to_date', ]; $assertionMap = []; @@ -930,14 +883,6 @@ private function assertEavAttributes($product, $actualResponse) */ private function eavAttributesToGraphQlSchemaFieldTranslator(string $eavAttributeCode) { - switch ($eavAttributeCode) { - case 'news_from_date': - $eavAttributeCode = 'new_from_date'; - break; - case 'news_to_date': - $eavAttributeCode = 'new_to_date'; - break; - } return $eavAttributeCode; } @@ -1054,7 +999,7 @@ public function testProductInNonAnchoredSubCategories() $query = <<<QUERY { - products(filter: + products(filter: { sku: {in:["12345"]} } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php index 2ab7f50b86ae9..d4296d85724e6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php @@ -46,10 +46,7 @@ public function testQueryComplexityIsLimited() file } name - special_from_date special_to_date - new_to_date - new_from_date tier_price manufacturer thumbnail { @@ -62,8 +59,6 @@ public function testQueryComplexityIsLimited() label } canonical_url - updated_at - created_at categories { id position @@ -79,14 +74,11 @@ public function testQueryComplexityIsLimited() products { items { name - special_from_date special_to_date - new_to_date thumbnail { url label } - new_from_date tier_price manufacturer sku @@ -95,8 +87,6 @@ public function testQueryComplexityIsLimited() label } canonical_url - updated_at - created_at media_gallery_entries { position id @@ -117,10 +107,7 @@ public function testQueryComplexityIsLimited() products { items { name - special_from_date special_to_date - new_to_date - new_from_date tier_price manufacturer thumbnail { @@ -133,8 +120,6 @@ public function testQueryComplexityIsLimited() label } canonical_url - updated_at - created_at categories { id position @@ -150,10 +135,7 @@ public function testQueryComplexityIsLimited() products { items { name - special_from_date special_to_date - new_to_date - new_from_date tier_price manufacturer sku @@ -162,8 +144,6 @@ public function testQueryComplexityIsLimited() label } canonical_url - updated_at - created_at categories { id position @@ -179,7 +159,6 @@ public function testQueryComplexityIsLimited() products { items { name - special_from_date special_to_date price { minimalPrice { @@ -323,8 +302,6 @@ public function testQueryComplexityIsLimited() percentage_value website_id } - new_to_date - new_from_date tier_price manufacturer sku @@ -337,8 +314,6 @@ public function testQueryComplexityIsLimited() label } canonical_url - updated_at - created_at categories { id position From 2716339b3c3c97e9af35ef6aecaf634b1fce8f8d Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Wed, 28 Oct 2020 17:25:55 -0500 Subject: [PATCH 078/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Model/Coupon/Quote/UpdateCouponUsages.php | 18 +-- .../SalesRule/Model/CouponUsageConsumer.php | 104 ++++++++++++++++++ .../Model/Service/CouponUsageScheduler.php | 99 +++++++++++++++++ .../Magento/SalesRule/etc/communication.xml | 3 + app/code/Magento/SalesRule/etc/queue.xml | 3 + .../Magento/SalesRule/etc/queue_consumer.xml | 1 + .../Magento/SalesRule/etc/queue_publisher.xml | 3 + .../Magento/SalesRule/etc/queue_topology.xml | 1 + 8 files changed, 223 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/SalesRule/Model/CouponUsageConsumer.php create mode 100644 app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php diff --git a/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php b/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php index 0ee2ee09cad57..8f29dd8e0a63c 100644 --- a/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php +++ b/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php @@ -8,9 +8,9 @@ namespace Magento\SalesRule\Model\Coupon\Quote; use Magento\Quote\Api\Data\CartInterface; -use Magento\SalesRule\Model\Coupon\Usage\Processor as CouponUsageProcessor; use Magento\SalesRule\Model\Coupon\Usage\UpdateInfo; use Magento\SalesRule\Model\Coupon\Usage\UpdateInfoFactory; +use Magento\SalesRule\Model\Service\CouponUsageScheduler; /** * Updates the coupon usages from quote @@ -18,24 +18,24 @@ class UpdateCouponUsages { /** - * @var CouponUsageProcessor + * @var UpdateInfoFactory */ - private $couponUsageProcessor; + private $updateInfoFactory; /** - * @var UpdateInfoFactory + * @var CouponUsageScheduler */ - private $updateInfoFactory; + private $couponUsageScheduler; /** - * @param CouponUsageProcessor $couponUsageProcessor + * @param CouponUsageScheduler $couponUsageScheduler * @param UpdateInfoFactory $updateInfoFactory */ public function __construct( - CouponUsageProcessor $couponUsageProcessor, + CouponUsageScheduler $couponUsageScheduler, UpdateInfoFactory $updateInfoFactory ) { - $this->couponUsageProcessor = $couponUsageProcessor; + $this->couponUsageScheduler = $couponUsageScheduler; $this->updateInfoFactory = $updateInfoFactory; } @@ -59,6 +59,6 @@ public function execute(CartInterface $quote, bool $increment): void $updateInfo->setCustomerId((int)$quote->getCustomerId()); $updateInfo->setIsIncrement($increment); - $this->couponUsageProcessor->process($updateInfo); + $this->couponUsageScheduler->schedule($updateInfo); } } diff --git a/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php b/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php new file mode 100644 index 0000000000000..c84d5f90a1125 --- /dev/null +++ b/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SalesRule\Model; + +use Magento\SalesRule\Model\Coupon\Usage\UpdateInfoFactory; +use Magento\SalesRule\Model\Coupon\Usage\Processor as CouponUsageProcessor; +use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\EntityManager\EntityManager; +use Magento\Framework\Exception\NotFoundException; +use Psr\Log\LoggerInterface; + +/** + * Consumer for coupon usage update + */ +class CouponUsageConsumer +{ + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var CouponUsageProcessor + */ + private $processor; + + /** + * @var EntityManager + */ + private $entityManager; + + /** + * @var UpdateInfoFactory + */ + private $updateInfoFactory; + + /** + * @param UpdateInfoFactory $updateInfoFactory + * @param CouponUsageProcessor $processor + * @param LoggerInterface $logger + * @param SerializerInterface $serializer + * @param EntityManager $entityManager + */ + public function __construct( + UpdateInfoFactory $updateInfoFactory, + CouponUsageProcessor $processor, + LoggerInterface $logger, + SerializerInterface $serializer, + EntityManager $entityManager + ) { + $this->updateInfoFactory = $updateInfoFactory; + $this->processor = $processor; + $this->logger = $logger; + $this->serializer = $serializer; + $this->entityManager = $entityManager; + } + + /** + * Process coupon usage update + * + * @param OperationInterface $operation + * @return void + * @throws \Exception + */ + public function process(OperationInterface $operation): void + { + $q = 2; + + try { + $serializedData = $operation->getSerializedData(); + $data = $this->serializer->unserialize($serializedData); + $updateInfo = $this->updateInfoFactory->create(); + $updateInfo->setData($data); + $this->processor->process($updateInfo); + } catch (NotFoundException $e) { + $this->logger->critical($e->getMessage()); + $status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $errorCode = $e->getCode(); + $message = $e->getMessage(); + } catch (\Exception $e) { + $this->logger->critical($e->getMessage()); + $status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $errorCode = $e->getCode(); + $message = __('Sorry, something went wrong during rule usage update. Please see log for details.'); + } + + $operation->setStatus($status ?? OperationInterface::STATUS_TYPE_COMPLETE) + ->setErrorCode($errorCode ?? null) + ->setResultMessage($message ?? null); + + $this->entityManager->save($operation); + } +} diff --git a/app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php b/app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php new file mode 100644 index 0000000000000..79ecfb61290df --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SalesRule\Model\Service; + +use Magento\Framework\Bulk\BulkManagementInterface; +use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory; +use Magento\Framework\DataObject\IdentityGeneratorInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Bulk\OperationInterface; +use Magento\Authorization\Model\UserContextInterface; +use Magento\SalesRule\Model\Coupon\Usage\UpdateInfo; + +/** + * Scheduler for coupon usage queue + */ +class CouponUsageScheduler +{ + private const TOPIC_NAME = 'sales.rule.update.coupon.usage'; + + /** + * @var BulkManagementInterface + */ + private $bulkManagement; + + /** + * @var OperationInterfaceFactory + */ + private $operationFactory; + + /** + * @var IdentityGeneratorInterface + */ + private $identityService; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @param BulkManagementInterface $bulkManagement + * @param OperationInterfaceFactory $operartionFactory + * @param IdentityGeneratorInterface $identityService + * @param SerializerInterface $serializer + * @param UserContextInterface $userContext + */ + public function __construct( + BulkManagementInterface $bulkManagement, + OperationInterfaceFactory $operartionFactory, + IdentityGeneratorInterface $identityService, + SerializerInterface $serializer, + UserContextInterface $userContext + ) { + $this->bulkManagement = $bulkManagement; + $this->operationFactory = $operartionFactory; + $this->identityService = $identityService; + $this->serializer = $serializer; + $this->userContext = $userContext; + } + + /** + * Schedule sales rule usage info + * + * @param string $updateInfo + * @return boolean + */ + public function schedule(UpdateInfo $updateInfo): bool + { + $bulkUuid = $this->identityService->generateId(); + $bulkDescription = __('Rule processing: %1', implode(',', $updateInfo->getAppliedRuleIds())); + + $data = [ + 'data' => [ + 'bulk_uuid' => $bulkUuid, + 'topic_name' => self::TOPIC_NAME, + 'serialized_data' => $this->serializer->serialize($updateInfo->getData()), + 'status' => OperationInterface::STATUS_TYPE_OPEN, + ] + ]; + $operation = $this->operationFactory->create($data); + + return $this->bulkManagement->scheduleBulk( + $bulkUuid, + [$operation], + $bulkDescription, + $this->userContext->getUserId() + ); + } +} diff --git a/app/code/Magento/SalesRule/etc/communication.xml b/app/code/Magento/SalesRule/etc/communication.xml index 4c905fa83e2fd..786e866f0e3c5 100644 --- a/app/code/Magento/SalesRule/etc/communication.xml +++ b/app/code/Magento/SalesRule/etc/communication.xml @@ -9,4 +9,7 @@ <topic name="sales_rule.codegenerator" request="Magento\SalesRule\Api\Data\CouponGenerationSpecInterface"> <handler name="codegeneratorProcessor" type="Magento\SalesRule\Model\Coupon\Consumer" method="process" /> </topic> + <topic name="sales.rule.update.coupon.usage" request="Magento\AsynchronousOperations\Api\Data\OperationInterface"> + <handler name="sales.rule.update.coupon.usage" type="Magento\SalesRule\Model\CouponUsageConsumer" method="process" /> + </topic> </config> diff --git a/app/code/Magento/SalesRule/etc/queue.xml b/app/code/Magento/SalesRule/etc/queue.xml index 8217a0b9f6c1a..87dce71b53054 100644 --- a/app/code/Magento/SalesRule/etc/queue.xml +++ b/app/code/Magento/SalesRule/etc/queue.xml @@ -9,4 +9,7 @@ <broker topic="sales_rule.codegenerator" exchange="magento-db" type="db"> <queue name="codegenerator" consumer="codegeneratorProcessor" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\SalesRule\Model\Coupon\Consumer::process"/> </broker> + <broker topic="sales.rule.update.coupon.usage" exchange="magento-db" type="db"> + <queue name="sales.rule.update.coupon.usage" consumer="sales.rule.update.coupon.usage" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\SalesRule\Model\CouponUsageConsumer::process"/> + </broker> </config> diff --git a/app/code/Magento/SalesRule/etc/queue_consumer.xml b/app/code/Magento/SalesRule/etc/queue_consumer.xml index 9eb585f48e8e3..bcebaf6a543b9 100644 --- a/app/code/Magento/SalesRule/etc/queue_consumer.xml +++ b/app/code/Magento/SalesRule/etc/queue_consumer.xml @@ -7,4 +7,5 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd"> <consumer name="codegeneratorProcessor" queue="codegenerator" connection="db" maxMessages="5000" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\SalesRule\Model\Coupon\Consumer::process" /> + <consumer name="sales.rule.update.coupon.usage" queue="sales.rule.update.coupon.usage" connection="db" maxMessages="5000" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\SalesRule\Model\CouponUsageConsumer::process" /> </config> diff --git a/app/code/Magento/SalesRule/etc/queue_publisher.xml b/app/code/Magento/SalesRule/etc/queue_publisher.xml index 0863fba2307c5..f1b8bddf2c090 100644 --- a/app/code/Magento/SalesRule/etc/queue_publisher.xml +++ b/app/code/Magento/SalesRule/etc/queue_publisher.xml @@ -9,4 +9,7 @@ <publisher topic="sales_rule.codegenerator"> <connection name="db" exchange="magento-db" /> </publisher> + <publisher topic="sales.rule.update.coupon.usage"> + <connection name="db" exchange="magento-db" /> + </publisher> </config> diff --git a/app/code/Magento/SalesRule/etc/queue_topology.xml b/app/code/Magento/SalesRule/etc/queue_topology.xml index fd6a9bf36721c..3902c8a3ab36f 100644 --- a/app/code/Magento/SalesRule/etc/queue_topology.xml +++ b/app/code/Magento/SalesRule/etc/queue_topology.xml @@ -8,5 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> <exchange name="magento-db" type="topic" connection="db"> <binding id="codegeneratorBinding" topic="sales_rule.codegenerator" destinationType="queue" destination="codegenerator"/> + <binding id="couponUsageBinding" topic="sales.rule.update.coupon.usage" destinationType="queue" destination="sales.rule.update.coupon.usage"/> </exchange> </config> From 59c6c50ac58461fbdee87d1667ad3984ba0a7138 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 28 Oct 2020 19:14:20 -0500 Subject: [PATCH 079/490] MCP-103: L2 cache local flushing issues --- .../Cache/Backend/RemoteSynchronizedCache.php | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php index d0c05613fbddd..5fcf07ef58f27 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php +++ b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php @@ -61,6 +61,7 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 'remote_backend_options' => [], 'local_backend' => '', 'local_backend_options' => [], + 'local_backend_max_size' => 500, 'local_backend_custom_naming' => true, 'local_backend_autoload' => true, 'use_stale_cache' => false, @@ -237,6 +238,10 @@ public function save($data, $id, $tags = [], $specificLifetime = false) $dataToSave = $data; $remHash = $this->loadRemoteDataVersion($id); + if ($this->checkLocalCacheSpace()) { + $this->local->clean(); + } + if ($remHash !== false && $this->getDataVersion($data) === $remHash) { $dataToSave = $this->remote->load($id); } else { @@ -251,6 +256,41 @@ public function save($data, $id, $tags = [], $specificLifetime = false) return $this->local->save($dataToSave, $id, [], $specificLifetime); } + /** + * Check if local cache space bigger that configure amount + * + * @return bool + */ + private function checkLocalCacheSpace() + { + return + ( + $this->getDirectorySize($this->_options['local_backend_options']['cache_dir']) + ) / 1024 / 1024 >= + $this->_options['local_backend_max_size']; + } + + /** + * Get directory size + * + * @param $directory + * @return int + */ + private function getDirectorySize($directory) + { + $it = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::SKIP_DOTS); + $ri = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); + + $size = 0; + foreach ($ri as $file) { + if ($file->isFile()) { + $size += $file->getSize(); + } + } + + return $size; + } + /** * @inheritdoc */ @@ -266,7 +306,8 @@ public function remove($id) */ public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = []) { - return $this->remote->clean($mode, $tags); + return $this->remote->clean($mode, $tags) && + $this->local->clean($mode, $tags); } /** From fa3571813f64e293f115a282b6ea767f05b48285 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 28 Oct 2020 19:51:59 -0500 Subject: [PATCH 080/490] MCP-103: L2 cache local flushing issues --- .../Cache/Backend/RemoteSynchronizedCache.php | 37 +++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php index 5fcf07ef58f27..b8b7862e30e3a 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php +++ b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php @@ -238,10 +238,6 @@ public function save($data, $id, $tags = [], $specificLifetime = false) $dataToSave = $data; $remHash = $this->loadRemoteDataVersion($id); - if ($this->checkLocalCacheSpace()) { - $this->local->clean(); - } - if ($remHash !== false && $this->getDataVersion($data) === $remHash) { $dataToSave = $this->remote->load($id); } else { @@ -253,6 +249,10 @@ public function save($data, $id, $tags = [], $specificLifetime = false) $this->unlock($id); } + if (!mt_rand(0, 100) && $this->checkIfLocalCacheSpaceExceeded()) { + $this->local->clean(); + } + return $this->local->save($dataToSave, $id, [], $specificLifetime); } @@ -261,34 +261,9 @@ public function save($data, $id, $tags = [], $specificLifetime = false) * * @return bool */ - private function checkLocalCacheSpace() - { - return - ( - $this->getDirectorySize($this->_options['local_backend_options']['cache_dir']) - ) / 1024 / 1024 >= - $this->_options['local_backend_max_size']; - } - - /** - * Get directory size - * - * @param $directory - * @return int - */ - private function getDirectorySize($directory) + private function checkIfLocalCacheSpaceExceeded() { - $it = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::SKIP_DOTS); - $ri = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); - - $size = 0; - foreach ($ri as $file) { - if ($file->isFile()) { - $size += $file->getSize(); - } - } - - return $size; + return $this->getFillingPercentage() >= $this->_options['local_backend_max_size']; } /** From d41660f0b0c34457df76b044793a8e91053f3f02 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 28 Oct 2020 19:55:02 -0500 Subject: [PATCH 081/490] MCP-103: L2 cache local flushing issues --- .../Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php index b8b7862e30e3a..d4df3aae37a56 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php +++ b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php @@ -263,7 +263,7 @@ public function save($data, $id, $tags = [], $specificLifetime = false) */ private function checkIfLocalCacheSpaceExceeded() { - return $this->getFillingPercentage() >= $this->_options['local_backend_max_size']; + return $this->getFillingPercentage() >= 95; } /** From a800f8c410c5926c77cd97236d06cbb2c491d14f Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 28 Oct 2020 19:57:13 -0500 Subject: [PATCH 082/490] MCP-103: L2 cache local flushing issues --- .../Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php index d4df3aae37a56..96f7ad842691f 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php +++ b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php @@ -61,7 +61,6 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 'remote_backend_options' => [], 'local_backend' => '', 'local_backend_options' => [], - 'local_backend_max_size' => 500, 'local_backend_custom_naming' => true, 'local_backend_autoload' => true, 'use_stale_cache' => false, From 8479fe2fa5332864bfaa5598a8a9fa390a897449 Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Thu, 29 Oct 2020 12:10:36 +0200 Subject: [PATCH 083/490] CE#30474: Fixed the QueryComplexityLimiterTest tests --- .../Framework/QueryComplexityLimiterTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php index d4296d85724e6..a1e2e90c3f0a1 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php @@ -302,6 +302,24 @@ public function testQueryComplexityIsLimited() percentage_value website_id } + tier_prices { + customer_group_id + qty + percentage_value + website_id + } + tier_prices { + customer_group_id + qty + percentage_value + website_id + } + tier_prices { + customer_group_id + qty + percentage_value + website_id + } tier_price manufacturer sku @@ -335,6 +353,16 @@ public function testQueryComplexityIsLimited() position position position + position + position + position + position + position + position + position + position + position + position level url_key url_path From 47d016b09da639508939187506300bf47f3e1e10 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 29 Oct 2020 10:45:55 -0500 Subject: [PATCH 084/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- app/code/Magento/SalesRule/Model/CouponUsageConsumer.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php b/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php index c84d5f90a1125..0520cb658e408 100644 --- a/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php +++ b/app/code/Magento/SalesRule/Model/CouponUsageConsumer.php @@ -75,8 +75,6 @@ public function __construct( */ public function process(OperationInterface $operation): void { - $q = 2; - try { $serializedData = $operation->getSerializedData(); $data = $this->serializer->unserialize($serializedData); From 585a937b065bc798e491aec9bee73eb3280d7158 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 29 Oct 2020 10:48:16 -0500 Subject: [PATCH 085/490] MDVA-31238: Problems with indexer --- app/code/Magento/SalesRule/composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 572e191093275..580455b693153 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -25,7 +25,8 @@ "magento/module-widget": "*", "magento/module-captcha": "*", "magento/module-checkout": "*", - "magento/module-authorization": "*" + "magento/module-authorization": "*", + "magento/module-asynchronous-operations": "*" }, "suggest": { "magento/module-sales-rule-sample-data": "*" From 91f35a10457494a9a848775b58ad1797870bff12 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 29 Oct 2020 10:49:56 -0500 Subject: [PATCH 086/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- app/code/Magento/SalesRule/composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 580455b693153..20246f67e337e 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -7,6 +7,7 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", + "magento/framework-bulk": "*", "magento/module-backend": "*", "magento/module-catalog": "*", "magento/module-catalog-rule": "*", From b6cb6972a4da820a87188a7778214479f8cff6a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 29 Oct 2020 17:16:29 -0500 Subject: [PATCH 087/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- app/code/Magento/Catalog/etc/di.xml | 5 ++ .../Model/Coupon/Quote/UpdateCouponUsages.php | 14 +++--- ...Scheduler.php => CouponUsagePublisher.php} | 6 +-- .../SalesRule/Plugin/CouponUsagesTest.php | 50 +++++++++++++++++++ 4 files changed, 65 insertions(+), 10 deletions(-) rename app/code/Magento/SalesRule/Model/Service/{CouponUsageScheduler.php => CouponUsagePublisher.php} (95%) diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 8a116282e2578..149003104a9fd 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1319,4 +1319,9 @@ </argument> </arguments> </type> + <type name="Magento\Catalog\Model\Category\Attribute\Backend\Image"> + <arguments> + <argument name="imageUploader" xsi:type="object">Magento\Catalog\CategoryImageUpload</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php b/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php index 8f29dd8e0a63c..02da921e032e0 100644 --- a/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php +++ b/app/code/Magento/SalesRule/Model/Coupon/Quote/UpdateCouponUsages.php @@ -10,7 +10,7 @@ use Magento\Quote\Api\Data\CartInterface; use Magento\SalesRule\Model\Coupon\Usage\UpdateInfo; use Magento\SalesRule\Model\Coupon\Usage\UpdateInfoFactory; -use Magento\SalesRule\Model\Service\CouponUsageScheduler; +use Magento\SalesRule\Model\Service\CouponUsagePublisher; /** * Updates the coupon usages from quote @@ -23,19 +23,19 @@ class UpdateCouponUsages private $updateInfoFactory; /** - * @var CouponUsageScheduler + * @var CouponUsagePublisher */ - private $couponUsageScheduler; + private $couponUsagePublisher; /** - * @param CouponUsageScheduler $couponUsageScheduler + * @param CouponUsagePublisher $couponUsagePublisher * @param UpdateInfoFactory $updateInfoFactory */ public function __construct( - CouponUsageScheduler $couponUsageScheduler, + CouponUsagePublisher $couponUsagePublisher, UpdateInfoFactory $updateInfoFactory ) { - $this->couponUsageScheduler = $couponUsageScheduler; + $this->couponUsagePublisher = $couponUsagePublisher; $this->updateInfoFactory = $updateInfoFactory; } @@ -59,6 +59,6 @@ public function execute(CartInterface $quote, bool $increment): void $updateInfo->setCustomerId((int)$quote->getCustomerId()); $updateInfo->setIsIncrement($increment); - $this->couponUsageScheduler->schedule($updateInfo); + $this->couponUsagePublisher->publish($updateInfo); } } diff --git a/app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php b/app/code/Magento/SalesRule/Model/Service/CouponUsagePublisher.php similarity index 95% rename from app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php rename to app/code/Magento/SalesRule/Model/Service/CouponUsagePublisher.php index 79ecfb61290df..1d1bbb1f63ed3 100644 --- a/app/code/Magento/SalesRule/Model/Service/CouponUsageScheduler.php +++ b/app/code/Magento/SalesRule/Model/Service/CouponUsagePublisher.php @@ -18,7 +18,7 @@ /** * Scheduler for coupon usage queue */ -class CouponUsageScheduler +class CouponUsagePublisher { private const TOPIC_NAME = 'sales.rule.update.coupon.usage'; @@ -69,12 +69,12 @@ public function __construct( } /** - * Schedule sales rule usage info + * Publish sales rule usage info into the queue * * @param string $updateInfo * @return boolean */ - public function schedule(UpdateInfo $updateInfo): bool + public function publish(UpdateInfo $updateInfo): bool { $bulkUuid = $this->identityService->generateId(); $bulkDescription = __('Rule processing: %1', implode(',', $updateInfo->getAppliedRuleIds())); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index 4ed096fa4418a..bf8e9174a8216 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -14,6 +14,9 @@ use Magento\SalesRule\Model\Coupon; use Magento\SalesRule\Model\ResourceModel\Coupon\Usage; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\MessageQueue\EnvironmentPreconditionException; +use Magento\TestFramework\MessageQueue\PreconditionFailedException; +use Magento\TestFramework\MessageQueue\PublisherConsumerController; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -26,6 +29,16 @@ */ class CouponUsagesTest extends TestCase { + /** + * @var PublisherConsumerController + */ + private $publisherConsumerController; + + /** + * @var array + */ + private $consumers = ['sales.rule.update.coupon.usage']; + /** * @var ObjectManagerInterface */ @@ -61,6 +74,35 @@ protected function setUp(): void $this->couponUsage = $this->objectManager->get(DataObject::class); $this->quoteManagement = $this->objectManager->get(QuoteManagement::class); $this->orderService = $this->objectManager->get(OrderService::class); + + $this->publisherConsumerController = Bootstrap::getObjectManager()->create( + PublisherConsumerController::class, + [ + 'consumers' => $this->consumers, + 'logFilePath' => TESTS_TEMP_DIR . "/MessageQueueTestLog.txt", + 'maxMessages' => null, + 'appInitParams' => Bootstrap::getInstance()->getAppInitParams() + ] + ); + try { + $this->publisherConsumerController->startConsumers(); + } catch (EnvironmentPreconditionException $e) { + $this->markTestSkipped($e->getMessage()); + } catch (PreconditionFailedException $e) { + $this->fail( + $e->getMessage() + ); + } + parent::setUp(); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $this->publisherConsumerController->stopConsumers(); + parent::tearDown(); } /** @@ -74,6 +116,11 @@ public function testSubmitQuoteAndCancelOrder() $couponCode = 'one_usage'; $reservedOrderId = 'test01'; + $binDirectory = realpath(INTEGRATION_TESTS_DIR . '/bin/'); + $magentoCli = $binDirectory . '/magento'; + $consumerStartCommand = "php {$magentoCli} queue:consumers:start sales.rule.update.coupon.usage &"; + exec($consumerStartCommand); + /** @var Coupon $coupon */ $coupon = $this->objectManager->get(Coupon::class); $coupon->loadByCode($couponCode); @@ -83,6 +130,9 @@ public function testSubmitQuoteAndCancelOrder() // Make sure coupon usages value is incremented then order is placed. $order = $this->quoteManagement->submit($quote); + + + sleep(15); // timeout to processing Magento queue $this->usage->loadByCustomerCoupon($this->couponUsage, $customerId, $coupon->getId()); $coupon->loadByCode($couponCode); From 8c92a5cad2dc3026324d94eb4e842031d864a6b0 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Mon, 2 Nov 2020 17:02:39 +0530 Subject: [PATCH 088/490] Changes as per the test-cases failed comments --- app/code/Magento/LoginAsCustomerGraphQl/composer.json | 3 +-- app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml | 1 + composer.json | 1 + .../LoginAsCustomer/GenerateLoginCustomerTokenTest.php | 10 +++++----- .../testsuite/Magento/LoginAsCustomer/_files/admin.php | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 8a731de737097..291d2746d47a6 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -22,6 +22,5 @@ "psr-4": { "Magento\\LoginAsCustomerGraphQl\\": "" } - }, - "version": "1.0.1" + } } diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index 09a890bfe1021..ac54899fbbadb 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_LoginAsCustomerGraphQl"> <sequence> + <module name="Magento_LoginAsCustomer"/> <module name="Magento_Customer"/> <module name="Magento_Authorization"/> <module name="Magento_GraphQl"/> diff --git a/composer.json b/composer.json index 57fbfaaa35c2b..17116254c7d6d 100644 --- a/composer.json +++ b/composer.json @@ -192,6 +192,7 @@ "magento/module-integration": "*", "magento/module-layered-navigation": "*", "magento/module-login-as-customer": "*", + "magento/module-login-as-customer-graph-ql": "*", "magento/module-login-as-customer-admin-ui": "*", "magento/module-login-as-customer-api": "*", "magento/module-login-as-customer-assistance": "*", diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index 6b944fa561ad8..b4ed89ae4502a 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -56,7 +56,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() $mutation, [], '', - $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777') + $this->getAdminHeaderAuthentication('TestAdmin1', 'Magento777') ); $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); $this->assertIsArray($response['generateCustomerTokenAsAdmin']); @@ -73,7 +73,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() { $this->expectException(Exception::class); - $this->expectExceptionMessage("Login as Customer is disabled.."); + $this->expectExceptionMessage("Login as Customer is disabled."); $customerEmail = 'customer@example.com'; @@ -82,7 +82,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() $mutation, [], '', - $this->getAdminHeaderAuthentication('TestAdmin1', 'Zilker777') + $this->getAdminHeaderAuthentication('TestAdmin1', 'Magento777') ); } @@ -151,7 +151,7 @@ public function dataProviderInvalidInfo(): array return [ 'invalid_admin_user_name' => [ 'TestAdmin(^%', - 'Zilker777', + 'Magento777', 'customer@example.com', 'The account sign-in was incorrect or your account is disabled temporarily. ' . 'Please wait and try again later.' @@ -195,7 +195,7 @@ private function getQuery(string $customerEmail) : string */ public function getCustomerHeaderAuthentication( string $username = 'github@gmail.com', - string $password = 'Zilker777' + string $password = 'Magento777' ): array { $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php index 515b42542913b..c138882efdd73 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php @@ -18,7 +18,7 @@ 'firstname' => 'test', 'lastname' => 'test', 'email' => 'testadmin1@gmail.com', - 'password' =>'Zilker777', + 'password' =>'Magento777', 'interface_locale' => 'en_US', 'is_active' => 1 ]; From ebe6c10b35eb9bec682784b167947c6c1f6f8b2b Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Mon, 2 Nov 2020 20:33:55 +0200 Subject: [PATCH 089/490] CE#30625: The fields of the `CategoryInterface` have been deprecated - created_at - updated_at Also, the tests have been fixed --- .../Magento/CatalogGraphQl/etc/schema.graphqls | 4 ++-- .../GraphQl/Bundle/BundleProductViewTest.php | 13 +++++-------- .../GraphQl/Catalog/ProductDeleteTest.php | 2 +- .../Catalog/ProductInMultipleStoresTest.php | 3 --- .../GraphQl/Catalog/ProductSearchTest.php | 12 ------------ .../GraphQl/Catalog/VirtualProductViewTest.php | 18 ++++-------------- .../ConfigurableProductViewTest.php | 9 --------- .../DownloadableProductViewTest.php | 6 ------ .../GroupedProduct/GroupedProductViewTest.php | 2 -- .../GraphQl/GroupedProduct/ProductViewTest.php | 8 +++----- .../ProductInMultipleStoresCacheTest.php | 9 --------- .../RelatedProduct/GetRelatedProductsTest.php | 18 ++++-------------- .../Magento/GraphQl/Tax/ProductViewTest.php | 6 ------ 13 files changed, 19 insertions(+), 91 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 7c52f2ff959b2..818500b276ba9 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -249,8 +249,8 @@ interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model canonical_url: String @doc(description: "Relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Categories' is enabled") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CanonicalUrl") position: Int @doc(description: "The position of the category relative to other categories at the same level in tree.") level: Int @doc(description: "Indicates the depth of the category within the tree.") - created_at: String @doc(description: "Timestamp indicating when the category was created.") - updated_at: String @doc(description: "Timestamp indicating when the category was updated.") + created_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the category was created.") + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the category was updated.") product_count: Int @doc(description: "The number of products in the category that are marked as visible. By default, in complex products, parent products are visible, but their child products are not.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\ProductsCount") default_sort_by: String @doc(description: "The attribute to use for sorting.") products( diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php index a18b6e1206895..bc3fcd3a8427b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php @@ -38,7 +38,6 @@ public function testAllFieldsBundleProducts() type_id id name - attribute_set_id ... on PhysicalProductInterface { weight } @@ -54,7 +53,7 @@ public function testAllFieldsBundleProducts() required type position - sku + sku options { id quantity @@ -74,7 +73,7 @@ public function testAllFieldsBundleProducts() } } } - } + } } QUERY; @@ -118,7 +117,6 @@ public function testBundleProductWithNotVisibleChildren() type_id id name - attribute_set_id ... on PhysicalProductInterface { weight } @@ -134,7 +132,7 @@ public function testBundleProductWithNotVisibleChildren() required type position - sku + sku options { id quantity @@ -154,7 +152,7 @@ public function testBundleProductWithNotVisibleChildren() } } } - } + } } QUERY; @@ -207,8 +205,7 @@ private function assertBundleBaseFields($product, $actualResponse) ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], ['response_field' => 'id', 'expected_value' => $product->getId()], ['response_field' => 'name', 'expected_value' => $product->getName()], - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'weight', 'expected_value' => $product->getWeight()], + ['response_field' => 'weight', 'expected_value' => $product->getWeight()], ['response_field' => 'dynamic_price', 'expected_value' => !(bool)$product->getPriceType()], ['response_field' => 'dynamic_weight', 'expected_value' => !(bool)$product->getWeightType()], ['response_field' => 'dynamic_sku', 'expected_value' => !(bool)$product->getSkuType()] diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductDeleteTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductDeleteTest.php index b19b8d519e857..ab04333de0740 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductDeleteTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductDeleteTest.php @@ -39,7 +39,7 @@ public function testQuerySimpleProductAfterDelete() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id + id } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php index d17b434f39d9f..f91f4938624cf 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php @@ -31,8 +31,6 @@ public function testProductFromSpecificAndDefaultStore() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id - created_at id name price { @@ -45,7 +43,6 @@ public function testProductFromSpecificAndDefaultStore() } sku type_id - updated_at ... on PhysicalProductInterface { weight } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 62620330f6e7b..45f1d3c5e57cb 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -1086,7 +1086,6 @@ public function testFilterWithinSpecificPriceRangeSortedByNameDesc() weight } type_id - attribute_set_id } total_count page_info @@ -1239,7 +1238,6 @@ public function testSearchWithFilterWithPageSizeEqualTotalCount() weight } type_id - attribute_set_id } total_count page_info @@ -1303,7 +1301,6 @@ public function testFilterByMultipleFilterFieldsSortedByMultipleSortFields() weight } type_id - attribute_set_id } total_count page_info @@ -1682,7 +1679,6 @@ public function testFilterByExactSkuAndSortByPriceDesc() weight } type_id - attribute_set_id } total_count page_info @@ -2108,7 +2104,6 @@ public function testFilterWithinASpecificPriceRangeSortedByPriceDESC() { items { - attribute_set_id sku price { minimalPrice { @@ -2208,7 +2203,6 @@ public function testQueryFilterNoMatchingItems() weight } type_id - attribute_set_id } total_count page_info @@ -2265,7 +2259,6 @@ public function testQueryPageOutOfBoundException() ... on PhysicalProductInterface { weight } - attribute_set_id } total_count page_info @@ -2298,12 +2291,9 @@ public function testQueryWithNoSearchOrFilterArgumentException() { items{ id - attribute_set_id - created_at name sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -2448,7 +2438,6 @@ private function assertProductItems(array $filteredProducts, array $actualRespon $this->assertResponseFields( $productItemsInResponse[$itemIndex][0], [ - 'attribute_set_id' => $filteredProducts[$itemIndex]->getAttributeSetId(), 'sku' => $filteredProducts[$itemIndex]->getSku(), 'name' => $filteredProducts[$itemIndex]->getName(), 'price' => [ @@ -2475,7 +2464,6 @@ private function assertProductItemsWithPriceCheck(array $filteredProducts, array $this->assertResponseFields( $productItemsInResponse[$itemIndex][0], [ - 'attribute_set_id' => $filteredProducts[$itemIndex]->getAttributeSetId(), 'sku' => $filteredProducts[$itemIndex]->getSku(), 'name' => $filteredProducts[$itemIndex]->getName(), 'price' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php index 00f0c496d8ea4..0661ca04e3b49 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php @@ -30,21 +30,16 @@ public function testQueryAllFieldsVirtualProduct() { items{ id - attribute_set_id - created_at name sku type_id - updated_at ... on PhysicalProductInterface { weight - } + } ... on VirtualProduct { - attribute_set_id name id sku - } } } @@ -84,24 +79,20 @@ public function testCannotQueryWeightOnVirtualProductException() { items{ id - attribute_set_id - created_at name sku type_id - updated_at ... on PhysicalProductInterface { weight - } + } ... on VirtualProduct { - attribute_set_id name weight id - sku + sku } } - } + } } QUERY; @@ -119,7 +110,6 @@ public function testCannotQueryWeightOnVirtualProductException() private function assertBaseFields($product, $actualResponse) { $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], ['response_field' => 'id', 'expected_value' => $product->getId()], ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'sku', 'expected_value' => $product->getSku()], diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php index 49bbabc212fc2..a5431efefdde3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php @@ -39,12 +39,9 @@ public function testQueryConfigurableProductLinks() products(filter: {sku: {eq: "{$productSku}"}}) { items { id - attribute_set_id - created_at name sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -115,12 +112,9 @@ public function testQueryConfigurableProductLinks() id name sku - attribute_set_id ... on PhysicalProductInterface { weight } - created_at - updated_at price { minimalPrice { amount { @@ -237,8 +231,6 @@ private function assertBaseFields($product, $actualResponse) /** @var MetadataPool $metadataPool */ $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], [ 'response_field' => 'id', 'expected_value' => $product->getData( @@ -250,7 +242,6 @@ private function assertBaseFields($product, $actualResponse) ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'sku', 'expected_value' => $product->getSku()], ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], - ['response_field' => 'updated_at', 'expected_value' => $product->getUpdatedAt()], ['response_field' => 'weight', 'expected_value' => $product->getWeight()], [ 'response_field' => 'price', diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php index c2a1b0778d3c6..774e4dcbdf297 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php @@ -33,12 +33,9 @@ public function testQueryAllFieldsDownloadableProductsWithDownloadableFileAndSam { items{ id - attribute_set_id - created_at name sku type_id - updated_at price{ regularPrice{ amount{ @@ -110,12 +107,9 @@ public function testDownloadableProductQueryWithNoSample() { items{ id - attribute_set_id - created_at name sku type_id - updated_at ...on PhysicalProductInterface{ weight } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php index 8cb0a6db972b4..ac893aa10fd55 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php @@ -42,8 +42,6 @@ public function testAllFieldsGroupedProduct() products(filter: {sku: {eq: "{$productSku}"}}) { items { id - attribute_set_id - created_at name sku type_id diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/ProductViewTest.php index 9eea2396c24ce..86ba62f8e41ec 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/ProductViewTest.php @@ -106,13 +106,11 @@ private function getQuery(string $sku): string return <<<QUERY { products(filter: {sku: {eq: "{$sku}"}}) { - items { + items { id - attribute_set_id - created_at name sku - type_id + type_id ... on GroupedProduct { items{ qty @@ -121,7 +119,7 @@ private function getQuery(string $sku): string sku name type_id - url_key + url_key } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php index 20a612e9f88b0..40280f5c7b2c7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php @@ -93,8 +93,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNonExisti products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id - created_at id name price { @@ -107,7 +105,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNonExisti } sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -138,8 +135,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNotAllowe products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id - created_at id name price { @@ -152,7 +147,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNotAllowe } sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -187,8 +181,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id - created_at id name price { @@ -201,7 +193,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency() } sku type_id - updated_at ... on PhysicalProductInterface { weight } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php index cb210b180682c..f2cf90c95de18 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php @@ -25,13 +25,12 @@ public function testQueryRelatedProducts() { products(filter: {sku: {eq: "{$productSku}"}}) { - items { + items { related_products { sku name url_key - created_at } } } @@ -60,13 +59,12 @@ public function testQueryDisableRelatedProduct() { products(filter: {sku: {eq: "{$productSku}"}}) { - items { + items { related_products { sku name url_key - created_at } } } @@ -94,13 +92,12 @@ public function testQueryCrossSellProducts() { products(filter: {sku: {eq: "{$productSku}"}}) { - items { + items { crosssell_products { sku name url_key - created_at } } } @@ -119,11 +116,9 @@ public function testQueryCrossSellProducts() self::assertArrayHasKey('sku', $crossSellProduct); self::assertArrayHasKey('name', $crossSellProduct); self::assertArrayHasKey('url_key', $crossSellProduct); - self::assertArrayHasKey('created_at', $crossSellProduct); self::assertEquals($crossSellProduct['sku'], 'simple'); self::assertEquals($crossSellProduct['name'], 'Simple Cross Sell'); self::assertEquals($crossSellProduct['url_key'], 'simple-cross-sell'); - self::assertNotEmpty($crossSellProduct['created_at']); } /** @@ -137,13 +132,12 @@ public function testQueryUpSellProducts() { products(filter: {sku: {eq: "{$productSku}"}}) { - items { + items { upsell_products { sku name url_key - created_at } } } @@ -162,11 +156,9 @@ public function testQueryUpSellProducts() self::assertArrayHasKey('sku', $upSellProduct); self::assertArrayHasKey('name', $upSellProduct); self::assertArrayHasKey('url_key', $upSellProduct); - self::assertArrayHasKey('created_at', $upSellProduct); self::assertEquals($upSellProduct['sku'], 'simple'); self::assertEquals($upSellProduct['name'], 'Simple Up Sell'); self::assertEquals($upSellProduct['url_key'], 'simple-up-sell'); - self::assertNotEmpty($upSellProduct['created_at']); } /** @@ -190,14 +182,12 @@ private function assertRelatedProducts(array $relatedProducts): void self::assertArrayHasKey('sku', $product); self::assertArrayHasKey('name', $product); self::assertArrayHasKey('url_key', $product); - self::assertArrayHasKey('created_at', $product); self::assertArrayHasKey($product['sku'], $expectedData); $productExpectedData = $expectedData[$product['sku']]; self::assertEquals($product['name'], $productExpectedData['name']); self::assertEquals($product['url_key'], $productExpectedData['url_key']); - self::assertNotEmpty($product['created_at']); } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php index b2d25c7418866..e2897d6e16bfe 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php @@ -144,8 +144,6 @@ public function testQueryAllFieldsSimpleProduct() products(filter: {sku: {eq: "{$productSku}"}}) { items { - attribute_set_id - created_at id name price { @@ -194,7 +192,6 @@ public function testQueryAllFieldsSimpleProduct() } sku type_id - updated_at ... on PhysicalProductInterface { weight } @@ -281,8 +278,6 @@ private function assertBaseFields($product, $actualResponse) } // product_object_field_name, expected_value $assertionMap = [ - ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], - ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], ['response_field' => 'id', 'expected_value' => $product->getId()], ['response_field' => 'name', 'expected_value' => $product->getName()], ['response_field' => 'price', 'expected_value' => @@ -345,7 +340,6 @@ private function assertBaseFields($product, $actualResponse) ], ['response_field' => 'sku', 'expected_value' => $product->getSku()], ['response_field' => 'type_id', 'expected_value' => $product->getTypeId()], - ['response_field' => 'updated_at', 'expected_value' => $product->getUpdatedAt()], ['response_field' => 'weight', 'expected_value' => $product->getWeight()], ]; From a72c0431710c8136b185b17dea059217dee49b53 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 2 Nov 2020 14:54:37 -0600 Subject: [PATCH 090/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index bf8e9174a8216..cc23259dba58c 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -109,6 +109,7 @@ protected function tearDown(): void * Test increasing coupon usages after after order placing and decreasing after order cancellation. * * @magentoDataFixture Magento/SalesRule/_files/coupons_limited_order.php + * @magentoDbIsolation disabled */ public function testSubmitQuoteAndCancelOrder() { @@ -130,9 +131,7 @@ public function testSubmitQuoteAndCancelOrder() // Make sure coupon usages value is incremented then order is placed. $order = $this->quoteManagement->submit($quote); - - - sleep(15); // timeout to processing Magento queue + sleep(10); // timeout to processing Magento queue $this->usage->loadByCustomerCoupon($this->couponUsage, $customerId, $coupon->getId()); $coupon->loadByCode($couponCode); From 3a07a62aadbecc0abbcd1874df329a2d0a5e524d Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Mon, 2 Nov 2020 23:02:04 +0200 Subject: [PATCH 091/490] Fixed the static tests --- .../Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php index f91f4938624cf..7c7212b9b9b26 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php @@ -11,7 +11,7 @@ use Magento\TestFramework\TestCase\GraphQlAbstract; /** - * Class ProductInMultipleStoresTest + * The GraphQl test for product in multiple stores */ class ProductInMultipleStoresTest extends GraphQlAbstract { From 986ac9904fd303ddc6025caed33863a32e6e2242 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 2 Nov 2020 15:48:07 -0600 Subject: [PATCH 092/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Magento/SalesRule/Plugin/CouponUsagesTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index cc23259dba58c..e7732f742b591 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -80,7 +80,7 @@ protected function setUp(): void [ 'consumers' => $this->consumers, 'logFilePath' => TESTS_TEMP_DIR . "/MessageQueueTestLog.txt", - 'maxMessages' => null, + 'maxMessages' => 100, 'appInitParams' => Bootstrap::getInstance()->getAppInitParams() ] ); @@ -117,10 +117,7 @@ public function testSubmitQuoteAndCancelOrder() $couponCode = 'one_usage'; $reservedOrderId = 'test01'; - $binDirectory = realpath(INTEGRATION_TESTS_DIR . '/bin/'); - $magentoCli = $binDirectory . '/magento'; - $consumerStartCommand = "php {$magentoCli} queue:consumers:start sales.rule.update.coupon.usage &"; - exec($consumerStartCommand); + $this->publisherConsumerController->startConsumers(); /** @var Coupon $coupon */ $coupon = $this->objectManager->get(Coupon::class); From 4e80ef94826eb709bc5b8d96ad46f13f6fc4fe74 Mon Sep 17 00:00:00 2001 From: Chandresh Chauhan <47473360+Chandresh22@users.noreply.github.com> Date: Tue, 3 Nov 2020 16:55:35 +0530 Subject: [PATCH 093/490] Update ReviewDataProvider.php --- .../Review/Ui/DataProvider/Product/ReviewDataProvider.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index d23f4359972dc..27cb887e89636 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -89,6 +89,7 @@ public function getData() /** * @inheritdoc * @since 100.1.0 + * @return mixed|$this */ public function addFilter(\Magento\Framework\Api\Filter $filter) { @@ -107,5 +108,6 @@ public function addFilter(\Magento\Framework\Api\Filter $filter) } parent::addFilter($filter); + return $this; } } From e5918517b1e65e6036f108961986f2e38ff90efa Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Tue, 3 Nov 2020 06:35:29 -0600 Subject: [PATCH 094/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- app/code/Magento/Catalog/etc/di.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 149003104a9fd..8a116282e2578 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1319,9 +1319,4 @@ </argument> </arguments> </type> - <type name="Magento\Catalog\Model\Category\Attribute\Backend\Image"> - <arguments> - <argument name="imageUploader" xsi:type="object">Magento\Catalog\CategoryImageUpload</argument> - </arguments> - </type> </config> From 09655eb97e40757b46d6efa596294143bd0a4eea Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Tue, 3 Nov 2020 06:45:48 -0600 Subject: [PATCH 095/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index e7732f742b591..eebf5ea638d05 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -26,6 +26,7 @@ * @magentoAppArea frontend * @magentoDbIsolation enabled * @magentoAppIsolation enabled + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CouponUsagesTest extends TestCase { From 248fc8dcf1ee672141c31c1e2268abcf6d8727f5 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Tue, 3 Nov 2020 07:07:17 -0600 Subject: [PATCH 096/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...minCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 6 ++++++ .../SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 6ce9909d06be5..4c90e18b1195c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -20,6 +20,12 @@ </annotations> <before> + <!-- Start Coupon Usage Consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{SalesRuleCouponUsageConsumer.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleCouponUsageConsumer.messageLimit}}"/> + </actionGroup> + <!-- Enable Zero Subtotal Checkout --> <magentoCLI command="config:set {{EnableZeroSubtotalCheckoutConfigData.path}} {{EnableZeroSubtotalCheckoutConfigData.value}}" stepKey="enableZeroSubtotalCheckout"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml index 3dd87d94d0148..d54b9fada0f4b 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml @@ -13,4 +13,8 @@ <data key="is_primary">1</data> <data key="times_used">0</data> </entity> + <entity name="SalesRuleCouponUsageConsumer"> + <data key="consumerName">sales.rule.update.coupon.usage</data> + <data key="messageLimit">100</data> + </entity> </entities> From fbad9a1e8d953f9424bea28492e77ebc663a7e8f Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Tue, 3 Nov 2020 10:26:59 -0600 Subject: [PATCH 097/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 4c90e18b1195c..8c64918696f1f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -22,8 +22,8 @@ <before> <!-- Start Coupon Usage Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> - <argument name="consumerName" value="{{SalesRuleCouponUsageConsumer.consumerName}}"/> - <argument name="maxMessages" value="{{SalesRuleCouponUsageConsumer.messageLimit}}"/> + <argument name="consumerName" value="sales.rule.update.coupon.usage"/> + <argument name="maxMessages" value="1000"/> </actionGroup> <!-- Enable Zero Subtotal Checkout --> From 193702b275d6f812fb210ca580f03c66292ae891 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 4 Nov 2020 17:35:32 +0200 Subject: [PATCH 098/490] Fixed failed test due to ProductInterface in schema --- .../Magento/Catalog/Model/CompareListIdToMaskedListId.php | 6 +++--- .../Model/ResourceModel/Product/Compare/Item/Collection.php | 6 +++--- .../CompareListGraphQl/Model/Service/GetComparableItems.php | 2 +- .../CompareListGraphQl/Model/Service/GetCompareList.php | 2 +- app/code/Magento/CompareListGraphQl/etc/schema.graphqls | 5 ++++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php index b915ca2f18d0b..d47be505bd623 100644 --- a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php +++ b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php @@ -41,12 +41,12 @@ public function __construct( * * @param int $listId * - * @return string + * @return null|string */ - public function execute(int $listId): string + public function execute(int $listId): ?string { $listIdMask = $this->listIdMaskFactory->create(); $this->listIdMaskResource->load($listIdMask, $listId, 'list_id'); - return $listIdMask->getMaskedId() ?? ''; + return $listIdMask->getMaskedId() ?? null; } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 59ef50af74b33..7503b5fa17e4d 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -182,9 +182,9 @@ public function setListId(int $listId) * * @return int */ - public function getListId() + public function getListId(): int { - return $this->listId; + return (int)$this->listId; } /** @@ -274,7 +274,7 @@ public function _addJoinToSelect() * * @return array */ - public function getProductsByListId(int $listId) + public function getProductsByListId(int $listId): array { $select = $this->getConnection()->select()-> from( diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 2b458db70a3b9..367d37013253d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -69,7 +69,7 @@ public function __construct( * @return array * @throws GraphQlInputException */ - public function getComparableItems(int $listId, ContextInterface $context) + public function execute(int $listId, ContextInterface $context) { $items = []; $maskedListId = $this->compareListIdToMaskedListId->execute($listId); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index 5cd785368f8a6..dbd7cd9c30da2 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -60,7 +60,7 @@ public function execute(int $listId, ContextInterface $context) $maskedListId = $this->compareListIdToMaskedListId->execute($listId); return [ 'uid' => $maskedListId, - 'items' => $this->comparableItemsService->getComparableItems($listId, $context), + 'items' => $this->comparableItemsService->execute($listId, $context), 'attributes' => $this->comparableAttributesService->execute($listId, $context) ]; } diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 8634b05aa2bdb..5f643e792def3 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -3,10 +3,13 @@ type ComparableItem { uid: ID! - product: ProductInterface! + product: ComparableProduct! attributes: [ProductAttribute]! @doc(description: "Product comparable attributes") } +type ComparableProduct implements ProductInterface { +} + type ProductAttribute { code: String! @doc(description:"Attribute code") value: String! @doc(description:"Attribute display value") From 4fef4b43473d3ee4dc0fdb4a25cd29724b2bc801 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:09:12 +0300 Subject: [PATCH 099/490] Mview patch update --- .../Framework/Mview/Config/Converter.php | 2 + lib/internal/Magento/Framework/Mview/View.php | 40 +++++++--- .../Mview/View/ChangeLogBatchIterator.php | 78 +++++++++++++++++++ .../View/ChangeLogBatchIteratorInterface.php | 30 +++++++ .../Framework/Mview/View/Changelog.php | 44 ++++++++++- .../Mview/View/ChangelogInterface.php | 5 ++ .../Framework/Mview/View/Subscription.php | 64 ++++++++++++--- .../Magento/Framework/Mview/etc/mview.xsd | 2 + 8 files changed, 239 insertions(+), 26 deletions(-) create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 5c33ac150d00a..9cfa84483571c 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -28,6 +28,8 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); + $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); + $data['attribute_scope'] = $this->getAttributeValue($viewNode, 'attribute_scope'); $data['subscriptions'] = []; /** @var $childNode \DOMNode */ diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index dade475a20482..98d54044c3b8f 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -10,6 +10,7 @@ use InvalidArgumentException; use Magento\Framework\DataObject; +use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; use Exception; @@ -67,6 +68,11 @@ class View extends DataObject implements ViewInterface */ private $changelogBatchSize; + /** + * @var ChangeLogBatchIteratorInterface[] + */ + private $strategies; + /** * @param ConfigInterface $config * @param ActionFactory $actionFactory @@ -75,6 +81,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize + * @param array $strategies */ public function __construct( ConfigInterface $config, @@ -83,7 +90,8 @@ public function __construct( View\ChangelogInterface $changelog, SubscriptionFactory $subscriptionFactory, array $data = [], - array $changelogBatchSize = [] + array $changelogBatchSize = [], + array $strategies = [] ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -92,6 +100,7 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); + $this->strategies = $strategies; } /** @@ -196,7 +205,7 @@ public function load($viewId) */ public function subscribe() { - if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { + //if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { // Create changelog table $this->getChangelog()->create(); @@ -206,7 +215,7 @@ public function subscribe() // Update view state $this->getState()->setMode(View\StateInterface::MODE_ENABLED)->save(); - } + // } return $this; } @@ -240,7 +249,7 @@ public function unsubscribe() */ public function update() { - if (!$this->isIdle() || !$this->isEnabled()) { + if (!$this->isEnabled()) { return; } @@ -256,7 +265,7 @@ public function update() try { $this->getState()->setStatus(View\StateInterface::STATUS_WORKING)->save(); - $this->executeAction($action, $lastVersionId, $currentVersionId); + $this->executeAction($action, 0, 1); $this->getState()->loadByView($this->getId()); $statusToRestore = $this->getState()->getStatus() === View\StateInterface::STATUS_SUSPENDED @@ -297,13 +306,24 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); - // We run the actual indexer in batches. - // Chunked AFTER loading to avoid duplicates in separate chunks. - $chunks = array_chunk($ids, $batchSize); - foreach ($chunks as $ids) { + if (isset($this->strategies[$this->changelog->getViewId()])) { + $changelogData = [ + 'name' => $this->changelog->getName(), + 'column_name' => $this->changelog->getColumnName(), + 'view_id' => $this->changelog->getViewId() + ]; + $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); $action->execute($ids); + } else { + $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); + // We run the actual indexer in batches. + // Chunked AFTER loading to avoid duplicates in separate chunks. + $chunks = array_chunk($ids, $batchSize); + foreach ($chunks as $ids) { + $action->execute($ids); + } } + } } diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php new file mode 100644 index 0000000000000..bc4aff56b941d --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -0,0 +1,78 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\Config; +use Magento\Framework\Phrase; + +/** + * Interface \Magento\Framework\Mview\View\ChangeLogBatchIterator + * + */ +class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var Config + */ + private $mviewConfig; + + /** + * ChangeLogBatchIterator constructor. + * @param ResourceConnection $resourceConnection + * @param Config $mviewConfig + */ + public function __construct( + ResourceConnection $resourceConnection, + Config $mviewConfig + ) { + $this->resourceConnection = $resourceConnection; + $this->mviewConfig = $mviewConfig; + } + + /** + * Walk through batches + * + * @param array $changeLogData + * @param $fromVersionId + * @param int $batchSize + * @return mixed + * @throws ChangelogTableNotExistsException + */ + public function walk(array $changeLogData, $fromVersionId, int $batchSize) + { + $configuration = $this->mviewConfig->getView($changeLogData['view_id']); + $connection = $this->resourceConnection->getConnection(); + $changelogTableName = $this->resourceConnection->getTableName($changeLogData['name']); + if (!$connection->isTableExists($changelogTableName)) { + throw new ChangelogTableNotExistsException(new Phrase("Table %1 does not exist", [$changelogTableName])); + } + $columns = [$changeLogData['column_name']]; + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int)$fromVersionId + ) + ->group([$changeLogData['column_name'], 'store_id']) + ->limit($batchSize); + + $columns = [ + $changeLogData['column_name'], + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + + $select->from($changelogTableName, $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php new file mode 100644 index 0000000000000..ec225a24c2963 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\Config; +use Magento\Framework\Phrase; + +/** + * Interface \Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface + * + */ +interface ChangeLogBatchIteratorInterface +{ + /** + * Walk through batches + * + * @param array $changeLogData + * @param $fromVersionId + * @param int $batchSize + * @return mixed + * @throws ChangelogTableNotExistsException + */ + public function walk(array $changeLogData, $fromVersionId, int $batchSize); +} diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index ce88a88556fe0..88ca9cd162c67 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -7,7 +7,9 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\DB\Adapter\ConnectionException; +use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; +use Magento\Framework\Mview\Config; use Magento\Framework\Phrase; /** @@ -25,6 +27,11 @@ class Changelog implements ChangelogInterface */ const COLUMN_NAME = 'entity_id'; + /** + * Version ID column name + */ + const VERSION_ID_COLUMN_NAME = 'version_id'; + /** * Database connection * @@ -44,15 +51,24 @@ class Changelog implements ChangelogInterface */ protected $resource; + /** + * @var Config + */ + private $mviewConfig; + /** * @param \Magento\Framework\App\ResourceConnection $resource + * @param Config $mviewConfig * @throws ConnectionException */ - public function __construct(\Magento\Framework\App\ResourceConnection $resource) - { + public function __construct( + \Magento\Framework\App\ResourceConnection $resource, + Config $mviewConfig + ) { $this->connection = $resource->getConnection(); $this->resource = $resource; $this->checkConnection(); + $this->mviewConfig = $mviewConfig; } /** @@ -78,12 +94,13 @@ protected function checkConnection() */ public function create() { + $config = $this->mviewConfig->getView($this->getViewId()); $changelogTableName = $this->resource->getTableName($this->getName()); if (!$this->connection->isTableExists($changelogTableName)) { $table = $this->connection->newTable( $changelogTableName )->addColumn( - 'version_id', + self::VERSION_ID_COLUMN_NAME, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], @@ -95,6 +112,25 @@ public function create() ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Entity ID' ); + if ($config[self::ATTRIBUTE_SCOPE_SUPPORT]) { + $table->addColumn( + self::ATTRIBUTE_COLUMN, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Attribute ID' + ); + } + if ($config[self::STORE_SCOPE_SUPPORT]) { + $table->addColumn( + self::STORE_COLUMN, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Store ID' + ); + } + $this->connection->createTable($table); } } @@ -139,7 +175,7 @@ public function clear($versionId) * * @param int $fromVersionId * @param int $toVersionId - * @return int[] + * @return array * @throws ChangelogTableNotExistsException */ public function getList($fromVersionId, $toVersionId) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php index b00c1ca3a2e33..79f998cbe02b6 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php @@ -11,6 +11,11 @@ */ interface ChangelogInterface { + const ATTRIBUTE_SCOPE_SUPPORT = 'attribute_scope'; + const STORE_SCOPE_SUPPORT = 'store_scope'; + const ATTRIBUTE_COLUMN = 'attribute_id'; + const STORE_COLUMN = 'store_id'; + /** * Create changelog table * diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index ddfa39f0a089f..2b94b9c26a21d 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -6,8 +6,10 @@ namespace Magento\Framework\Mview\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Ddl\Trigger; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\StateInterface; /** @@ -68,12 +70,17 @@ class Subscription implements SubscriptionInterface * @var Resource */ protected $resource; + /** + * @var Config + */ + private $mviewConfig; /** * @param ResourceConnection $resource * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection * @param \Magento\Framework\Mview\ViewInterface $view + * @param Config $mviewConfig * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns @@ -85,7 +92,8 @@ public function __construct( \Magento\Framework\Mview\ViewInterface $view, $tableName, $columnName, - $ignoredUpdateColumns = [] + $ignoredUpdateColumns = [], + Config $mviewConfig = null ) { $this->connection = $resource->getConnection(); $this->triggerFactory = $triggerFactory; @@ -95,6 +103,7 @@ public function __construct( $this->columnName = $columnName; $this->resource = $resource; $this->ignoredUpdateColumns = $ignoredUpdateColumns; + $this->mviewConfig = $mviewConfig ?? ObjectManager::getInstance()->get(Config::class); } /** @@ -198,13 +207,10 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { + $trigger = "INSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { - case Trigger::EVENT_INSERT: - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (NEW.%s);"; - break; case Trigger::EVENT_UPDATE: $tableName = $this->resource->getTableName($this->getTableName()); - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (NEW.%s);"; if ($this->connection->isTableExists($tableName) && $describe = $this->connection->describeTable($tableName) ) { @@ -226,20 +232,54 @@ protected function buildStatement($event, $changelog) } } break; - case Trigger::EVENT_DELETE: - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (OLD.%s);"; - break; - default: - return ''; } + list($columnNames, $columnValues) = $this->prepareTriggerBody($changelog, $event); return sprintf( $trigger, $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - $this->connection->quoteIdentifier($changelog->getColumnName()), - $this->connection->quoteIdentifier($this->getColumnName()) + $columnNames, + $columnValues ); } + /** + * Prepare column names and column values for trigger body + * + * @param ChangelogInterface $changelog + * @param string $eventType + * @return array + */ + public function prepareTriggerBody(ChangelogInterface $changelog, string $eventType) + { + $prefix = $eventType === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $describedSubscribedColumns = array_column( + $this->connection->describeTable($this->getTableName()), + 'COLUMN_NAME' + ); + $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); + $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; + $columnValues = [$this->connection->quoteIdentifier($this->getColumnName())]; + //If we need to add attributes + if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && + array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) + ) { + $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); + $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); + } + //If we need to add stores + if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && + array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) + ) { + $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); + $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); + } + + return [ + implode(",", $columnNames), + implode(",", $columnValues) + ]; + } + /** * Build an "after" event for the given table and event * diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index dfff4964f6587..5b264efdf5445 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,6 +46,8 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> + <xs:attribute name="store_scope" type="xs:boolean" use="optional" /> + <xs:attribute name="attribute_scope" type="xs:boolean" use="optional" /> </xs:complexType> <xs:simpleType name="classType"> From 0d18cce39964a8c4bda4a8cd71ddcee44d8fdcba Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:16:11 +0300 Subject: [PATCH 100/490] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 98d54044c3b8f..bc795915e6f7d 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -205,7 +205,7 @@ public function load($viewId) */ public function subscribe() { - //if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { + if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { // Create changelog table $this->getChangelog()->create(); @@ -215,7 +215,7 @@ public function subscribe() // Update view state $this->getState()->setMode(View\StateInterface::MODE_ENABLED)->save(); - // } + } return $this; } From dcc2ca25d847ae84af46a362cadfe3c4ae62eccc Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:18:34 +0300 Subject: [PATCH 101/490] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index bc795915e6f7d..999c8c187735b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -249,7 +249,7 @@ public function unsubscribe() */ public function update() { - if (!$this->isEnabled()) { + if (!$this->isIdle() || !$this->isEnabled()) { return; } From a77c41ced019ec483b21faa3267186ce2cecd5de Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:20:17 +0300 Subject: [PATCH 102/490] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 999c8c187735b..3cd5f9b28bcaf 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -265,7 +265,7 @@ public function update() try { $this->getState()->setStatus(View\StateInterface::STATUS_WORKING)->save(); - $this->executeAction($action, 0, 1); + $this->executeAction($action, $lastVersionId, $currentVersionId); $this->getState()->loadByView($this->getId()); $statusToRestore = $this->getState()->getStatus() === View\StateInterface::STATUS_SUSPENDED From 6071c5a5caadf2f146395dde679f4a51cd0d5174 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Tue, 8 Sep 2020 17:24:07 +0300 Subject: [PATCH 103/490] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 1 + .../Framework/Mview/View/Changelog.php | 4 ++-- .../Framework/Mview/View/Subscription.php | 22 ++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 3cd5f9b28bcaf..1ad70aa2c33d3 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -313,6 +313,7 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int 'view_id' => $this->changelog->getViewId() ]; $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); + $vsFrom += $batchSize; $action->execute($ids); } else { $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 88ca9cd162c67..2ade739d3197c 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -117,7 +117,7 @@ public function create() self::ATTRIBUTE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], + ['unsigned' => true, 'nullable' => true], 'Attribute ID' ); } @@ -126,7 +126,7 @@ public function create() self::STORE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], + ['unsigned' => true, 'nullable' => true], 'Store ID' ); } diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 2b94b9c26a21d..460db5260f008 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -242,6 +242,15 @@ protected function buildStatement($event, $changelog) ); } + /** + * @param string $prefix + * @return string + */ + public function getEntityColumn(string $prefix): string + { + return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); + } + /** * Prepare column names and column values for trigger body * @@ -256,19 +265,26 @@ public function prepareTriggerBody(ChangelogInterface $changelog, string $eventT $this->connection->describeTable($this->getTableName()), 'COLUMN_NAME' ); + $describedClColumns = array_column( + $this->connection->describeTable($changelog->getName()), + 'COLUMN_NAME' + ); $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; - $columnValues = [$this->connection->quoteIdentifier($this->getColumnName())]; + $columnValues = [$this->getEntityColumn($prefix)]; //If we need to add attributes if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) + array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) && + array_search(Changelog::ATTRIBUTE_COLUMN, $describedClColumns) + ) { $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); } //If we need to add stores if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && - array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) + array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) && + array_search(Changelog::STORE_COLUMN, $describedClColumns) ) { $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); From 0e66e6cb6c58882704d39643b230966d8c0e7407 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Fri, 11 Sep 2020 18:00:05 +0300 Subject: [PATCH 104/490] Mview patch update -- move framework logic to saas-export --- lib/internal/Magento/Framework/Mview/View/Changelog.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 2ade739d3197c..bbfb47807d4d6 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -112,7 +112,8 @@ public function create() ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Entity ID' ); - if ($config[self::ATTRIBUTE_SCOPE_SUPPORT]) { + + if ($config && $config[self::ATTRIBUTE_SCOPE_SUPPORT]) { $table->addColumn( self::ATTRIBUTE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, @@ -121,7 +122,7 @@ public function create() 'Attribute ID' ); } - if ($config[self::STORE_SCOPE_SUPPORT]) { + if ($config && $config[self::STORE_SCOPE_SUPPORT]) { $table->addColumn( self::STORE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, From c5d8fc649a007ba2aeb359c70ceabf3947f4124b Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 16 Sep 2020 15:31:14 +0300 Subject: [PATCH 105/490] Mview patch update -- move framework logic to saas-export --- .../Magento/Eav/Model/Mview/BatchIterator.php | 67 +++++++++++++ .../Framework/Mview/Config/Converter.php | 30 +++++- .../Mview/Test/Unit/View/ChangelogTest.php | 22 ++++- .../Mview/Test/Unit/View/SubscriptionTest.php | 37 +++++--- lib/internal/Magento/Framework/Mview/View.php | 66 +++++-------- .../AdditionalColumnProcessorInterface.php | 39 ++++++++ .../DefaultProcessor.php | 73 +++++++++++++++ .../Mview/View/ChangeLogBatchIterator.php | 44 +++------ .../View/ChangeLogBatchIteratorInterface.php | 8 +- .../Framework/Mview/View/Changelog.php | 47 ++++++---- .../Framework/Mview/View/Subscription.php | 93 +++++++++---------- .../Magento/Framework/Mview/etc/mview.xsd | 18 +++- 12 files changed, 381 insertions(+), 163 deletions(-) create mode 100644 app/code/Magento/Eav/Model/Mview/BatchIterator.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php diff --git a/app/code/Magento/Eav/Model/Mview/BatchIterator.php b/app/code/Magento/Eav/Model/Mview/BatchIterator.php new file mode 100644 index 0000000000000..b7dd69abd45ff --- /dev/null +++ b/app/code/Magento/Eav/Model/Mview/BatchIterator.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Eav\Mview; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; +use Magento\Framework\Mview\View\ChangelogInterface; +use Magento\Framework\Mview\View\ChangelogTableNotExistsException; +use Magento\Framework\Phrase; + +/** + * Class BatchIterator + */ +class BatchIterator implements ChangeLogBatchIteratorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct( + ResourceConnection $resourceConnection + ) { + $this->resourceConnection = $resourceConnection; + } + + /** + * @inheritdoc + */ + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + { + $connection = $this->resourceConnection->getConnection(); + if (!$connection->isTableExists($changelog->getName())) { + throw new ChangelogTableNotExistsException( + new Phrase("Table %1 does not exist", [$changelog->getName()]) + ); + } + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int)$fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion + ) + ->group([$changelog->getColumnName(), 'store_id']) + ->limit($batchSize); + + $columns = [ + $changelog->getColumnName(), + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + + $select->from($changelog->getName(), $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 9cfa84483571c..2737f8db84b7c 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -29,7 +29,7 @@ public function convert($source) $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); - $data['attribute_scope'] = $this->getAttributeValue($viewNode, 'attribute_scope'); + $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator'); $data['subscriptions'] = []; /** @var $childNode \DOMNode */ @@ -78,6 +78,7 @@ protected function convertChild(\DOMNode $childNode, $data) $name = $this->getAttributeValue($subscription, 'name'); $column = $this->getAttributeValue($subscription, 'entity_column'); $subscriptionModel = $this->getAttributeValue($subscription, 'subscription_model'); + if (!empty($subscriptionModel) && !in_array( SubscriptionInterface::class, @@ -91,11 +92,36 @@ class_implements(ltrim($subscriptionModel, '\\')) $data['subscriptions'][$name] = [ 'name' => $name, 'column' => $column, - 'subscription_model' => $subscriptionModel + 'subscription_model' => $subscriptionModel, + 'additional_columns' => $this->getAdditionalColumns($subscription), + 'processor' => $this->getAttributeValue($subscription, 'processor') ]; } break; } return $data; } + + /** + * Retrieve additional columns of subscription table + * + * @param \DOMNode $subscription + * @return array + */ + private function getAdditionalColumns(\DOMNode $subscription): array + { + $additionalColumns = []; + foreach ($subscription->childNodes as $childNode) { + if ($childNode->nodeType != XML_ELEMENT_NODE || $childNode->nodeName != 'additionalColumns') { + continue; + } + + $additionalColumns[] = [ + 'name' => $this->getAttributeValue($childNode, 'name'), + 'cl_name' => $this->getAttributeValue($childNode, 'cl_name'), + ]; + } + + return $additionalColumns; + } } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 0a4e8a3840749..2642bf20bc6d6 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\DB\Select; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\Changelog; use Magento\Framework\Mview\View\ChangelogInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -46,7 +47,22 @@ protected function setUp(): void $this->resourceMock = $this->createMock(ResourceConnection::class); $this->mockGetConnection($this->connectionMock); - $this->model = new Changelog($this->resourceMock); + $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock()); + } + + /** + * @return Config|MockObject + */ + private function getMviewConfigMock() + { + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'attribute_scope' => false, + 'store_scope' => false + ]); + return $mviewConfigMock; } public function testInstanceOf() @@ -54,7 +70,7 @@ public function testInstanceOf() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(true); - $model = new Changelog($resourceMock); + $model = new Changelog($resourceMock, $this->getMviewConfigMock()); $this->assertInstanceOf(ChangelogInterface::class, $model); } @@ -65,7 +81,7 @@ public function testCheckConnectionException() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(null); - $model = new Changelog($resourceMock); + $model = new Changelog($resourceMock, $this->getMviewConfigMock()); $model->setViewId('ViewIdTest'); $this->assertNull($model); } 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..559309c10c27c 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Trigger; use Magento\Framework\DB\Ddl\TriggerFactory; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\ChangelogInterface; use Magento\Framework\Mview\View\CollectionInterface; use Magento\Framework\Mview\View\StateInterface; @@ -55,6 +56,10 @@ protected function setUp(): void ->method('quoteIdentifier') ->willReturnArgument(0); + $this->connectionMock->expects($this->any()) + ->method('describeTable') + ->willReturn([]); + $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); @@ -78,18 +83,29 @@ protected function setUp(): void true, [] ); - + $this->viewMock->expects($this->any()) + ->method('getId') + ->willReturn(1); $this->resourceMock->expects($this->any()) ->method('getTableName') ->willReturnArgument(0); - + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'attribute_scope' => false, + 'store_scope' => false + ]); + $this->mviewConfig = $mviewConfigMock; $this->model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, $this->viewCollectionMock, $this->viewMock, $this->tableName, - 'columnName' + 'columnName', + [], + $mviewConfigMock ); } @@ -122,7 +138,7 @@ public function testCreate() $triggerMock->expects($this->exactly(3)) ->method('setName') ->with($triggerName)->willReturnSelf(); - $triggerMock->expects($this->exactly(3)) + $triggerMock->expects($this->any()) ->method('getName') ->willReturn('triggerName'); $triggerMock->expects($this->exactly(3)) @@ -167,7 +183,7 @@ public function testCreate() true, [] ); - $changelogMock->expects($this->exactly(3)) + $changelogMock->expects($this->any()) ->method('getName') ->willReturn('test_view_cl'); $changelogMock->expects($this->exactly(3)) @@ -191,7 +207,7 @@ public function testCreate() true, [] ); - $otherChangelogMock->expects($this->exactly(3)) + $otherChangelogMock->expects($this->any()) ->method('getName') ->willReturn('other_test_view_cl'); $otherChangelogMock->expects($this->exactly(3)) @@ -217,7 +233,7 @@ public function testCreate() ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->exactly(3)) + $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); $this->viewMock->expects($this->never()) @@ -235,7 +251,6 @@ public function testCreate() $this->connectionMock->expects($this->exactly(3)) ->method('createTrigger') ->with($triggerMock); - $this->model->create(); } @@ -244,7 +259,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)) @@ -271,7 +286,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)) @@ -297,7 +312,7 @@ public function testRemove() ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->exactly(3)) + $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); $this->viewMock->expects($this->never()) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 1ad70aa2c33d3..ac80004068236 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -9,6 +9,7 @@ namespace Magento\Framework\Mview; use InvalidArgumentException; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; @@ -28,11 +29,6 @@ class View extends DataObject implements ViewInterface */ const DEFAULT_BATCH_SIZE = 1000; - /** - * Max versions to load from database at a time - */ - private static $maxVersionQueryBatch = 100000; - /** * @var string */ @@ -306,52 +302,38 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - if (isset($this->strategies[$this->changelog->getViewId()])) { - $changelogData = [ - 'name' => $this->changelog->getName(), - 'column_name' => $this->changelog->getColumnName(), - 'view_id' => $this->changelog->getViewId() - ]; - $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); - $vsFrom += $batchSize; - $action->execute($ids); - } else { - $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); - // We run the actual indexer in batches. - // Chunked AFTER loading to avoid duplicates in separate chunks. - $chunks = array_chunk($ids, $batchSize); - foreach ($chunks as $ids) { - $action->execute($ids); - } - } - + $iterator = $this->createIterator(); + $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + $vsFrom += $batchSize; + $action->execute($ids); } } /** - * Get batch of entity ids + * Create and validate iterator class for changelog * - * @param int $lastVersionId - * @param int $currentVersionId - * @return array + * @return ChangeLogBatchIteratorInterface|mixed + * @throws Exception */ - private function getBatchOfIds(int &$lastVersionId, int $currentVersionId): array + private function createIterator() { - $ids = []; - $versionBatchSize = self::$maxVersionQueryBatch; - $idsBatchSize = self::$maxVersionQueryBatch; - for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { - // Don't go past the current version for atomicity. - $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); - /** To avoid duplicate ids need to flip and merge the array */ - $ids += array_flip($this->getChangelog()->getList($vsFrom, $versionTo)); - $lastVersionId = $versionTo; - if (count($ids) >= $idsBatchSize) { - break; - } + $config = $this->config->getView($this->changelog->getViewId()); + $iteratorClass = $config['iterator']; + + if (!class_exists($iteratorClass)) { + throw new \Exception('Iterator class does not exist for view: ' . $this->changelog->getViewId()); + } + + $iterator = ObjectManager::getInstance()->get($iteratorClass); + + if (!$iterator instanceof ChangeLogBatchIteratorInterface) { + throw new \Exception( + 'Iterator does not implement the right interface for view: ' . + $this->changelog->getViewId() + ); } - return array_keys($ids); + return $iterator; } /** diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php new file mode 100644 index 0000000000000..6a38437c5a848 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\DB\Ddl\Table; +use Magento\Tests\NamingConvention\true\string; + +interface AdditionalColumnProcessorInterface +{ + /** + * Return triggers columns that should participate in trigger creation + * + * @param string $eventPrefix + * @param array $additionalColumns + * @return array + */ + public function getTriggerColumns(string $eventPrefix, array $additionalColumns): array ; + + /** + * Process column for DDL table + * + * @param Table $table + * @param string $columnName + * @return void + */ + public function processColumnForCLTable(Table $table, string $columnName): void ; + + /** + * Retrieve pre-statement for trigger + * For instance DQL + * + * @return string + */ + public function getPreStatements(): string; +} diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php new file mode 100644 index 0000000000000..3733e7a9499b3 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View\AdditionalColumnsProcessor; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Ddl\Table; +use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; +use Magento\Tests\NamingConvention\true\string; + +class DefaultProcessor implements AdditionalColumnProcessorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct( + ResourceConnection $resourceConnection + ) { + $this->resourceConnection = $resourceConnection; + } + + /** + * @inheritDoc + */ + public function getTriggerColumns(string $eventPrefix, array $additionalColumns): array + { + $resource = $this->resourceConnection->getConnection(); + $triggersColumns = [ + 'column_names' => [], + 'column_values' => [] + ]; + + foreach ($additionalColumns as $additionalColumn) { + $triggersColumns['column_names'][$additionalColumn['name']] = $resource->quoteIdentifier( + $additionalColumn['cl_name'] + ); + $triggersColumns['column_values'][$additionalColumn['name']] = $eventPrefix . + $resource->quoteIdentifier($additionalColumn['name']); + } + + return $triggersColumns; + } + + /** + * @return string + */ + public function getPreStatements(): string + { + return ''; + } + + /** + * @inheritDoc + */ + public function processColumnForCLTable(Table $table, string $columnName): void + { + $table->addColumn( + $columnName, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => null], + $columnName + ); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php index bc4aff56b941d..9165fc4a0d3cc 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -8,7 +8,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Sql\Expression; -use Magento\Framework\Mview\Config; use Magento\Framework\Phrase; /** @@ -23,56 +22,39 @@ class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface private $resourceConnection; /** - * @var Config - */ - private $mviewConfig; - - /** - * ChangeLogBatchIterator constructor. * @param ResourceConnection $resourceConnection - * @param Config $mviewConfig */ public function __construct( - ResourceConnection $resourceConnection, - Config $mviewConfig + ResourceConnection $resourceConnection ) { $this->resourceConnection = $resourceConnection; - $this->mviewConfig = $mviewConfig; } /** - * Walk through batches - * - * @param array $changeLogData - * @param $fromVersionId - * @param int $batchSize - * @return mixed - * @throws ChangelogTableNotExistsException + * @inheritdoc */ - public function walk(array $changeLogData, $fromVersionId, int $batchSize) + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) { - $configuration = $this->mviewConfig->getView($changeLogData['view_id']); $connection = $this->resourceConnection->getConnection(); - $changelogTableName = $this->resourceConnection->getTableName($changeLogData['name']); + $changelogTableName = $this->resourceConnection->getTableName($changelog->getName()); + if (!$connection->isTableExists($changelogTableName)) { throw new ChangelogTableNotExistsException(new Phrase("Table %1 does not exist", [$changelogTableName])); } - $columns = [$changeLogData['column_name']]; + $select = $connection->select()->distinct(true) ->where( 'version_id > ?', - (int)$fromVersionId + $fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion ) - ->group([$changeLogData['column_name'], 'store_id']) + ->group([$changelog->getColumnName()]) ->limit($batchSize); - $columns = [ - $changeLogData['column_name'], - 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), - 'store_id' - ]; - - $select->from($changelogTableName, $columns); + $select->from($changelogTableName, [$changelog->getColumnName()]); return $connection->fetchAll($select); } } diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php index ec225a24c2963..5e86e0753aec9 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php @@ -20,11 +20,11 @@ interface ChangeLogBatchIteratorInterface /** * Walk through batches * - * @param array $changeLogData - * @param $fromVersionId + * @param ChangelogInterface $changelog + * @param int $fromVersionId + * @param int $lastVersionId * @param int $batchSize * @return mixed - * @throws ChangelogTableNotExistsException */ - public function walk(array $changeLogData, $fromVersionId, int $batchSize); + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $lastVersionId, int $batchSize); } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index bbfb47807d4d6..3bbd14bf19fbe 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -28,7 +28,7 @@ class Changelog implements ChangelogInterface const COLUMN_NAME = 'entity_id'; /** - * Version ID column name + * Column name for Version ID */ const VERSION_ID_COLUMN_NAME = 'version_id'; @@ -94,7 +94,6 @@ protected function checkConnection() */ public function create() { - $config = $this->mviewConfig->getView($this->getViewId()); $changelogTableName = $this->resource->getTableName($this->getName()); if (!$this->connection->isTableExists($changelogTableName)) { $table = $this->connection->newTable( @@ -113,29 +112,39 @@ public function create() 'Entity ID' ); - if ($config && $config[self::ATTRIBUTE_SCOPE_SUPPORT]) { - $table->addColumn( - self::ATTRIBUTE_COLUMN, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => true], - 'Attribute ID' - ); - } - if ($config && $config[self::STORE_SCOPE_SUPPORT]) { - $table->addColumn( - self::STORE_COLUMN, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => true], - 'Store ID' - ); + foreach ($this->initAdditionalColumnData() as $columnData) { + /** @var AdditionalColumnProcessorInterface $processor */ + $processor = $columnData['processor']; + $processor->processColumnForCLTable($table, $columnData['cl_name']); } $this->connection->createTable($table); } } + /** + * Retrieve additional column data + * + * @return array + * @throws \Exception + */ + private function initAdditionalColumnData(): array + { + $config = $this->mviewConfig->getView($this->getViewId()); + $additionalColumns = []; + + foreach ($config['subscriptions'] as $subscription) { + if (isset($subscription['additional_columns'])) { + foreach ($subscription['additional_columns'] as $additionalColumn) { + //We are gatherig unique change log column names in order to create them later + $additionalColumns[$additionalColumn['cl_name']] = $additionalColumn; + } + } + } + + return $additionalColumns; + } + /** * Drop changelog table * diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 460db5260f008..e68e928bd9229 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -80,10 +80,10 @@ class Subscription implements SubscriptionInterface * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection * @param \Magento\Framework\Mview\ViewInterface $view - * @param Config $mviewConfig * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns + * @param Config|null $mviewConfig */ public function __construct( ResourceConnection $resource, @@ -207,7 +207,9 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (%s);"; + $processor = $this->getProcessor(); + $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { case Trigger::EVENT_UPDATE: $tableName = $this->resource->getTableName($this->getTableName()); @@ -233,67 +235,60 @@ protected function buildStatement($event, $changelog) } break; } - list($columnNames, $columnValues) = $this->prepareTriggerBody($changelog, $event); + + $columns = [ + 'column_names' => [ + 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) + ], + 'column_values' => [ + 'entity_id' => $this->getEntityColumn($prefix) + ] + ]; + + if (isset($subscriptionData['additional_columns'])) { + $columns = array_replace_recursive( + $columns, + $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) + ); + } + return sprintf( $trigger, + $processor->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - $columnNames, - $columnValues + implode(", " , $columns['column_names']), + implode(", ", $columns['column_values']) ); } /** - * @param string $prefix - * @return string + * Instantiate and retrieve additional columns processor + * + * @return AdditionalColumnProcessorInterface + * @throws \Exception */ - public function getEntityColumn(string $prefix): string + private function getProcessor(): AdditionalColumnProcessorInterface { - return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); + $subscriptionData = $this->mviewConfig->getView($this->getView()->getId())['subscriptions']; + $processorClass = $subscriptionData['processor']; + $processor = ObjectManager::getInstance()->get($processorClass); + + if (!$processor instanceof AdditionalColumnProcessorInterface) { + throw new \Exception( + 'Processor should implements ' . AdditionalColumnProcessorInterface::class + ); + } + + return $processor; } /** - * Prepare column names and column values for trigger body - * - * @param ChangelogInterface $changelog - * @param string $eventType - * @return array + * @param string $prefix + * @return string */ - public function prepareTriggerBody(ChangelogInterface $changelog, string $eventType) + public function getEntityColumn(string $prefix): string { - $prefix = $eventType === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; - $describedSubscribedColumns = array_column( - $this->connection->describeTable($this->getTableName()), - 'COLUMN_NAME' - ); - $describedClColumns = array_column( - $this->connection->describeTable($changelog->getName()), - 'COLUMN_NAME' - ); - $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); - $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; - $columnValues = [$this->getEntityColumn($prefix)]; - //If we need to add attributes - if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedClColumns) - - ) { - $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); - $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); - } - //If we need to add stores - if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && - array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) && - array_search(Changelog::STORE_COLUMN, $describedClColumns) - ) { - $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); - $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); - } - - return [ - implode(",", $columnNames), - implode(",", $columnValues) - ]; + return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); } /** diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index 5b264efdf5445..ada98d87d5ca3 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,8 +46,7 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> - <xs:attribute name="store_scope" type="xs:boolean" use="optional" /> - <xs:attribute name="attribute_scope" type="xs:boolean" use="optional" /> + <xs:attribute name="iterator" type="classType" default="Magento\Framework\Mview\View\LegacyChangeLogBatchIterator" /> </xs:complexType> <xs:simpleType name="classType"> @@ -78,9 +77,24 @@ Table declaration. </xs:documentation> </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" name="additionalColumns" type="additionalColumnsType" /> + </xs:sequence> <xs:attribute name="name" type="tableNameType" use="required" /> <xs:attribute name="entity_column" type="entityColumnType" use="required" /> <xs:attribute name="subscription_model" type="subscriptionModelType" /> + <xs:attribute name="processor" type="classType" default="Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor" /> + </xs:complexType> + + <xs:complexType name="additionalColumnsType"> + <xs:sequence> + <xs:element minOccurs="1" maxOccurs="unbounded" name="column" type="additionalColumnAttributeType" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="additionalColumnAttributeType"> + <xs:attribute name="name" type="xs:string" /> + <xs:attribute name="cl_name" type="xs:string" /> </xs:complexType> <xs:simpleType name="entityColumnType"> From b1a759237f1b3030ff47483cbd2eb6732207d449 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 15:12:11 +0300 Subject: [PATCH 106/490] Mview patch update -- move framework logic to saas-export --- .../Framework/Mview/Config/Converter.php | 42 ++++++++++++-- .../AdditionalColumnProcessorInterface.php | 1 - .../DefaultProcessor.php | 11 ++-- .../Framework/Mview/View/Changelog.php | 5 +- .../Framework/Mview/View/Subscription.php | 56 ++++++++++++------- .../Magento/Framework/Mview/etc/mview.xsd | 1 + 6 files changed, 83 insertions(+), 33 deletions(-) rename lib/internal/Magento/Framework/Mview/View/{AdditionalColumnsProcessors => AdditionalColumnsProcessor}/DefaultProcessor.php (83%) diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 2737f8db84b7c..f63766d729d5d 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -5,10 +5,34 @@ */ namespace Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; +use Magento\Framework\Mview\View\ChangeLogBatchIterator; use Magento\Framework\Mview\View\SubscriptionInterface; class Converter implements \Magento\Framework\Config\ConverterInterface { + /** + * @var string + */ + private $defaultProcessor; + + /** + * @var string + */ + private $defaultIterator; + + /** + * @param string $defaultProcessor + * @param string $defaultIterator + */ + public function __construct( + string $defaultProcessor = DefaultProcessor::class, + string $defaultIterator = ChangeLogBatchIterator::class + ) { + $this->defaultProcessor = $defaultProcessor; + $this->defaultIterator = $defaultIterator; + } + /** * Convert dom node tree to array * @@ -29,7 +53,7 @@ public function convert($source) $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); - $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator'); + $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; $data['subscriptions'] = []; /** @var $childNode \DOMNode */ @@ -95,6 +119,7 @@ class_implements(ltrim($subscriptionModel, '\\')) 'subscription_model' => $subscriptionModel, 'additional_columns' => $this->getAdditionalColumns($subscription), 'processor' => $this->getAttributeValue($subscription, 'processor') + ?: $this->defaultProcessor ]; } break; @@ -116,10 +141,17 @@ private function getAdditionalColumns(\DOMNode $subscription): array continue; } - $additionalColumns[] = [ - 'name' => $this->getAttributeValue($childNode, 'name'), - 'cl_name' => $this->getAttributeValue($childNode, 'cl_name'), - ]; + foreach ($childNode->childNodes as $columnNode) { + if ($columnNode->nodeName !== 'column') { + continue; + } + + $additionalColumns[$this->getAttributeValue($columnNode, 'name')] = [ + 'name' => $this->getAttributeValue($columnNode, 'name'), + 'cl_name' => $this->getAttributeValue($columnNode, 'cl_name'), + 'constant' => $this->getAttributeValue($columnNode, 'constant'), + ]; + } } return $additionalColumns; diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php index 6a38437c5a848..c89fbce074a13 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php @@ -7,7 +7,6 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\DB\Ddl\Table; -use Magento\Tests\NamingConvention\true\string; interface AdditionalColumnProcessorInterface { diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php similarity index 83% rename from lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php rename to lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php index 3733e7a9499b3..96d9865998131 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php @@ -9,7 +9,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; -use Magento\Tests\NamingConvention\true\string; class DefaultProcessor implements AdditionalColumnProcessorInterface { @@ -42,8 +41,10 @@ public function getTriggerColumns(string $eventPrefix, array $additionalColumns) $triggersColumns['column_names'][$additionalColumn['name']] = $resource->quoteIdentifier( $additionalColumn['cl_name'] ); - $triggersColumns['column_values'][$additionalColumn['name']] = $eventPrefix . - $resource->quoteIdentifier($additionalColumn['name']); + + $triggersColumns['column_values'][$additionalColumn['name']] = isset($additionalColumn['constant']) ? + $resource->quote($additionalColumn['constant']) : + $eventPrefix . $resource->quoteIdentifier($additionalColumn['name']); } return $triggersColumns; @@ -64,9 +65,9 @@ public function processColumnForCLTable(Table $table, string $columnName): void { $table->addColumn( $columnName, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, null, - ['unsigned' => true, 'nullable' => false, 'default' => null], + ['unsigned' => true, 'nullable' => true, 'default' => null], $columnName ); } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 3bbd14bf19fbe..df4e55fe54850 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Mview\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\ConnectionException; use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; @@ -114,7 +115,8 @@ public function create() foreach ($this->initAdditionalColumnData() as $columnData) { /** @var AdditionalColumnProcessorInterface $processor */ - $processor = $columnData['processor']; + $processorClass = $columnData['processor']; + $processor = ObjectManager::getInstance()->get($processorClass); $processor->processColumnForCLTable($table, $columnData['cl_name']); } @@ -138,6 +140,7 @@ private function initAdditionalColumnData(): array foreach ($subscription['additional_columns'] as $additionalColumn) { //We are gatherig unique change log column names in order to create them later $additionalColumns[$additionalColumn['cl_name']] = $additionalColumn; + $additionalColumns[$additionalColumn['cl_name']]['processor'] = $subscription['processor']; } } } diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index e68e928bd9229..79d31e2a76d69 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -198,6 +198,38 @@ protected function getLinkedViews() return $this->linkedViews; } + /** + * Prepare columns for trigger statement. Should be protected in order to serve new approach + * + * @param ChangelogInterface $changelog + * @param string $event + * @return array + * @throws \Exception + */ + protected function prepareColumns(ChangelogInterface $changelog, string $event): array + { + $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $subscriptionData = $this->mviewConfig->getView($changelog->getViewId())['subscriptions'][$this->getTableName()]; + $columns = [ + 'column_names' => [ + 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) + ], + 'column_values' => [ + 'entity_id' => $this->getEntityColumn($prefix) + ] + ]; + + if (!empty($subscriptionData['additional_columns'])) { + $processor = $this->getProcessor(); + $columns = array_replace_recursive( + $columns, + $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) + ); + } + + return $columns; + } + /** * Build trigger statement for INSERT, UPDATE, DELETE events * @@ -207,8 +239,6 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { - $processor = $this->getProcessor(); - $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { case Trigger::EVENT_UPDATE: @@ -235,26 +265,10 @@ protected function buildStatement($event, $changelog) } break; } - - $columns = [ - 'column_names' => [ - 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) - ], - 'column_values' => [ - 'entity_id' => $this->getEntityColumn($prefix) - ] - ]; - - if (isset($subscriptionData['additional_columns'])) { - $columns = array_replace_recursive( - $columns, - $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) - ); - } - + $columns = $this->prepareColumns($changelog, $event); return sprintf( $trigger, - $processor->getPreStatements(), + $this->getProcessor()->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), implode(", " , $columns['column_names']), implode(", ", $columns['column_values']) @@ -270,7 +284,7 @@ protected function buildStatement($event, $changelog) private function getProcessor(): AdditionalColumnProcessorInterface { $subscriptionData = $this->mviewConfig->getView($this->getView()->getId())['subscriptions']; - $processorClass = $subscriptionData['processor']; + $processorClass = $subscriptionData[$this->getTableName()]['processor']; $processor = ObjectManager::getInstance()->get($processorClass); if (!$processor instanceof AdditionalColumnProcessorInterface) { diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index ada98d87d5ca3..053d1b2853f66 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -95,6 +95,7 @@ <xs:complexType name="additionalColumnAttributeType"> <xs:attribute name="name" type="xs:string" /> <xs:attribute name="cl_name" type="xs:string" /> + <xs:attribute name="constant" type="xs:string" /> </xs:complexType> <xs:simpleType name="entityColumnType"> From 7237a30eaa00c12008bc159f034bfcd07c183193 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 17:47:32 +0300 Subject: [PATCH 107/490] Mview patch update -- move framework logic to saas-export --- .../Magento/Framework/Mview/View/ChangeLogBatchIterator.php | 2 +- lib/internal/Magento/Framework/Mview/View/Changelog.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php index 9165fc4a0d3cc..f3ae87b847cb1 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -55,6 +55,6 @@ public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toV ->limit($batchSize); $select->from($changelogTableName, [$changelog->getColumnName()]); - return $connection->fetchAll($select); + return $connection->fetchCol($select); } } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index df4e55fe54850..94ce4c19874ce 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -135,6 +135,10 @@ private function initAdditionalColumnData(): array $config = $this->mviewConfig->getView($this->getViewId()); $additionalColumns = []; + if (!$config) { + return $additionalColumns; + } + foreach ($config['subscriptions'] as $subscription) { if (isset($subscription['additional_columns'])) { foreach ($subscription['additional_columns'] as $additionalColumn) { From 99133052528df4752db1f582bb79e3c83250db46 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 18:31:16 +0300 Subject: [PATCH 108/490] Mview patch update -- move framework logic to saas-export --- .../Framework/Mview/Config/Converter.php | 1 - .../Mview/Test/Unit/View/ChangelogTest.php | 3 +- .../Mview/Test/Unit/View/SubscriptionTest.php | 15 +++++-- .../Framework/Mview/Test/Unit/ViewTest.php | 41 +++++++++++-------- .../Mview/Test/Unit/_files/mview_config.php | 9 +++- lib/internal/Magento/Framework/Mview/View.php | 23 +++++++---- 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index f63766d729d5d..bb15287f9482a 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -52,7 +52,6 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); - $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; $data['subscriptions'] = []; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 2642bf20bc6d6..4af3f65be6883 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -59,8 +59,7 @@ private function getMviewConfigMock() $mviewConfigMock->expects($this->any()) ->method('getView') ->willReturn([ - 'attribute_scope' => false, - 'store_scope' => false + 'subscriptions' => [] ]); return $mviewConfigMock; } 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 559309c10c27c..2178009eda436 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -7,11 +7,13 @@ namespace Magento\Framework\Mview\Test\Unit\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Trigger; use Magento\Framework\DB\Ddl\TriggerFactory; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; use Magento\Framework\Mview\View\ChangelogInterface; use Magento\Framework\Mview\View\CollectionInterface; use Magento\Framework\Mview\View\StateInterface; @@ -49,6 +51,7 @@ class SubscriptionTest extends TestCase protected function setUp(): void { + $this->tableName = 'test_table'; $this->connectionMock = $this->createMock(Mysql::class); $this->resourceMock = $this->createMock(ResourceConnection::class); @@ -63,7 +66,10 @@ protected function setUp(): void $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); - + ObjectManager::getInstance()->expects($this->any()) + ->method('get') + ->with(DefaultProcessor::class) + ->willReturn(2); $this->triggerFactoryMock = $this->createMock(TriggerFactory::class); $this->viewCollectionMock = $this->getMockForAbstractClass( CollectionInterface::class, @@ -93,8 +99,11 @@ protected function setUp(): void $mviewConfigMock->expects($this->any()) ->method('getView') ->willReturn([ - 'attribute_scope' => false, - 'store_scope' => false + 'subscriptions' => [ + $this->tableName => [ + 'processor' => DefaultProcessor::class + ] + ] ]); $this->mviewConfig = $mviewConfigMock; $this->model = new Subscription( diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php index 7d69ff43f158b..8d460ac99a46b 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -7,6 +7,7 @@ namespace Magento\Framework\Mview\Test\Unit; +use Laminas\Log\Filter\Mock; use Magento\Framework\Mview\ActionFactory; use Magento\Framework\Mview\ActionInterface; use Magento\Framework\Mview\ConfigInterface; @@ -53,6 +54,11 @@ class ViewTest extends TestCase */ protected $subscriptionFactoryMock; + /** + * @var MockObject|View\ChangeLogBatchIteratorInterface + */ + private $iteratorMock; + /** * @inheritdoc */ @@ -67,6 +73,7 @@ protected function setUp(): void true, ['getView'] ); + $this->iteratorMock = $this->createMock(View\ChangeLogBatchIteratorInterface::class); $this->actionFactoryMock = $this->createPartialMock(ActionFactory::class, ['get']); $this->stateMock = $this->createPartialMock( State::class, @@ -97,7 +104,10 @@ protected function setUp(): void $this->actionFactoryMock, $this->stateMock, $this->changelogMock, - $this->subscriptionFactoryMock + $this->subscriptionFactoryMock, + [], + [], + $this->iteratorMock ); } @@ -334,7 +344,7 @@ public function testUpdate() $currentVersionId ); $this->changelogMock->expects( - $this->once() + $this->any() )->method( 'getList' )->with( @@ -345,6 +355,7 @@ public function testUpdate() ); $actionMock = $this->getMockForAbstractClass(ActionInterface::class); + $this->iteratorMock->expects($this->once())->method('walk')->willReturn($listId); $actionMock->expects($this->once())->method('execute')->with($listId)->willReturnSelf(); $this->actionFactoryMock->expects( $this->once() @@ -390,7 +401,7 @@ public function testUpdateEx(): void ->expects($this->once()) ->method('getVersion') ->willReturn($currentVersionId); - + $this->iteratorMock->expects($this->any())->method('walk')->willReturn($this->generateChangeLog(150, 1, 150)); $this->changelogMock->method('getList') ->willReturnMap( [ @@ -401,7 +412,7 @@ public function testUpdateEx(): void ); $actionMock = $this->getMockForAbstractClass(ActionInterface::class); - $actionMock->expects($this->once()) + $actionMock->expects($this->any()) ->method('execute') ->with($this->generateChangeLog(150, 1, 150)) ->willReturnSelf(); @@ -457,7 +468,7 @@ public function testUpdateWithException() $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') ->willReturn(StateInterface::MODE_ENABLED); - $this->stateMock->expects($this->exactly(2)) + $this->stateMock->expects($this->any()) ->method('getStatus') ->willReturn(StateInterface::STATUS_IDLE); $this->stateMock->expects($this->exactly(2)) @@ -472,16 +483,9 @@ public function testUpdateWithException() )->willReturn( $currentVersionId ); - $this->changelogMock->expects( - $this->once() - )->method( - 'getList' - )->with( - $lastVersionId, - $currentVersionId - )->willReturn( - $listId - ); + $this->iteratorMock->expects($this->any()) + ->method('walk') + ->willReturn([2,3]); $actionMock = $this->createPartialMock(ActionInterface::class, ['execute']); $actionMock->expects($this->once())->method('execute')->with($listId)->willReturnCallback( @@ -767,8 +771,11 @@ public function testGetUpdated() protected function loadView() { $viewId = 'view_test'; + $this->changelogMock->expects($this->any()) + ->method('getViewId') + ->willReturn($viewId); $this->configMock->expects( - $this->once() + $this->any() )->method( 'getView' )->with( @@ -788,7 +795,7 @@ protected function getViewData() 'view_id' => 'view_test', 'action_class' => 'Some\Class\Name', 'group' => 'some_group', - 'subscriptions' => ['some_entity' => ['name' => 'some_entity', 'column' => 'entity_id']] + 'subscriptions' => ['some_entity' => ['name' => 'some_entity', 'column' => 'entity_id']], ]; } } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php index a19f90546bac3..36e7dca899047 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php @@ -20,14 +20,19 @@ 'some_entity' => [ 'name' => 'some_entity', 'column' => 'entity_id', - 'subscription_model' => null + 'subscription_model' => null, + 'additional_columns' => [], + 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], 'some_product_relation' => [ 'name' => 'some_product_relation', 'column' => 'product_id', - 'subscription_model' => null + 'subscription_model' => null, + 'additional_columns' => [], + 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], ], + 'iterator' => \Magento\Framework\Mview\View\ChangeLogBatchIterator::class ], ] ]; diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index ac80004068236..fe8f4c675284b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -11,6 +11,7 @@ use InvalidArgumentException; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; +use Magento\Framework\Mview\View\ChangeLogBatchIterator; use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; @@ -65,9 +66,9 @@ class View extends DataObject implements ViewInterface private $changelogBatchSize; /** - * @var ChangeLogBatchIteratorInterface[] + * @var ChangeLogBatchIteratorInterface */ - private $strategies; + private $iterator; /** * @param ConfigInterface $config @@ -77,7 +78,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize - * @param array $strategies + * @param ChangeLogBatchIteratorInterface|null $changeLogBatchIterator */ public function __construct( ConfigInterface $config, @@ -87,7 +88,7 @@ public function __construct( SubscriptionFactory $subscriptionFactory, array $data = [], array $changelogBatchSize = [], - array $strategies = [] + ChangeLogBatchIteratorInterface $changeLogBatchIterator = null ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -96,7 +97,7 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); - $this->strategies = $strategies; + $this->iterator = $changeLogBatchIterator; } /** @@ -302,8 +303,12 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $iterator = $this->createIterator(); + $iterator = $this->getIterator(); $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + + if (empty($ids)) { + break; + } $vsFrom += $batchSize; $action->execute($ids); } @@ -315,8 +320,12 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int * @return ChangeLogBatchIteratorInterface|mixed * @throws Exception */ - private function createIterator() + private function getIterator() { + if ($this->iterator) { + return $this->iterator; + } + $config = $this->config->getView($this->changelog->getViewId()); $iteratorClass = $config['iterator']; From e4a2d3cdd2a1d427a35009c89b52fe570aba2847 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Mon, 21 Sep 2020 16:10:11 +0300 Subject: [PATCH 109/490] Mview patch update proposal --- .../Magento/Eav/Model/Mview/BatchIterator.php | 67 ---------- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 120 ++++++++++++++++++ .../Framework/Mview/Config/Converter.php | 6 +- lib/internal/Magento/Framework/Mview/View.php | 47 +++---- .../ProcessorFactory.php | 38 ++++++ ...hIterator.php => ChangeLogBatchWalker.php} | 5 +- .../View/ChangeLogBatchWalkerFactory.php | 37 ++++++ ....php => ChangeLogBatchWalkerInterface.php} | 4 +- .../Framework/Mview/View/Changelog.php | 13 +- .../Magento/Framework/Mview/etc/mview.xsd | 2 +- 10 files changed, 229 insertions(+), 110 deletions(-) delete mode 100644 app/code/Magento/Eav/Model/Mview/BatchIterator.php create mode 100644 app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php rename lib/internal/Magento/Framework/Mview/View/{ChangeLogBatchIterator.php => ChangeLogBatchWalker.php} (89%) create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php rename lib/internal/Magento/Framework/Mview/View/{ChangeLogBatchIteratorInterface.php => ChangeLogBatchWalkerInterface.php} (84%) diff --git a/app/code/Magento/Eav/Model/Mview/BatchIterator.php b/app/code/Magento/Eav/Model/Mview/BatchIterator.php deleted file mode 100644 index b7dd69abd45ff..0000000000000 --- a/app/code/Magento/Eav/Model/Mview/BatchIterator.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Eav\Mview; - -use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Sql\Expression; -use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; -use Magento\Framework\Mview\View\ChangelogInterface; -use Magento\Framework\Mview\View\ChangelogTableNotExistsException; -use Magento\Framework\Phrase; - -/** - * Class BatchIterator - */ -class BatchIterator implements ChangeLogBatchIteratorInterface -{ - /** - * @var ResourceConnection - */ - private $resourceConnection; - - /** - * @param ResourceConnection $resourceConnection - */ - public function __construct( - ResourceConnection $resourceConnection - ) { - $this->resourceConnection = $resourceConnection; - } - - /** - * @inheritdoc - */ - public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) - { - $connection = $this->resourceConnection->getConnection(); - if (!$connection->isTableExists($changelog->getName())) { - throw new ChangelogTableNotExistsException( - new Phrase("Table %1 does not exist", [$changelog->getName()]) - ); - } - $select = $connection->select()->distinct(true) - ->where( - 'version_id > ?', - (int)$fromVersionId - ) - ->where( - 'version_id <= ?', - $toVersion - ) - ->group([$changelog->getColumnName(), 'store_id']) - ->limit($batchSize); - - $columns = [ - $changelog->getColumnName(), - 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), - 'store_id' - ]; - - $select->from($changelog->getName(), $columns); - return $connection->fetchAll($select); - } -} diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php new file mode 100644 index 0000000000000..fdc71faa90902 --- /dev/null +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Eav\Model\Mview; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface; +use Magento\Framework\Mview\View\ChangelogInterface; + +/** + * Class BatchIterator + */ +class ChangeLogBatchWalker implements ChangeLogBatchWalkerInterface +{ + private const GROUP_CONCAT_MAX_VARIABLE = 'group_concat_max_len'; + /** ID is defined as small int. Default size of it is 5 */ + private const DEFAULT_ID_SIZE = 5; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var array + */ + private $entityTypeCodes; + + /** + * @param ResourceConnection $resourceConnection + * @param array $entityTypeCodes + */ + public function __construct( + ResourceConnection $resourceConnection, + array $entityTypeCodes = [] + ) { + $this->resourceConnection = $resourceConnection; + $this->entityTypeCodes = $entityTypeCodes; + } + + /** + * Calculate EAV attributes size + * + * @param ChangelogInterface $changelog + * @return int + * @throws \Exception + */ + private function calculateEavAttributeSize(ChangelogInterface $changelog): int + { + $connection = $this->resourceConnection->getConnection(); + + if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { + throw new \Exception('Entity type for view was not defined'); + } + + $select = $connection->select(); + $select->from( + $this->resourceConnection->getTableName('eav_attribute'), + new Expression('COUNT(*)') + ) + ->joinInner( + ['type' => $connection->getTableName('eav_entity_type')], + 'type.entity_type_id=eav_attribute.entity_type_id' + ) + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); + + return (int) $connection->fetchOne($select); + } + + /** + * Prepare group max concat + * + * @param int $numberOfAttributes + * @return void + * @throws \Exception + */ + private function setGroupConcatMax(int $numberOfAttributes): void + { + $connection = $this->resourceConnection->getConnection(); + $connection->query(sprintf( + 'SET SESSION %s=%s', + self::GROUP_CONCAT_MAX_VARIABLE, + $numberOfAttributes * (self::DEFAULT_ID_SIZE + 1) + )); + } + + /** + * @inheritdoc + * @throws \Exception + */ + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + { + $connection = $this->resourceConnection->getConnection(); + $numberOfAttributes = $this->calculateEavAttributeSize($changelog); + $this->setGroupConcatMax($numberOfAttributes); + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int) $fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion + ) + ->group([$changelog->getColumnName(), 'store_id']) + ->limit($batchSize); + + $columns = [ + $changelog->getColumnName(), + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + $select->from($changelog->getName(), $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index bb15287f9482a..988cffa8b7ce2 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -6,7 +6,7 @@ namespace Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; -use Magento\Framework\Mview\View\ChangeLogBatchIterator; +use Magento\Framework\Mview\View\ChangeLogBatchWalker; use Magento\Framework\Mview\View\SubscriptionInterface; class Converter implements \Magento\Framework\Config\ConverterInterface @@ -27,7 +27,7 @@ class Converter implements \Magento\Framework\Config\ConverterInterface */ public function __construct( string $defaultProcessor = DefaultProcessor::class, - string $defaultIterator = ChangeLogBatchIterator::class + string $defaultIterator = ChangeLogBatchWalker::class ) { $this->defaultProcessor = $defaultProcessor; $this->defaultIterator = $defaultIterator; @@ -52,7 +52,7 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); - $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; + $data['walker'] = $this->getAttributeValue($viewNode, 'walker') ?: $this->defaultIterator; $data['subscriptions'] = []; /** @var $childNode \DOMNode */ diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index fe8f4c675284b..420702c434103 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -11,8 +11,8 @@ use InvalidArgumentException; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; -use Magento\Framework\Mview\View\ChangeLogBatchIterator; -use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerFactory; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; use Exception; @@ -66,9 +66,9 @@ class View extends DataObject implements ViewInterface private $changelogBatchSize; /** - * @var ChangeLogBatchIteratorInterface + * @var ChangeLogBatchWalkerFactory */ - private $iterator; + private $changeLogBatchWalkerFactory; /** * @param ConfigInterface $config @@ -78,7 +78,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize - * @param ChangeLogBatchIteratorInterface|null $changeLogBatchIterator + * @param ChangeLogBatchWalkerFactory $changeLogBatchWalkerFactory */ public function __construct( ConfigInterface $config, @@ -88,7 +88,7 @@ public function __construct( SubscriptionFactory $subscriptionFactory, array $data = [], array $changelogBatchSize = [], - ChangeLogBatchIteratorInterface $changeLogBatchIterator = null + ChangeLogBatchWalkerFactory $changeLogBatchWalkerFactory = null ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -97,7 +97,8 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); - $this->iterator = $changeLogBatchIterator; + $this->changeLogBatchWalkerFactory = $changeLogBatchWalkerFactory ?: + ObjectManager::getInstance()->get(ChangeLogBatchWalkerFactory::class); } /** @@ -303,8 +304,8 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $iterator = $this->getIterator(); - $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + $walker = $this->getWalker(); + $ids = $walker->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); if (empty($ids)) { break; @@ -315,34 +316,16 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int } /** - * Create and validate iterator class for changelog + * Create and validate walker class for changelog * - * @return ChangeLogBatchIteratorInterface|mixed + * @return ChangeLogBatchWalkerInterface|mixed * @throws Exception */ - private function getIterator() + private function getWalker(): ChangeLogBatchWalkerInterface { - if ($this->iterator) { - return $this->iterator; - } - $config = $this->config->getView($this->changelog->getViewId()); - $iteratorClass = $config['iterator']; - - if (!class_exists($iteratorClass)) { - throw new \Exception('Iterator class does not exist for view: ' . $this->changelog->getViewId()); - } - - $iterator = ObjectManager::getInstance()->get($iteratorClass); - - if (!$iterator instanceof ChangeLogBatchIteratorInterface) { - throw new \Exception( - 'Iterator does not implement the right interface for view: ' . - $this->changelog->getViewId() - ); - } - - return $iterator; + $walkerClass = $config['walker']; + return $this->changeLogBatchWalkerFactory->create($walkerClass); } /** diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php new file mode 100644 index 0000000000000..5907cefbffd50 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View\AdditionalColumnsProcessor; + +use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; +use Magento\Framework\ObjectManagerInterface; + +class ProcessorFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * ProcessorFactory constructor. + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Instantiate additional columns processor + * + * @param string $processorClassName + * @return AdditionalColumnProcessorInterface + */ + public function create(string $processorClassName): AdditionalColumnProcessorInterface + { + return $this->objectManager->create($processorClassName); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php similarity index 89% rename from lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php rename to lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php index f3ae87b847cb1..7a767e656c3ca 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php @@ -7,14 +7,13 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Phrase; /** - * Interface \Magento\Framework\Mview\View\ChangeLogBatchIterator + * Interface \Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface * */ -class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface +class ChangeLogBatchWalker implements ChangeLogBatchWalkerInterface { /** * @var ResourceConnection diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php new file mode 100644 index 0000000000000..98d814775f62b --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\ObjectManagerInterface; + +class ChangeLogBatchWalkerFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * ChangeLogBatchWalkerFactory constructor. + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Instantiate BatchWalker interface + * + * @param string $batchWalkerClassName + * @return ChangeLogBatchWalkerInterface + */ + public function create(string $batchWalkerClassName): ChangeLogBatchWalkerInterface + { + return $this->objectManager->create($batchWalkerClassName); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php similarity index 84% rename from lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php rename to lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php index 5e86e0753aec9..d9079c550403c 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php @@ -12,10 +12,10 @@ use Magento\Framework\Phrase; /** - * Interface \Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface + * Interface \Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface * */ -interface ChangeLogBatchIteratorInterface +interface ChangeLogBatchWalkerInterface { /** * Walk through batches diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 94ce4c19874ce..d26d816e34fea 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\ProcessorFactory; use Magento\Framework\Phrase; /** @@ -57,19 +58,27 @@ class Changelog implements ChangelogInterface */ private $mviewConfig; + /** + * @var ProcessorFactory + */ + private $additionalColumnsProcessorFactory; + /** * @param \Magento\Framework\App\ResourceConnection $resource * @param Config $mviewConfig + * @param ProcessorFactory $additionalColumnsProcessorFactory * @throws ConnectionException */ public function __construct( \Magento\Framework\App\ResourceConnection $resource, - Config $mviewConfig + Config $mviewConfig, + ProcessorFactory $additionalColumnsProcessorFactory ) { $this->connection = $resource->getConnection(); $this->resource = $resource; $this->checkConnection(); $this->mviewConfig = $mviewConfig; + $this->additionalColumnsProcessorFactory = $additionalColumnsProcessorFactory; } /** @@ -116,7 +125,7 @@ public function create() foreach ($this->initAdditionalColumnData() as $columnData) { /** @var AdditionalColumnProcessorInterface $processor */ $processorClass = $columnData['processor']; - $processor = ObjectManager::getInstance()->get($processorClass); + $processor = $this->additionalColumnsProcessorFactory->create($processorClass); $processor->processColumnForCLTable($table, $columnData['cl_name']); } diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index 053d1b2853f66..04754fa499249 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,7 +46,7 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> - <xs:attribute name="iterator" type="classType" default="Magento\Framework\Mview\View\LegacyChangeLogBatchIterator" /> + <xs:attribute name="walker" type="classType" default="Magento\Framework\Mview\View\ChangeLogBatchWalker" /> </xs:complexType> <xs:simpleType name="classType"> From 34039643885be75dd1c47d8bad0f0c153a7bf247 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 4 Nov 2020 17:25:05 +0200 Subject: [PATCH 110/490] Make --- .../Magento/Framework/Mview/View/ChangelogInterface.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php index 79f998cbe02b6..b00c1ca3a2e33 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php @@ -11,11 +11,6 @@ */ interface ChangelogInterface { - const ATTRIBUTE_SCOPE_SUPPORT = 'attribute_scope'; - const STORE_SCOPE_SUPPORT = 'store_scope'; - const ATTRIBUTE_COLUMN = 'attribute_id'; - const STORE_COLUMN = 'store_id'; - /** * Create changelog table * From 2857996ff429192286a27206ade4ea10c5ba25c2 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 4 Nov 2020 20:26:43 +0200 Subject: [PATCH 111/490] CR recommendations --- .../Resolver/AddProductsToCompareList.php | 2 +- .../Resolver/AssignCompareListToCustomer.php | 16 ++-- .../Model/Resolver/CompareList.php | 2 +- .../Model/Resolver/CreateCompareList.php | 14 ++-- .../Model/Resolver/CustomerCompareList.php | 16 ++-- .../Model/Resolver/DeleteCompareList.php | 2 +- .../RemoveProductsFromCompareList.php | 2 +- .../Customer/GetListIdByCustomerId.php | 59 ++++++++++++++ .../Customer/SetCustomerToCompareList.php | 77 ++++++++++++++++++ .../ValidateCustomer.php} | 78 ++----------------- 10 files changed, 170 insertions(+), 98 deletions(-) create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/Customer/GetListIdByCustomerId.php create mode 100644 app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php rename app/code/Magento/CompareListGraphQl/Model/Service/{CustomerService.php => Customer/ValidateCustomer.php} (55%) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index e0b27157ff3ac..0bef548d3f82c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -74,7 +74,7 @@ public function resolve( array $args = null ) { $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); - if (!isset($args['input']['uid'])) { + if (empty($args['input']['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified.')); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index cd9f7007f8549..6d847e3f05c4c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -8,7 +8,7 @@ namespace Magento\CompareListGraphQl\Model\Resolver; use Magento\Catalog\Model\MaskedListIdToCompareListId; -use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\CompareListGraphQl\Model\Service\Customer\SetCustomerToCompareList; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -23,9 +23,9 @@ class AssignCompareListToCustomer implements ResolverInterface { /** - * @var CustomerService + * @var SetCustomerToCompareList */ - private $customerService; + private $setCustomerToCompareList; /** * @var MaskedListIdToCompareListId @@ -33,14 +33,14 @@ class AssignCompareListToCustomer implements ResolverInterface private $maskedListIdToCompareListId; /** - * @param CustomerService $customerService + * @param SetCustomerToCompareList $setCustomerToCompareList * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( - CustomerService $customerService, + SetCustomerToCompareList $setCustomerToCompareList, MaskedListIdToCompareListId $maskedListIdToCompareListId ) { - $this->customerService = $customerService; + $this->setCustomerToCompareList = $setCustomerToCompareList; $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; } @@ -65,7 +65,7 @@ public function resolve( array $value = null, array $args = null ) { - if (!isset($args['uid'])) { + if (empty($args['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified')); } @@ -78,7 +78,7 @@ public function resolve( if ($listId) { try { - $result = $this->customerService->setCustomerToCompareList($listId, $context->getUserId()); + $result = $this->setCustomerToCompareList->execute($listId, $context->getUserId()); } catch (LocalizedException $exception) { throw new GraphQlInputException( __('Something was wrong during assigning customer.') diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index 3bb800dda5e7d..ca1314d8ec15e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -65,7 +65,7 @@ public function resolve( array $value = null, array $args = null ) { - if (!isset($args['uid'])) { + if (empty($args['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified')); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index dd90fab117fd1..64f706f84756a 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -9,7 +9,7 @@ use Magento\CompareListGraphQl\Model\Service\AddToCompareList; use Magento\CompareListGraphQl\Model\Service\CreateCompareList as CreateCompareListService; -use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; @@ -31,9 +31,9 @@ class CreateCompareList implements ResolverInterface private $mathRandom; /** - * @var CustomerService + * @var GetListIdByCustomerId */ - private $customerService; + private $getListIdByCustomerId; /** * @var AddToCompareList @@ -52,20 +52,20 @@ class CreateCompareList implements ResolverInterface /** * @param Random $mathRandom - * @param CustomerService $customerService + * @param GetListIdByCustomerId $getListIdByCustomerId * @param AddToCompareList $addProductToCompareList * @param GetCompareList $getCompareList * @param CreateCompareListService $createCompareList */ public function __construct( Random $mathRandom, - CustomerService $customerService, + GetListIdByCustomerId $getListIdByCustomerId, AddToCompareList $addProductToCompareList, GetCompareList $getCompareList, CreateCompareListService $createCompareList ) { $this->mathRandom = $mathRandom; - $this->customerService = $customerService; + $this->getListIdByCustomerId = $getListIdByCustomerId; $this->addProductToCompareList = $addProductToCompareList; $this->getCompareList = $getCompareList; $this->createCompareList = $createCompareList; @@ -106,7 +106,7 @@ public function resolve( } if ($customerId) { - $listId = $this->customerService->getListIdByCustomerId($customerId); + $listId = $this->getListIdByCustomerId->execute($customerId); if ($listId) { $this->addProductToCompareList->execute($listId, $products, $storeId); } else { diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php index c81a1775e82e7..84d0aad0c9a71 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CustomerCompareList.php @@ -7,7 +7,7 @@ namespace Magento\CompareListGraphQl\Model\Resolver; -use Magento\CompareListGraphQl\Model\Service\CustomerService; +use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -26,20 +26,20 @@ class CustomerCompareList implements ResolverInterface private $getCompareList; /** - * @var CustomerService + * @var GetListIdByCustomerId */ - private $customerService; + private $getListIdByCustomerId; /** - * @param GetCompareList $getCompareList - * @param CustomerService $customerService + * @param GetCompareList $getCompareList + * @param GetListIdByCustomerId $getListIdByCustomerId */ public function __construct( GetCompareList $getCompareList, - CustomerService $customerService + GetListIdByCustomerId $getListIdByCustomerId ) { $this->getCompareList = $getCompareList; - $this->customerService = $customerService; + $this->getListIdByCustomerId = $getListIdByCustomerId; } /** @@ -62,7 +62,7 @@ public function resolve( array $value = null, array $args = null ) { - $listId = $this->customerService->getListIdByCustomerId($context->getUserId()); + $listId = $this->getListIdByCustomerId->execute((int)$context->getUserId()); if (!$listId) { return null; diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index 7278c6c0ef0d1..0396cf218b687 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -74,7 +74,7 @@ public function resolve( array $value = null, array $args = null ) { - if (!isset($args['uid'])) { + if (empty($args['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified')); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php index 0ca47c0f4b6e4..b3caee87d66d0 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php @@ -79,7 +79,7 @@ public function resolve( throw new GraphQlInputException(__('"products" value must be specified.')); } - if (!isset($args['input']['uid'])) { + if (empty($args['input']['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified.')); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/GetListIdByCustomerId.php b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/GetListIdByCustomerId.php new file mode 100644 index 0000000000000..c6437683f6ba7 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/GetListIdByCustomerId.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Service\Customer; + +use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; + +/** + * Get compare list id by customer id + */ +class GetListIdByCustomerId +{ + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + */ + public function __construct( + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList + ) { + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + } + + /** + * Get listId by Customer ID + * + * @param int $customerId + * + * @return int|null + */ + public function execute(int $customerId): ?int + { + if ($customerId) { + /** @var CompareList $compareList */ + $compareList = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareList, $customerId, 'customer_id'); + return (int)$compareList->getListId(); + } + + return null; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php new file mode 100644 index 0000000000000..901a04b674594 --- /dev/null +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CompareListGraphQl\Model\Service\Customer; + +use Magento\Catalog\Model\CompareList; +use Magento\Catalog\Model\CompareListFactory; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; +use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; + +/** + * Assign customer to compare list + */ +class SetCustomerToCompareList +{ + /** + * @var ValidateCustomer + */ + private $validateCustomer; + + /** + * @var CompareListFactory + */ + private $compareListFactory; + + /** + * @var ResourceCompareList + */ + private $resourceCompareList; + + /** + * @param ValidateCustomer $validateCustomer + * @param CompareListFactory $compareListFactory + * @param ResourceCompareList $resourceCompareList + */ + public function __construct( + ValidateCustomer $validateCustomer, + CompareListFactory $compareListFactory, + ResourceCompareList $resourceCompareList + ) { + $this->validateCustomer = $validateCustomer; + $this->compareListFactory = $compareListFactory; + $this->resourceCompareList = $resourceCompareList; + } + + /** + * Set customer to compare list + * + * @param int $listId + * @param int $customerId + * + * @return bool + * + * @throws GraphQlAuthenticationException + * @throws GraphQlInputException + * @throws GraphQlNoSuchEntityException + */ + public function execute(int $listId, int $customerId): bool + { + if ($this->validateCustomer->execute($customerId)) { + /** @var CompareList $compareListModel */ + $compareList = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareList, $listId, 'list_id'); + $compareList->setCustomerId($customerId); + $this->resourceCompareList->save($compareList); + return true; + } + + return false; + } +} diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/ValidateCustomer.php similarity index 55% rename from app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php rename to app/code/Magento/CompareListGraphQl/Model/Service/Customer/ValidateCustomer.php index 201faf078d243..ab16b17240b1c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CustomerService.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/ValidateCustomer.php @@ -5,11 +5,8 @@ */ declare(strict_types=1); -namespace Magento\CompareListGraphQl\Model\Service; +namespace Magento\CompareListGraphQl\Model\Service\Customer; -use Magento\Catalog\Model\CompareList; -use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Model\AuthenticationInterface; @@ -20,99 +17,38 @@ use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; /** - * Service class for customer + * Class provided customer validation */ -class CustomerService +class ValidateCustomer { /** * @var AuthenticationInterface */ private $authentication; - /** - * @var CustomerRepositoryInterface - */ - private $customerRepository; - /** * @var AccountManagementInterface */ private $accountManagement; /** - * @var ResourceCompareList - */ - private $resourceCompareList; - - /** - * @var CompareListFactory + * @var CustomerRepositoryInterface */ - private $compareListFactory; + private $customerRepository; /** * @param AuthenticationInterface $authentication * @param AccountManagementInterface $accountManagement * @param CustomerRepositoryInterface $customerRepository - * @param CompareListFactory $compareListFactory - * @param ResourceCompareList $resourceCompareList */ public function __construct( AuthenticationInterface $authentication, AccountManagementInterface $accountManagement, - CustomerRepositoryInterface $customerRepository, - CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList + CustomerRepositoryInterface $customerRepository ) { $this->authentication = $authentication; $this->accountManagement = $accountManagement; $this->customerRepository = $customerRepository; - $this->compareListFactory = $compareListFactory; - $this->resourceCompareList = $resourceCompareList; - } - - /** - * Get listId by Customer ID - * - * @param int $customerId - * - * @return int|null - */ - public function getListIdByCustomerId(int $customerId) - { - if ($customerId) { - /** @var CompareList $compareList */ - $compareList = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareList, $customerId, 'customer_id'); - return (int)$compareList->getListId(); - } - - return null; - } - - /** - * Set customer to compare list - * - * @param int $listId - * @param int $customerId - * - * @return bool - * - * @throws GraphQlAuthenticationException - * @throws GraphQlInputException - * @throws GraphQlNoSuchEntityException - */ - public function setCustomerToCompareList(int $listId, int $customerId): bool - { - if ($this->validateCustomer($customerId)) { - /** @var CompareList $compareListModel */ - $compareList = $this->compareListFactory->create(); - $this->resourceCompareList->load($compareList, $listId, 'list_id'); - $compareList->setCustomerId($customerId); - $this->resourceCompareList->save($compareList); - return true; - } - - return false; } /** @@ -126,7 +62,7 @@ public function setCustomerToCompareList(int $listId, int $customerId): bool * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException */ - public function validateCustomer(int $customerId): int + public function execute(int $customerId): int { try { $customer = $this->customerRepository->getById($customerId); From 79a82bb212b5b8e274b75d52c815844dbc12b417 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 5 Nov 2020 16:02:13 -0600 Subject: [PATCH 112/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml index d54b9fada0f4b..3dd87d94d0148 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleCouponData.xml @@ -13,8 +13,4 @@ <data key="is_primary">1</data> <data key="times_used">0</data> </entity> - <entity name="SalesRuleCouponUsageConsumer"> - <data key="consumerName">sales.rule.update.coupon.usage</data> - <data key="messageLimit">100</data> - </entity> </entities> From e9f371211d9c3571cb2ebe18e8c2d220031b256c Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Thu, 5 Nov 2020 17:03:51 -0600 Subject: [PATCH 113/490] MC-37484: Cart query error when trying to switch store view --- .../Model/Cart/SetShippingAddressesOnCart.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php index 71740488c4cea..fa5be95d34822 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php @@ -11,6 +11,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\GraphQl\Model\Query\ContextInterface; use Magento\Quote\Api\Data\CartInterface; +use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface; use Magento\Quote\Model\QuoteRepository; /** @@ -18,6 +19,16 @@ */ class SetShippingAddressesOnCart implements SetShippingAddressesOnCartInterface { + /** + * @var QuoteIdToMaskedQuoteIdInterface + */ + private $quoteIdToMaskedQuoteId; + + /** + * @var GetCartForUser + */ + private $getCartForUser; + /** * @var AssignShippingAddressToCart */ @@ -34,15 +45,21 @@ class SetShippingAddressesOnCart implements SetShippingAddressesOnCartInterface private $quoteRepository; /** + * @param QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId + * @param GetCartForUser $getCartForUser * @param AssignShippingAddressToCart $assignShippingAddressToCart * @param GetShippingAddress $getShippingAddress * @param QuoteRepository|null $quoteRepository */ public function __construct( + QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId, + GetCartForUser $getCartForUser, AssignShippingAddressToCart $assignShippingAddressToCart, GetShippingAddress $getShippingAddress, QuoteRepository $quoteRepository = null ) { + $this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId; + $this->getCartForUser = $getCartForUser; $this->assignShippingAddressToCart = $assignShippingAddressToCart; $this->getShippingAddress = $getShippingAddress; $this->quoteRepository = $quoteRepository @@ -81,7 +98,10 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s throw $e; } $this->assignShippingAddressToCart->execute($cart, $shippingAddress); - // trigger quote re-evaluation after address change + + // reload updated cart & trigger quote re-evaluation after address change + $maskedId = $this->quoteIdToMaskedQuoteId->execute((int)$cart->getId()); + $cart = $this->getCartForUser->execute($maskedId, $context->getUserId(), $cart->getStoreId()); $this->quoteRepository->save($cart); } } From 895f88bdb193ab3aff733764527e6614a3240f93 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Thu, 5 Nov 2020 17:11:36 -0600 Subject: [PATCH 114/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...inCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 8c64918696f1f..f4814274306c2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -20,11 +20,8 @@ </annotations> <before> - <!-- Start Coupon Usage Consumer --> - <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> - <argument name="consumerName" value="sales.rule.update.coupon.usage"/> - <argument name="maxMessages" value="1000"/> - </actionGroup> + <!-- Start the consumer --> + <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue"/> <!-- Enable Zero Subtotal Checkout --> <magentoCLI command="config:set {{EnableZeroSubtotalCheckoutConfigData.path}} {{EnableZeroSubtotalCheckoutConfigData.value}}" stepKey="enableZeroSubtotalCheckout"/> From ef7d78ff7b4cda909c0fe7d8e9c35a2b609a2f60 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Fri, 6 Nov 2020 08:41:00 -0600 Subject: [PATCH 115/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index f4814274306c2..4ba5d7f53c03f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -51,6 +51,9 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> + <!-- Start the consumer --> + <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue1"/> + <!--Create new customer order--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> From f5d692ffa6c1e81f9528686a20cfa556677b0fd5 Mon Sep 17 00:00:00 2001 From: Thomas Klein <thomasklein876@gmail.com> Date: Fri, 6 Nov 2020 17:20:30 +0100 Subject: [PATCH 116/490] fix iterate on null --- app/code/Magento/Shipping/Model/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Model/Config.php b/app/code/Magento/Shipping/Model/Config.php index 26a76c90d3c85..d6e13dbea0faf 100644 --- a/app/code/Magento/Shipping/Model/Config.php +++ b/app/code/Magento/Shipping/Model/Config.php @@ -89,7 +89,7 @@ public function getActiveCarriers($store = null) public function getAllCarriers($store = null) { $carriers = []; - $config = $this->_scopeConfig->getValue('carriers', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store); + $config = $this->_scopeConfig->getValue('carriers', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store) ?: []; foreach (array_keys($config) as $carrierCode) { $model = $this->_carrierFactory->create($carrierCode, $store); if ($model) { From 2ffaa301fa910189c3a5bb9c073b7ee0794f9cb6 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Fri, 6 Nov 2020 11:21:16 -0600 Subject: [PATCH 117/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 4ba5d7f53c03f..691f18058b0df 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -72,6 +72,9 @@ <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> + <!-- Start the consumer --> + <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> + <!-- Cancel the Order --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> From 1ec40b0f6dd513ddf50e3b7483c615dfc8cab665 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 6 Nov 2020 19:32:02 +0200 Subject: [PATCH 118/490] Removed list id mask table --- .../Model/CompareListIdToMaskedListId.php | 30 +++++++++---------- app/code/Magento/Catalog/Model/ListIdMask.php | 26 ---------------- .../Model/MaskedListIdToCompareListId.php | 28 ++++++++--------- .../Product/Compare/ListIdMask.php | 26 ---------------- app/code/Magento/Catalog/etc/db_schema.xml | 26 ++++------------ .../Catalog/etc/db_schema_whitelist.json | 17 ++--------- .../Model/Service/CreateCompareList.php | 26 ++-------------- 7 files changed, 39 insertions(+), 140 deletions(-) delete mode 100644 app/code/Magento/Catalog/Model/ListIdMask.php delete mode 100644 app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php diff --git a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php index d47be505bd623..f17244a2ed836 100644 --- a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php +++ b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Model; -use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskMaskResource; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; /** * CompareListId to MaskedListId resolver @@ -15,29 +15,29 @@ class CompareListIdToMaskedListId { /** - * @var ListIdMaskFactory + * @var CompareListFactory */ - private $listIdMaskFactory; + private $compareListFactory; /** - * @var ListIdMaskMaskResource + * @var CompareListResource */ - private $listIdMaskResource; + private $compareListResource; /** - * @param ListIdMaskFactory $listIdMaskFactory - * @param ListIdMaskMaskResource $listIdMaskResource + * @param CompareListFactory $compareListFactory + * @param CompareListResource $compareListResource */ public function __construct( - ListIdMaskFactory $listIdMaskFactory, - ListIdMaskMaskResource $listIdMaskResource + CompareListFactory $compareListFactory, + CompareListResource $compareListResource ) { - $this->listIdMaskFactory = $listIdMaskFactory; - $this->listIdMaskResource = $listIdMaskResource; + $this->compareListFactory = $compareListFactory; + $this->compareListResource = $compareListResource; } /** - * Get maskedId by listId + * Get listIdMask by listId * * @param int $listId * @@ -45,8 +45,8 @@ public function __construct( */ public function execute(int $listId): ?string { - $listIdMask = $this->listIdMaskFactory->create(); - $this->listIdMaskResource->load($listIdMask, $listId, 'list_id'); - return $listIdMask->getMaskedId() ?? null; + $compareList = $this->compareListFactory->create(); + $this->compareListResource->load($compareList, $listId, 'list_id'); + return $compareList->getListIdMask() ?? null; } } diff --git a/app/code/Magento/Catalog/Model/ListIdMask.php b/app/code/Magento/Catalog/Model/ListIdMask.php deleted file mode 100644 index 06fc825a29d1b..0000000000000 --- a/app/code/Magento/Catalog/Model/ListIdMask.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Catalog\Model; - -use Magento\Framework\Model\AbstractModel; - -/** - * ListIdMask model - */ -class ListIdMask extends AbstractModel -{ - /** - * Initialize resource - * - * @return void - */ - protected function _construct() - { - $this->_init(ResourceModel\Product\Compare\ListIdMask::class); - } -} diff --git a/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php index 0256b33057b12..47cea9dc09ce7 100644 --- a/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php +++ b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Model; -use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskMaskResource; +use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; /** * MaskedListId to ListId resolver @@ -15,25 +15,25 @@ class MaskedListIdToCompareListId { /** - * @var ListIdMaskFactory + * @var CompareListFactory */ - private $listIdMaskFactory; + private $compareListFactory; /** - * @var ListIdMaskMaskResource + * @var CompareListResource */ - private $listIdMaskResource; + private $compareListResource; /** - * @param ListIdMaskFactory $listIdMaskFactory - * @param ListIdMaskMaskResource $listIdMaskResource + * @param CompareListFactory $compareListFactory + * @param CompareListResource $compareListResource */ public function __construct( - ListIdMaskFactory $listIdMaskFactory, - ListIdMaskMaskResource $listIdMaskResource + CompareListFactory $compareListFactory, + CompareListResource $compareListResource ) { - $this->listIdMaskFactory = $listIdMaskFactory; - $this->listIdMaskResource = $listIdMaskResource; + $this->compareListFactory = $compareListFactory; + $this->compareListResource = $compareListResource; } /** @@ -45,9 +45,9 @@ public function __construct( */ public function execute(string $maskedListId): int { - $listIdMask = $this->listIdMaskFactory->create(); - $this->listIdMaskResource->load($listIdMask, $maskedListId, 'masked_id'); + $compareList = $this->compareListFactory->create(); + $this->compareListResource->load($compareList, $maskedListId, 'list_id_mask'); - return (int)$listIdMask->getListId(); + return (int)$compareList->getListId(); } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php deleted file mode 100644 index 54719f656403d..0000000000000 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/ListIdMask.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Catalog\Model\ResourceModel\Product\Compare; - -use Magento\Framework\Model\ResourceModel\Db\AbstractDb; - -/** - * ListIdMask Resource model - */ -class ListIdMask extends AbstractDb -{ - /** - * Main table and field initialization - * - * @return void - */ - protected function _construct() - { - $this->_init('list_id_mask', 'entity_id'); - } -} diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index 1bd59e6236d69..d601a882cb25e 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -580,35 +580,21 @@ <table name="catalog_compare_list" resource="default" engine="innodb" comment="Catalog Compare List with hash Table"> <column xsi:type="int" name="list_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Compare List ID"/> + <column xsi:type="varchar" name="list_id_mask" nullable="true" length="32" comment="Masked ID"/> <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false" comment="Customer ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="list_id"/> </constraint> + <constraint xsi:type="foreign" referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="catalog_compare_list" column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <index referenceId="CATALOG_COMPARE_LIST_VISITOR_ID_CUSTOMER_ID" indexType="btree"> - <column name="customer_id"/> + <index referenceId="CATALOG_COMPARE_LIST_LIST_ID_MASK" indexType="btree"> + <column name="list_id_mask"/> </index> - </table> - <table name="list_id_mask" resource="default" engine="innodb" comment="List ID and masked ID mapping"> - <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" - comment="Entity ID"/> - <column xsi:type="int" name="list_id" unsigned="true" nullable="false" identity="false" - comment="List ID"/> - <column xsi:type="varchar" name="masked_id" nullable="true" length="32" comment="Masked ID"/> - <constraint xsi:type="primary" referenceId="PRIMARY"> - <column name="entity_id"/> - <column name="list_id"/> - </constraint> - <constraint xsi:type="foreign" referenceId="LIST_ID_MASK_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID" table="list_id_mask" - column="list_id" referenceTable="catalog_compare_list" referenceColumn="list_id" onDelete="CASCADE"/> - <index referenceId="LIST_ID_MASK_LIST_ID" indexType="btree"> - <column name="list_id"/> - </index> - <index referenceId="LIST_ID_MASK_MASKED_ID" indexType="btree"> - <column name="masked_id"/> + <index referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_CUSTOMER_ID" indexType="btree"> + <column name="customer_id"/> </index> </table> <table name="catalog_product_website" resource="default" engine="innodb" diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index 7ad6e9dda330a..3bbd99653e860 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1128,29 +1128,16 @@ "catalog_compare_list": { "column": { "list_id": true, + "list_id_mask": true, "customer_id": true }, "index": { + "CATALOG_COMPARE_LIST_LIST_ID_MASK": true, "CATALOG_COMPARE_LIST_CUSTOMER_ID": true }, "constraint": { "PRIMARY": true, "CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID": true } - }, - "list_id_mask": { - "column": { - "entity_id": true, - "list_id": true, - "masked_id": true - }, - "index": { - "LIST_ID_MASK_LIST_ID": true, - "LIST_ID_MASK_MASKED_ID": true - }, - "constraint": { - "PRIMARY": true, - "LIST_ID_MASK_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID": true - } } } \ No newline at end of file diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php index c92eb777c5b05..089bdb1adef17 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/CreateCompareList.php @@ -8,9 +8,7 @@ namespace Magento\CompareListGraphQl\Model\Service; use Magento\Catalog\Model\CompareListFactory; -use Magento\Catalog\Model\ListIdMaskFactory; use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; -use Magento\Catalog\Model\ResourceModel\Product\Compare\ListIdMask as ListIdMaskResource; /** * Create new Compare List @@ -27,32 +25,16 @@ class CreateCompareList */ private $compareListResource; - /** - * @var ListIdMaskFactory - */ - private $maskedListIdFactory; - - /** - * @var ListIdMaskResource - */ - private $maskedListIdResource; - /** * @param CompareListFactory $compareListFactory * @param CompareListResource $compareListResource - * @param ListIdMaskFactory $maskedListIdFactory - * @param ListIdMaskResource $maskedListIdResource */ public function __construct( CompareListFactory $compareListFactory, - CompareListResource $compareListResource, - ListIdMaskFactory $maskedListIdFactory, - ListIdMaskResource $maskedListIdResource + CompareListResource $compareListResource ) { $this->compareListFactory = $compareListFactory; $this->compareListResource = $compareListResource; - $this->maskedListIdFactory = $maskedListIdFactory; - $this->maskedListIdResource = $maskedListIdResource; } /** @@ -66,14 +48,10 @@ public function __construct( public function execute(string $maskedId, ?int $customerId = null): int { $compareList = $this->compareListFactory->create(); + $compareList->setListIdMask($maskedId); $compareList->setCustomerId($customerId); $this->compareListResource->save($compareList); - $maskedListId = $this->maskedListIdFactory->create(); - $maskedListId->setListId($compareList->getListId()); - $maskedListId->setMaskedId($maskedId); - $this->maskedListIdResource->save($maskedListId); - return (int)$compareList->getListId(); } } From e39d6e93b01a7b88dc7f13c4968f21fb6a714daf Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Fri, 6 Nov 2020 11:44:03 -0600 Subject: [PATCH 119/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...nCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 691f18058b0df..aad1c4d831a11 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -68,13 +68,15 @@ <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder" /> + <!-- Start the consumer --> + <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> + <reloadPage stepKey="refreshPage"/> + <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> + <reloadPage stepKey="refreshPage"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> - <!-- Start the consumer --> - <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> - <!-- Cancel the Order --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> From 8780f6673ec4d89db6474f5eee50d083de3bd7d0 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 6 Nov 2020 20:05:19 +0200 Subject: [PATCH 120/490] add additional check --- .../Resolver/AddProductsToCompareList.php | 20 ++++++++- .../Model/Resolver/DeleteCompareList.php | 44 ++++++++++++++++--- .../RemoveProductsFromCompareList.php | 36 ++++++++++++++- 3 files changed, 93 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index 0bef548d3f82c..689676aa8a81b 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\CompareListGraphQl\Model\Service\AddToCompareList; +use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -37,19 +38,27 @@ class AddProductsToCompareList implements ResolverInterface */ private $maskedListIdToCompareListId; + /** + * @var GetListIdByCustomerId + */ + private $getListIdByCustomerId; + /** * @param AddToCompareList $addProductToCompareList * @param GetCompareList $getCompareList * @param MaskedListIdToCompareListId $maskedListIdToCompareListId + * @param GetListIdByCustomerId $getListIdByCustomerId */ public function __construct( AddToCompareList $addProductToCompareList, GetCompareList $getCompareList, - MaskedListIdToCompareListId $maskedListIdToCompareListId + MaskedListIdToCompareListId $maskedListIdToCompareListId, + GetListIdByCustomerId $getListIdByCustomerId ) { $this->addProductToCompareList = $addProductToCompareList; $this->getCompareList = $getCompareList; $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + $this->getListIdByCustomerId = $getListIdByCustomerId; } /** @@ -88,6 +97,15 @@ public function resolve( throw new GraphQlInputException(__('"uid" value does not exist')); } + if ($userId = $context->getUserId()) { + $customerListId = $this->getListIdByCustomerId->execute($userId); + if ($listId === $customerListId) { + $this->addProductToCompareList->execute($customerListId, $args['input']['products'], $storeId); + + return $this->getCompareList->execute($customerListId, $context); + } + } + $this->addProductToCompareList->execute($listId, $args['input']['products'], $storeId); return $this->getCompareList->execute($listId, $context); diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index 0396cf218b687..80ed98e6c776c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -10,6 +10,7 @@ use Magento\Catalog\Model\CompareListFactory; use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; +use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -38,19 +39,27 @@ class DeleteCompareList implements ResolverInterface */ private $maskedListIdToCompareListId; + /** + * @var GetListIdByCustomerId + */ + private $getListIdByCustomerId; + /** * @param CompareListFactory $compareListFactory * @param CompareListResource $compareListResource * @param MaskedListIdToCompareListId $maskedListIdToCompareListId + * @param GetListIdByCustomerId $getListIdByCustomerId */ public function __construct( CompareListFactory $compareListFactory, CompareListResource $compareListResource, - MaskedListIdToCompareListId $maskedListIdToCompareListId + MaskedListIdToCompareListId $maskedListIdToCompareListId, + GetListIdByCustomerId $getListIdByCustomerId ) { $this->compareListFactory = $compareListFactory; $this->compareListResource = $compareListResource; $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + $this->getListIdByCustomerId = $getListIdByCustomerId; } /** @@ -81,12 +90,22 @@ public function resolve( $listId = $this->maskedListIdToCompareListId->execute($args['uid']); $removed = ['result' => false]; + if ($userId = $context->getUserId()) { + $customerListId = $this->getListIdByCustomerId->execute($userId); + if ($listId === $customerListId) { + try { + $removed['result'] = $this->deleteCompareList($customerListId); + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during removing compare list') + ); + } + } + } + if ($listId) { try { - $compareList = $this->compareListFactory->create(); - $compareList->setListId($listId); - $this->compareListResource->delete($compareList); - $removed['result'] = true; + $removed['result'] = $this->deleteCompareList($listId); } catch (LocalizedException $exception) { throw new GraphQlInputException( __('Something was wrong during removing compare list') @@ -96,4 +115,19 @@ public function resolve( return $removed; } + + /** + * Delete compare list + * + * @param int|null $listId + * @return bool + */ + private function deleteCompareList(?int $listId): bool + { + $compareList = $this->compareListFactory->create(); + $compareList->setListId($listId); + $this->compareListResource->delete($compareList); + + return true; + } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php index b3caee87d66d0..2e78e351ae64c 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php @@ -8,6 +8,7 @@ namespace Magento\CompareListGraphQl\Model\Resolver; use Magento\Catalog\Model\MaskedListIdToCompareListId; +use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\CompareListGraphQl\Model\Service\RemoveFromCompareList; use Magento\Framework\Exception\LocalizedException; @@ -38,19 +39,27 @@ class RemoveProductsFromCompareList implements ResolverInterface */ private $maskedListIdToCompareListId; + /** + * @var GetListIdByCustomerId + */ + private $getListIdByCustomerId; + /** * @param GetCompareList $getCompareList * @param RemoveFromCompareList $removeFromCompareList * @param MaskedListIdToCompareListId $maskedListIdToCompareListId + * @param GetListIdByCustomerId $getListIdByCustomerId */ public function __construct( GetCompareList $getCompareList, RemoveFromCompareList $removeFromCompareList, - MaskedListIdToCompareListId $maskedListIdToCompareListId + MaskedListIdToCompareListId $maskedListIdToCompareListId, + GetListIdByCustomerId $getListIdByCustomerId ) { $this->getCompareList = $getCompareList; $this->removeFromCompareList = $removeFromCompareList; $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + $this->getListIdByCustomerId = $getListIdByCustomerId; } /** @@ -89,6 +98,13 @@ public function resolve( throw new GraphQlInputException(__('"uid" value does not exist')); } + if ($userId = $context->getUserId()) { + $customerListId = $this->getListIdByCustomerId->execute($userId); + if ($listId === $customerListId) { + $this->removeFromCompareList($customerListId, $args); + } + } + try { $this->removeFromCompareList->execute($listId, $args['input']['products']); } catch (LocalizedException $exception) { @@ -99,4 +115,22 @@ public function resolve( return $this->getCompareList->execute($listId, $context); } + + /** + * Remove products from compare list + * + * @param int $listId + * @param array $args + * @throws GraphQlInputException + */ + private function removeFromCompareList(int $listId, array $args): void + { + try { + $this->removeFromCompareList->execute($listId, $args['input']['products']); + } catch (LocalizedException $exception) { + throw new GraphQlInputException( + __('Something was wrong during removing products from compare list') + ); + } + } } From dd5b44326784229d75136da44785c4f03e298261 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 6 Nov 2020 21:35:53 +0200 Subject: [PATCH 121/490] luma compatibility add list id for customer compare list --- .../Product/Compare/Item/Collection.php | 26 +++++++++++++++++++ .../Resolver/AddProductsToCompareList.php | 5 ++-- .../Model/Resolver/CreateCompareList.php | 7 +++-- .../Model/Service/AddToCompareList.php | 14 ++++++++-- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 7503b5fa17e4d..3f1a1d88211ff 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -287,6 +287,32 @@ public function getProductsByListId(int $listId): array return $this->getConnection()->fetchCol($select); } + /** + * Set list_id for customer compare item + * + * @param int $listId + * @param int $customerId + */ + public function setListIdToCustomerCompareItems(int $listId, int $customerId) + { + $table = $this->getTable('catalog_compare_item'); + $select = $this->getConnection()->select()-> + from( + $table + )->where( + 'customer_id = ?', + $customerId + ); + $customerCompareItems = $this->getConnection()->fetchCol($select); + foreach ($customerCompareItems as $itemId) { + $this->getConnection()->update( + $table, + ['list_id' => $listId], + ['catalog_compare_item_id = ?' => (int)$itemId] + ); + } + } + /** * Retrieve comapre products attribute set ids * diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index 689676aa8a81b..04d4ed8e1424e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -82,7 +82,6 @@ public function resolve( array $value = null, array $args = null ) { - $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); if (empty($args['input']['uid'])) { throw new GraphQlInputException(__('"uid" value must be specified.')); } @@ -100,13 +99,13 @@ public function resolve( if ($userId = $context->getUserId()) { $customerListId = $this->getListIdByCustomerId->execute($userId); if ($listId === $customerListId) { - $this->addProductToCompareList->execute($customerListId, $args['input']['products'], $storeId); + $this->addProductToCompareList->execute($customerListId, $args['input']['products'], $context); return $this->getCompareList->execute($customerListId, $context); } } - $this->addProductToCompareList->execute($listId, $args['input']['products'], $storeId); + $this->addProductToCompareList->execute($listId, $args['input']['products'], $context); return $this->getCompareList->execute($listId, $context); } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php index 64f706f84756a..9b0e8fd18298f 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CreateCompareList.php @@ -95,23 +95,22 @@ public function resolve( ) { $customerId = $context->getUserId(); $products = !empty($args['input']['products']) ? $args['input']['products'] : []; - $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); $generatedListId = $this->mathRandom->getUniqueHash(); $listId = 0; try { if ((0 === $customerId || null === $customerId)) { $listId = $this->createCompareList->execute($generatedListId); - $this->addProductToCompareList->execute($listId, $products, $storeId); + $this->addProductToCompareList->execute($listId, $products, $context); } if ($customerId) { $listId = $this->getListIdByCustomerId->execute($customerId); if ($listId) { - $this->addProductToCompareList->execute($listId, $products, $storeId); + $this->addProductToCompareList->execute($listId, $products, $context); } else { $listId = $this->createCompareList->execute($generatedListId, $customerId); - $this->addProductToCompareList->execute($listId, $products, $storeId); + $this->addProductToCompareList->execute($listId, $products, $context); } } } catch (LocalizedException $exception) { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index 88893b23c3d65..ef1f0ab46e51f 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -11,6 +11,7 @@ use Magento\Catalog\Model\ProductRepository; use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** * Service add product to compare list @@ -52,18 +53,23 @@ public function __construct( * * @param int $listId * @param array $products - * @param int $storeId + * @param ContextInterface $context * * @return int */ - public function execute(int $listId, array $products, int $storeId): int + public function execute(int $listId, array $products, ContextInterface $context): int { + $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); + $customerId = $context->getUserId(); if (count($products)) { $existedProducts = $this->itemCollection->getProductsByListId($listId); foreach ($products as $productId) { if (array_search($productId, $existedProducts) === false) { if ($this->productExists($productId)) { $item = $this->compareItemFactory->create(); + if ($customerId) { + $item->setCustomerId($customerId); + } $item->addProductData($productId); $item->setStoreId($storeId); $item->setListId($listId); @@ -73,6 +79,10 @@ public function execute(int $listId, array $products, int $storeId): int } } + if ($customerId) { + $this->itemCollection->setListIdToCustomerCompareItems($listId, $customerId); + } + return (int)$listId; } From 01ee9ea91b73ffe83452a4fe4fc2011163a3afdb Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Fri, 6 Nov 2020 15:25:41 -0600 Subject: [PATCH 122/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index aad1c4d831a11..b4cd75d9cc498 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -70,11 +70,11 @@ <!-- Start the consumer --> <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> - <reloadPage stepKey="refreshPage"/> + <reloadPage stepKey="refreshPage1"/> <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> - <reloadPage stepKey="refreshPage"/> + <reloadPage stepKey="refreshPage2"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> From 2e48ca1ea7c63372cc3e43a27c467638b6183350 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 6 Nov 2020 23:57:18 +0200 Subject: [PATCH 123/490] luma compatibility remove compare list --- .../Controller/Product/Compare/Clear.php | 1 + .../Controller/Product/Compare/Remove.php | 4 ++ .../Product/Compare/Item/Collection.php | 52 +++++++++++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php b/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php index 2703e9869bd47..81f63f3e75c54 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php @@ -31,6 +31,7 @@ public function execute() try { $items->clear(); + $items->removeCompareList($this->_customerSession->getCustomerId()); $this->messageManager->addSuccessMessage(__('You cleared the comparison list.')); $this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class)->calculate(); } catch (\Magento\Framework\Exception\LocalizedException $e) { diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php b/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php index f5d56dc9e6b0e..23bb7e0e3d459 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php @@ -7,6 +7,7 @@ namespace Magento\Catalog\Controller\Product\Compare; use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Exception\NoSuchEntityException; @@ -49,6 +50,9 @@ public function execute() $helper = $this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class); if ($item->getId()) { $item->delete(); + /** @var Collection $items */ + $items = $this->_itemCollectionFactory->create(); + $items->removeCompareList($this->_customerSession->getCustomerId()); $productName = $this->_objectManager->get(\Magento\Framework\Escaper::class) ->escapeHtml($product->getName()); $this->messageManager->addSuccessMessage( diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 3f1a1d88211ff..99ce8feb451e9 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -287,6 +287,7 @@ public function getProductsByListId(int $listId): array return $this->getConnection()->fetchCol($select); } + /** * Set list_id for customer compare item * @@ -295,24 +296,53 @@ public function getProductsByListId(int $listId): array */ public function setListIdToCustomerCompareItems(int $listId, int $customerId) { - $table = $this->getTable('catalog_compare_item'); - $select = $this->getConnection()->select()-> - from( - $table - )->where( - 'customer_id = ?', - $customerId - ); - $customerCompareItems = $this->getConnection()->fetchCol($select); - foreach ($customerCompareItems as $itemId) { + foreach ($this->getCustomerCompareItems($customerId) as $itemId) { $this->getConnection()->update( - $table, + $this->getTable('catalog_compare_item'), ['list_id' => $listId], ['catalog_compare_item_id = ?' => (int)$itemId] ); } } + /** + * Remove compare list if customer compare list empty + * + * @param int $customerId + */ + public function removeCompareList(int $customerId) + { + if (empty($this->getCustomerCompareItems($customerId))) { + $this->getConnection()->delete( + $this->getTable('catalog_compare_list'), + ['customer_id = ?' => $customerId] + ); + } + } + + /** + * Get customer compare items + * + * @param int|null $customerId + * @return array + */ + private function getCustomerCompareItems(?int $customerId): array + { + if ($customerId) { + $select = $this->getConnection()->select()-> + from( + $this->getTable('catalog_compare_item') + )->where( + 'customer_id = ?', + $customerId + ); + + return $this->getConnection()->fetchCol($select); + } + + return []; + } + /** * Retrieve comapre products attribute set ids * From 098a40792e4d11d6bf3daa6bc08fc3c1d03e845f Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 7 Nov 2020 11:21:30 +0200 Subject: [PATCH 124/490] minor changes --- .../Model/ResourceModel/Product/Compare/Item/Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index 99ce8feb451e9..76f566a364769 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -308,9 +308,9 @@ public function setListIdToCustomerCompareItems(int $listId, int $customerId) /** * Remove compare list if customer compare list empty * - * @param int $customerId + * @param int|null $customerId */ - public function removeCompareList(int $customerId) + public function removeCompareList(?int $customerId) { if (empty($this->getCustomerCompareItems($customerId))) { $this->getConnection()->delete( From 9bea792f606ab0b87e8bfed0ba1652e78ddf9a2a Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 7 Nov 2020 17:55:10 +0200 Subject: [PATCH 125/490] add Assert link action group --- .../ActionGroup/AssertLinkActionGroup.xml | 22 +++++++ .../Test/Mftf/Test/AdminPrivacyPolicyTest.xml | 59 +++++++++++++------ 2 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml new file mode 100644 index 0000000000000..6fa63d14b9612 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertLinkActionGroup"> + <annotations> + <description>Assert text and url of the links.</description> + </annotations> + <arguments> + <argument name="text" type="string"/> + <argument name="url" type="string"/> + </arguments> + + <seeLink userInput="{{text}}" url="{{url}}" stepKey="assertLinks"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml index b0fbdb8b5b596..8b0bf1dc963ff 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml @@ -23,70 +23,91 @@ <!-- Logging in Magento admin and checking for Privacy policy footer in dashboard --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <closeAdminNotification stepKey="closeAdminNotification"/> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkDashboard"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkDashboard"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in salesOrderPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSalesOrder"> <argument name="menuUiId" value="magento-sales-sales"/> <argument name="submenuUiId" value="magento-sales-sales-order"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSalesOrder"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSalesOrder"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in catalogProductsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCatalogProducts"> <argument name="menuUiId" value="magento-catalog-catalog"/> <argument name="submenuUiId" value="magento-catalog-catalog-products"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCatalogProducts"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCatalogProducts"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in customersAllCustomersPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomersAllCustomers"> <argument name="menuUiId" value="magento-customer-customer"/> <argument name="submenuUiId" value="magento-customer-customer-manage"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in marketingCatalogPriceRulePage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingCatalogPriceRule"> <argument name="menuUiId" value="magento-backend-marketing"/> <argument name="submenuUiId" value="magento-catalogrule-promo-catalog"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in contentBlocksPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentBlocks"> <argument name="menuUiId" value="magento-backend-content"/> <argument name="submenuUiId" value="magento-cms-cms-block"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkContentBlocks"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkContentBlocks"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in reportSearcbTermsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsSearchTerms"> <argument name="menuUiId" value="magento-reports-report"/> <argument name="submenuUiId" value="magento-search-report-search-term"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkReportsSearchTerms"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkReportsSearchTerms"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in storesAllStoresPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresAllStores"> <argument name="menuUiId" value="magento-backend-stores"/> <argument name="submenuUiId" value="magento-backend-system-store"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkStoresAllStores"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkStoresAllStores"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in systemImportPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemImport"> <argument name="menuUiId" value="magento-backend-system"/> <argument name="submenuUiId" value="magento-importexport-system-convert-import"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSystemImport"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSystemImport"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in findPartnersAndExtensionsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions"> <argument name="menuUiId" value="magento-marketplace-partners"/> <argument name="submenuUiId" value="magento-marketplace-partners"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"/> + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> </test> </tests> From b0aaa76cc3b577211401e9097b67eb3ea504e28a Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Sat, 7 Nov 2020 22:22:40 -0600 Subject: [PATCH 126/490] MC-38846: Custom address attributes are missing on checkout (Shipping address grid & Payment step) - Adding plugin to convert int to boolean --- .../frontend/web/js/model/address-converter.js | 15 +++++++++++++-- .../Model/Address/CustomAttributesProcessor.php | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js b/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js index a59ea7101f16c..d296999c88b53 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js @@ -27,7 +27,8 @@ define([ // clone address form data to new object var addressData = $.extend(true, {}, formData), region, - regionName = addressData.region; + regionName = addressData.region, + customAttributes; if (mageUtils.isObject(addressData.street)) { addressData.street = this.objectToArray(addressData.street); @@ -64,10 +65,20 @@ define([ addressData['custom_attributes'] = _.map( addressData['custom_attributes'], function (value, key) { - return { + customAttributes = { 'attribute_code': key, 'value': value }; + + if (typeof value === 'boolean') { + customAttributes = { + 'attribute_code': key, + 'value': value, + 'label': value === true ? 'Yes' : 'No' + }; + } + + return customAttributes; } ); } diff --git a/app/code/Magento/Customer/Model/Address/CustomAttributesProcessor.php b/app/code/Magento/Customer/Model/Address/CustomAttributesProcessor.php index d6e63e11ee453..0fd72a591899a 100644 --- a/app/code/Magento/Customer/Model/Address/CustomAttributesProcessor.php +++ b/app/code/Magento/Customer/Model/Address/CustomAttributesProcessor.php @@ -71,7 +71,7 @@ private function getAttributeLabels(array $customAttribute, string $customAttrib { $attributeOptionLabels = []; - if (!empty($customAttribute['value'])) { + if (isset($customAttribute['value']) && $customAttribute['value'] != null) { $customAttributeValues = explode(',', $customAttribute['value']); $attributeOptions = $this->attributeOptionManager->getItems( \Magento\Customer\Model\Indexer\Address\AttributeProvider::ENTITY, From 2eb6c596c3fe2436b5d284ba3d3af05b8f4adaff Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Mon, 9 Nov 2020 12:51:09 +0530 Subject: [PATCH 127/490] Added the admin_store configuration Fixture --- .../GenerateLoginCustomerTokenTest.php | 8 ++++---- .../login_as_customer_config_disable.php | 19 ------------------- .../login_as_customer_config_enable.php | 19 ------------------- ...gin_as_customer_config_enable_rollback.php | 19 ------------------- 4 files changed, 4 insertions(+), 61 deletions(-) delete mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php delete mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php delete mode 100755 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index b4ed89ae4502a..cb9d37485cf93 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -42,7 +42,7 @@ protected function setUp(): void * Verify with Admin email ID and Magento_LoginAsCustomer::login is enabled * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php - * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php + * @magentoConfigFixture admin_store login_as_customer/general/enabled 1 * @magentoApiDataFixture Magento/Customer/_files/customer.php * @throws Exception */ @@ -66,7 +66,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() * Verify with Admin email ID and Magento_LoginAsCustomer::login is disabled * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php - * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php + * @magentoConfigFixture admin_store login_as_customer/general/enabled 0 * @magentoApiDataFixture Magento/Customer/_files/customer.php * @throws Exception */ @@ -90,7 +90,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() * Verify with Customer Token in auth header * * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php + * @magentoConfigFixture admin_store login_as_customer/general/enabled 1 * @throws Exception */ public function testGenerateCustomerTokenLoginWithCustomerCredentials() @@ -115,7 +115,7 @@ public function testGenerateCustomerTokenLoginWithCustomerCredentials() * Test with invalid data. * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php - * @magentoApiDataFixture Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php + * @magentoConfigFixture admin_store login_as_customer/general/enabled 1 * * @dataProvider dataProviderInvalidInfo * @param string $adminUserName diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php deleted file mode 100755 index 706c024c53bff..0000000000000 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Config\Model\Config\Factory as ConfigFactory; - -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; -/** @var ConfigFactory $configFactory */ -$configFactory = $objectManager->get(ConfigFactory::class); - -$configModel = $configFactory->create(); -$configModel->setDataByPath($loginAsCustomerConfigPath, 0); -try { - $configModel->save(); -} catch (Exception $e) { -} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php deleted file mode 100755 index 426d2575f1547..0000000000000 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Config\Model\Config\Factory as ConfigFactory; - -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; -/** @var ConfigFactory $configFactory */ -$configFactory = $objectManager->get(ConfigFactory::class); - -$configModel = $configFactory->create(); -$configModel->setDataByPath($loginAsCustomerConfigPath, 1); -try { - $configModel->save(); -} catch (Exception $e) { -} diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php deleted file mode 100755 index 706c024c53bff..0000000000000 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Config\Model\Config\Factory as ConfigFactory; - -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -$loginAsCustomerConfigPath = 'login_as_customer/general/enabled'; -/** @var ConfigFactory $configFactory */ -$configFactory = $objectManager->get(ConfigFactory::class); - -$configModel = $configFactory->create(); -$configModel->setDataByPath($loginAsCustomerConfigPath, 0); -try { - $configModel->save(); -} catch (Exception $e) { -} From 5c5b75af980ffba325eb65a80d6be8ad9123dcc9 Mon Sep 17 00:00:00 2001 From: Krishna Kumar <kkumar@ztech.io> Date: Mon, 9 Nov 2020 17:53:10 +0530 Subject: [PATCH 128/490] Changed the admin integration file with custom role --- .../GenerateLoginCustomerTokenTest.php | 8 +-- .../Magento/LoginAsCustomer/_files/admin.php | 54 +++++++++++-------- .../LoginAsCustomer/_files/admin_rollback.php | 29 ++++++---- 3 files changed, 55 insertions(+), 36 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php index cb9d37485cf93..6b1762a73dc02 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php @@ -56,7 +56,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() $mutation, [], '', - $this->getAdminHeaderAuthentication('TestAdmin1', 'Magento777') + $this->getAdminHeaderAuthentication('TestAdmin1', \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD) ); $this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response); $this->assertIsArray($response['generateCustomerTokenAsAdmin']); @@ -82,7 +82,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() $mutation, [], '', - $this->getAdminHeaderAuthentication('TestAdmin1', 'Magento777') + $this->getAdminHeaderAuthentication('TestAdmin1', \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD) ); } @@ -151,7 +151,7 @@ public function dataProviderInvalidInfo(): array return [ 'invalid_admin_user_name' => [ 'TestAdmin(^%', - 'Magento777', + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD, 'customer@example.com', 'The account sign-in was incorrect or your account is disabled temporarily. ' . 'Please wait and try again later.' @@ -195,7 +195,7 @@ private function getQuery(string $customerEmail) : string */ public function getCustomerHeaderAuthentication( string $username = 'github@gmail.com', - string $password = 'Magento777' + string $password = \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD ): array { $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php index c138882efdd73..fc8cc3101a8d8 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php @@ -3,30 +3,38 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -use Magento\User\Model\UserFactory; -use Magento\User\Model\ResourceModel\User as UserResource; -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +declare(strict_types=1); -/** @var UserFactory $userFactory */ -$userFactory = $objectManager->get(UserFactory::class); -/** @var UserResource $userResource */ -$userResource = $objectManager->get(UserResource::class); +use Magento\Authorization\Model\RoleFactory; +use Magento\Authorization\Model\Role; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\User\Model\User; +use Magento\Authorization\Model\RulesFactory; +use Magento\Authorization\Model\Rules; -$adminInfo = [ - 'username' => 'TestAdmin1', - 'firstname' => 'test', - 'lastname' => 'test', - 'email' => 'testadmin1@gmail.com', - 'password' =>'Magento777', - 'interface_locale' => 'en_US', - 'is_active' => 1 -]; +//Creating a new admin user with a custom role to safely change role settings without affecting the main user's role. +/** @var Role $role */ +$role = Bootstrap::getObjectManager()->get(RoleFactory::class)->create(); +$role->setName('test_custom_role'); +$role->setData('role_name', $role->getName()); +$role->setRoleType(\Magento\Authorization\Model\Acl\Role\Group::ROLE_TYPE); +$role->setUserType((string)\Magento\Authorization\Model\UserContextInterface::USER_TYPE_ADMIN); +$role->save(); +/** @var Rules $rules */ +$rules = Bootstrap::getObjectManager()->get(RulesFactory::class)->create(); +$rules->setRoleId($role->getId()); +//Granted all permissions. +$rules->setResources([Bootstrap::getObjectManager()->get(\Magento\Framework\Acl\RootResource::class)->getId()]); +$rules->saveRel(); -$userModel = $userFactory->create(); -try { - $userModel->setData($adminInfo); - $userModel->setRoleId(1); - $userResource->save($userModel); -} catch (\Magento\Framework\Exception\AlreadyExistsException $e) { -} +/** @var User $user */ +$user = Bootstrap::getObjectManager()->create(User::class); +$user->setFirstname("John") + ->setLastname("Doe") + ->setUsername('TestAdmin1') + ->setPassword(\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD) + ->setEmail('testadmin1@gmail.com') + ->setIsActive(1) + ->setRoleId($role->getId()); +$user->save(); diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php index ed9b8923bc51b..1e78339bf7cf1 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php @@ -3,15 +3,26 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -use Magento\User\Model\UserFactory; -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +declare(strict_types=1); -/** @var UserFactory $userFactory */ -$userFactory = $objectManager->get(UserFactory::class); +use Magento\Authorization\Model\RoleFactory; +use Magento\Authorization\Model\Role; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\User\Model\User; +use Magento\Authorization\Model\RulesFactory; +use Magento\Authorization\Model\Rules; -$userModel = $userFactory->create(); -$userModel->loadByUsername('TestAdmin1'); -if ($userModel->getId()) { - $userModel->delete(); -} +//Deleting the user and the role. +/** @var User $user */ +$user = Bootstrap::getObjectManager()->create(User::class); +$user->load('TestAdmin1', 'username'); +$user->delete(); +/** @var Role $role */ +$role = Bootstrap::getObjectManager()->get(RoleFactory::class)->create(); +$role->load('test_custom_role', 'role_name'); +/** @var Rules $rules */ +$rules = Bootstrap::getObjectManager()->get(RulesFactory::class)->create(); +$rules->load($role->getId(), 'role_id'); +$rules->delete(); +$role->delete(); From 78f828567a008fc0a7c507457872219598a02af6 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 6 Nov 2020 17:17:16 -0600 Subject: [PATCH 129/490] MC-37729: Subtotal Cart Price Rule excludes product tax for fixed amount - Add "Subtotal (Incl. Tax)" to cart price rule condition - Add MFTF test --- .../Model/Rule/Condition/Address.php | 2 + .../Data/SalesRuleAddressConditionsData.xml | 1 + ...teCartPriceRuleWithSubtotalInclTaxTest.xml | 90 +++++++++++++++++++ .../Unit/Model/Rule/Condition/AddressTest.php | 65 ++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithSubtotalInclTaxTest.xml create mode 100644 app/code/Magento/SalesRule/Test/Unit/Model/Rule/Condition/AddressTest.php diff --git a/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php b/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php index cf6301cb31a9c..62c1cc086048b 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php +++ b/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php @@ -62,6 +62,7 @@ public function loadAttributeOptions() { $attributes = [ 'base_subtotal_with_discount' => __('Subtotal (Excl. Tax)'), + 'base_subtotal_total_incl_tax' => __('Subtotal (Incl. Tax)'), 'base_subtotal' => __('Subtotal'), 'total_qty' => __('Total Items Quantity'), 'weight' => __('Total Weight'), @@ -99,6 +100,7 @@ public function getInputType() { switch ($this->getAttribute()) { case 'base_subtotal': + case 'base_subtotal_total_incl_tax': case 'weight': case 'total_qty': return 'numeric'; diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleAddressConditionsData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleAddressConditionsData.xml index cc695b347c4fb..727222213b118 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleAddressConditionsData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleAddressConditionsData.xml @@ -10,6 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="SalesRuleAddressConditions" type="SalesRuleConditionAttribute"> <data key="subtotal">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</data> + <data key="base_subtotal_total_incl_tax">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal_total_incl_tax</data> <data key="totalItemsQty">Magento\SalesRule\Model\Rule\Condition\Address|total_qty</data> <data key="totalWeight">Magento\SalesRule\Model\Rule\Condition\Address|weight</data> <data key="shippingMethod">Magento\SalesRule\Model\Rule\Condition\Address|shipping_method</data> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithSubtotalInclTaxTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithSubtotalInclTaxTest.xml new file mode 100644 index 0000000000000..a52e8e10459e5 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithSubtotalInclTaxTest.xml @@ -0,0 +1,90 @@ +<?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="AdminCreateCartPriceRuleWithSubtotalInclTaxTest"> + <annotations> + <stories value="Create Sales Rule"/> + <title value="Create Cart Price Rule with Subtotal Incl Tax"/> + <description value="Test that cart price rule with Subtotal Incl Tax works correctly"/> + <severity value="CRITICAL"/> + <useCaseId value="MC-37729"/> + <testCaseId value="MC-38971"/> + <group value="SalesRule"/> + </annotations> + <before> + <!--Login to backend--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Create tax rate for US-CA-*--> + <createData entity="defaultTaxRate" stepKey="taxRate"/> + <!--Create tax rule--> + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule"> + <argument name="taxRate" value="$$taxRate$$"/> + <argument name="taxRule" value="SimpleTaxRule"/> + </actionGroup> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="product"> + <field key="price">100</field> + </createData> + <!--Create cart price rule with no coupon and 50% discount--> + <createData entity="ApiCartRule" stepKey="createCartPriceRule"/> + <!--Add "subtotal incl tax > 100" condition to cart price rule--> + <amOnPage url="{{AdminCartPriceRuleEditPage.url($$createCartPriceRule.rule_id$$)}}" stepKey="openEditRule"/> + <actionGroup ref="SetCartAttributeConditionForCartPriceRuleActionGroup" stepKey="setCartAttributeConditionForCartPriceRule"> + <argument name="attributeName" value="{{SalesRuleAddressConditions.base_subtotal_total_incl_tax}}"/> + <argument name="operatorType" value="greater than"/> + <argument name="value" value="100"/> + </actionGroup> + </before> + <after> + <!--Delete tax rule--> + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}" /> + </actionGroup> + <!--Delete tax rate--> + <deleteData createDataKey="taxRate" stepKey="deleteTaxRate"/> + <!--Delete product--> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <!--Delete cart price rule--> + <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!--Open product --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct2Page"> + <argument name="product" value="$$product$$"/> + </actionGroup> + <!--Add to cart --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product2AddToCart"/> + <!--Click on mini cart--> + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> + <!--Click on view and edit cart link--> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> + <!--Assert that tax and discount are not applied by default--> + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertTaxAndDiscountIsNotApplied"> + <argument name="subtotal" value="$100.00"/> + <argument name="shipping" value="$5.00"/> + <argument name="shippingMethod" value="Flat Rate - Fixed"/> + <argument name="total" value="$105.00"/> + </actionGroup> + <dontSee selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="assertDiscountIsNotApplied"/> + <!--Open "Estimate Shipping and Tax" section and fill US-CA address --> + <actionGroup ref="StorefrontCartEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxSection"> + <argument name="estimateAddress" value="EstimateAddressCalifornia"/> + </actionGroup> + <!--Assert that tax and discount are applied by to total amount--> + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertTaxAndDiscountIsApplied"> + <argument name="subtotal" value="$100.00"/> + <argument name="shipping" value="$5.00"/> + <argument name="shippingMethod" value="Flat Rate - Fixed"/> + <argument name="total" value="$60.00"/> + </actionGroup> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-$50.00" stepKey="assertDiscountIsApplied"/> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Condition/AddressTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Condition/AddressTest.php new file mode 100644 index 0000000000000..70036c06922c5 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Condition/AddressTest.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SalesRule\Test\Unit\Model\Rule\Condition; + +use Magento\SalesRule\Model\Rule\Condition\Address; +use PHPUnit\Framework\TestCase; + +/** + * Test for address rule condition + */ +class AddressTest extends TestCase +{ + /** + * @var Address + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $context = $this->createMock(\Magento\Rule\Model\Condition\Context::class); + $directoryCountry = $this->createMock(\Magento\Directory\Model\Config\Source\Country::class); + $directoryAllregion = $this->createMock(\Magento\Directory\Model\Config\Source\Allregion::class); + $shippingAllmethods = $this->createMock(\Magento\Shipping\Model\Config\Source\Allmethods::class); + $paymentAllmethods = $this->createMock(\Magento\Payment\Model\Config\Source\Allmethods::class); + $this->model = new Address( + $context, + $directoryCountry, + $directoryAllregion, + $shippingAllmethods, + $paymentAllmethods + ); + } + + /** + * Test that all attributes are present in options list + */ + public function testLoadAttributeOptions(): void + { + $attributes = [ + 'base_subtotal_with_discount', + 'base_subtotal_total_incl_tax', + 'base_subtotal', + 'total_qty', + 'weight', + 'payment_method', + 'shipping_method', + 'postcode', + 'region', + 'region_id', + 'country_id', + ]; + + $this->model->loadAttributeOptions(); + $this->assertEquals($attributes, array_keys($this->model->getAttributeOption())); + } +} From 83e45ae5fd20f8aa167c970bf4b25eb0cde9df98 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 9 Nov 2020 13:52:49 -0600 Subject: [PATCH 130/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...nCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index b4cd75d9cc498..71ca3e8a79060 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -20,9 +20,6 @@ </annotations> <before> - <!-- Start the consumer --> - <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue"/> - <!-- Enable Zero Subtotal Checkout --> <magentoCLI command="config:set {{EnableZeroSubtotalCheckoutConfigData.path}} {{EnableZeroSubtotalCheckoutConfigData.value}}" stepKey="enableZeroSubtotalCheckout"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -50,10 +47,6 @@ <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - - <!-- Start the consumer --> - <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue1"/> - <!--Create new customer order--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> @@ -70,7 +63,6 @@ <!-- Start the consumer --> <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> - <reloadPage stepKey="refreshPage1"/> <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> From 1143af933f5cf6ab4a2c49d583fb3cd0a1c46c02 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 9 Nov 2020 13:54:07 -0600 Subject: [PATCH 131/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 71ca3e8a79060..dcb27595cf042 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -69,6 +69,8 @@ <reloadPage stepKey="refreshPage2"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> + <reloadPage stepKey="refreshPage1"/> + <!-- Cancel the Order --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> From a8c96887994a53e0503f49a64a689fcd76d69c7b Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 9 Nov 2020 17:08:04 -0600 Subject: [PATCH 132/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- ...elTheCreatedOrderWithZeroSubtotalCheckoutTest.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index dcb27595cf042..21ced2e2df278 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -35,7 +35,7 @@ <field key="price">10.00</field> </createData> - <!-- Create a slaes rule with fixed discount --> + <!-- Create a sales rule with fixed discount --> <createData entity="SalesRuleNoCouponWithFixedDiscount" stepKey="createSalesRule"/> </before> <after> @@ -62,14 +62,18 @@ <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder" /> <!-- Start the consumer --> - <magentoCLI command="queue:consumers:start sales.rule.update.coupon.usage --max-messages=100" stepKey="startMessageQueue2"/> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> + </actionGroup> <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> - <reloadPage stepKey="refreshPage2"/> + <reloadPage stepKey="refreshPage"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> - <reloadPage stepKey="refreshPage1"/> + <!-- Refresh the page --> + <reloadPage stepKey="refreshPageAgain"/> <!-- Cancel the Order --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> From 396ab4de86c1fcd9952c691a29d5a01acd208e79 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 9 Nov 2020 17:08:22 -0600 Subject: [PATCH 133/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Test/Mftf/Data/SalesRuleQueueData.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml new file mode 100644 index 0000000000000..1e3cf57e8777b --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml @@ -0,0 +1,15 @@ +<?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="SalesRuleConsumerData"> + <data key="consumerName">sales.rule.update.coupon.usage</data> + <data key="messageLimit">100</data> + </entity> +</entities> From b77d2296a68b16fd8a102b1216de5803293486cd Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@adobe.com> Date: Mon, 9 Nov 2020 17:11:11 -0600 Subject: [PATCH 134/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 74542be376c45..84b32beceb06e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -58,11 +58,15 @@ <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="Message is added to queue, wait to get your coupons soon" stepKey="seeSuccessMessage"/> - <!-- Start message queue for export consumer --> + <!-- Start message queue for export consumer and coupon processing --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/> </actionGroup> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startSalesRuleMessageQueue"> + <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> + </actionGroup> <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> <comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitFormToReload1"/> <conditionalClick selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" From 98d1258488a2768b0002a3d3d1d42f38bd14234e Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Tue, 10 Nov 2020 16:53:33 -0600 Subject: [PATCH 135/490] MC-37484: Cart query error when trying to switch store view --- .../Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php | 1 + .../QuoteGraphQl/Model/Resolver/SetBillingAddressOnCart.php | 1 + .../QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php | 1 + .../Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php | 1 + .../Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php index ddd7d25943baa..6a53d976d59b3 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php @@ -85,6 +85,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new LocalizedException(__($e->getMessage()), $e); } + $cart = $this->getCartForUser->execute($maskedCartId, $currentUserId, $storeId); return [ 'cart' => [ 'model' => $cart, diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetBillingAddressOnCart.php index eb82510003fc7..55725e9fcce2b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetBillingAddressOnCart.php @@ -69,6 +69,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->checkCartCheckoutAllowance->execute($cart); $this->setBillingAddressOnCart->execute($context, $cart, $billingAddress); + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php index e1cd9c18d9873..911078fd029f1 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php @@ -69,6 +69,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->checkCartCheckoutAllowance->execute($cart); $this->setShippingMethodsOnCart->execute($context, $cart, $shippingMethods); + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php index 005baaad0e1e5..8419e50197276 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php @@ -83,6 +83,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new GraphQlInputException(__($e->getMessage()), $e); } + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ 'model' => $cart, diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php index 703e30314ef5f..10b38abaa7f0a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php @@ -316,7 +316,7 @@ public function testUpdateGiftMessageCartForItem() $query = $this->getUpdateGiftMessageQuery($messageTo, $messageFrom, $message); foreach ($this->graphQlMutation($query)['updateCartItems']['cart']['items'] as $item) { self::assertArrayHasKey('gift_message', $item); - self::assertSame(null, $item['gift_message']); + self::assertSame(['to' => '', 'from' => '', 'message' => ''], $item['gift_message']); } } From 1c6672ebaa52e4bf8c4e3cca1028a49c9883638d Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 11 Nov 2020 12:38:12 +0200 Subject: [PATCH 136/490] product review DataProvider sorting, integration test --- .../Product/ReviewDataProvider.php | 31 ++++-- .../Product/ReviewDataProviderTest.php | 104 ++++++++++++++++++ 2 files changed, 123 insertions(+), 12 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index 27cb887e89636..c41bee58863db 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -5,14 +5,14 @@ */ namespace Magento\Review\Ui\DataProvider\Product; +use Magento\Framework\Api\Filter; use Magento\Framework\App\RequestInterface; use Magento\Ui\DataProvider\AbstractDataProvider; use Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory; use Magento\Review\Model\ResourceModel\Review\Product\Collection; -use Magento\Review\Model\Review; /** - * DataProvider Product ReviewDataProvider + * DataProvider for product reviews * * @api * @@ -66,13 +66,7 @@ public function getData() $this->getCollection()->addEntityFilter($this->request->getParam('current_product_id', 0)) ->addStoreData(); - $params = $this->request->getParams(); - if (isset($params['sorting'])) { - $sorting = $params['sorting']; - $field = $sorting['field']; - $direction = $sorting['direction']; - $this->getCollection()->getSelect()->order($field . ' ' . $direction); - } + $this->applySorting(); $arrItems = [ 'totalRecords' => $this->getCollection()->getSize(), @@ -86,12 +80,26 @@ public function getData() return $arrItems; } + /** + * Apply sorting if it set + * + * @return void + */ + private function applySorting(): void + { + $sorting = $this->request->getParam('sorting'); + if (is_array($sorting)) { + $select = $this->getCollection()->getSelect(); + $select->order($sorting['field'] . ' ' . $sorting['direction']); + } + } + /** * @inheritdoc * @since 100.1.0 - * @return mixed|$this + * @return void */ - public function addFilter(\Magento\Framework\Api\Filter $filter) + public function addFilter(Filter $filter): void { $field = $filter->getField(); @@ -108,6 +116,5 @@ public function addFilter(\Magento\Framework\Api\Filter $filter) } parent::addFilter($filter); - return $this; } } diff --git a/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php new file mode 100644 index 0000000000000..f23a0261fe629 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Review\Ui\DataProvider\Product; + +use Magento\Framework\App\RequestInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test for \Magento\Review\Ui\DataProvider\Product\ReviewDataProvider. + */ +class ReviewDataProviderTest extends TestCase +{ + /** + * @var array + */ + private $modelParams = [ + 'name' => 'review_listing_data_source', + 'primaryFieldName' => 'review_id', + 'requestFieldName' => 'entity_id', + ]; + + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + } + + /** + * Sorting dataProvider test + * + * @magentoDataFixture Magento/Review/_files/different_reviews.php + * @dataProvider sortingDataProvider + * + * @param array $sorting + * @param array $expectedSortedTitles + * @return void + */ + public function testSorting(array $sorting, array $expectedSortedTitles): void + { + $request = $this->objectManager->create(RequestInterface::class); + $request->setParam('sorting', $sorting); + $request->setParam('current_product_id', 1); + + $dataProvider = $this->objectManager->create( + ReviewDataProvider::class, + array_merge($this->modelParams, ['request' => $request]) + ); + + $result = $dataProvider->getData(); + + $this->assertEquals($this->getItemsField($result, 'title'), $expectedSortedTitles); + } + + /** + * Return items field data + * + * @param array $arrItems + * @param string $field + * @return array + */ + private function getItemsField(array $arrItems, string $field): array + { + $data = []; + foreach ($arrItems['items'] as $review) { + $data[] = $review[$field]; + } + + return $data; + } + + /** + * DataProvider for testSorting + * + * @return array + */ + public function sortingDataProvider(): array + { + return [ + [ + ['field' => 'title', 'direction' => 'asc'], + ['1 filter second review', '2 filter first review', 'Review Summary'], + ], + [ + ['field' => 'title', 'direction' => 'desc'], + ['Review Summary', '2 filter first review', '1 filter second review'], + ], + ]; + } +} From 9bd848ace10de40c7842ba222f208c873427152a Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 11 Nov 2020 14:22:18 +0200 Subject: [PATCH 137/490] fix unit --- .../Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php index bdbf5fe75a498..62766dc966a32 100644 --- a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php +++ b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php @@ -81,10 +81,10 @@ public function testGetData() $this->collectionMock->expects($this->once()) ->method('addStoreData') ->willReturnSelf(); - $this->requestMock->expects($this->once()) + $this->requestMock->expects($this->exactly(2)) ->method('getParam') - ->with('current_product_id', 0) - ->willReturn(1); + ->withConsecutive(['current_product_id', 0], ['sorting']) + ->willReturnOnConsecutiveCalls(1, null); $this->assertSame($expected, $this->model->getData()); } From a4f66bd38ebf2d889dbc90ca517d2c4ef1f8869f Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Wed, 11 Nov 2020 11:25:51 -0600 Subject: [PATCH 138/490] ISSUE-30880 - Add CSP entry to allow google analytics ajax --- app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml b/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml index d700b0e9e7668..6d8d42a5d3f8f 100644 --- a/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml +++ b/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml @@ -14,6 +14,11 @@ <value id="google_analytics" type="host">www.google-analytics.com</value> </values> </policy> + <policy id="connect-src"> + <values> + <value id="google_analytics" type="host">www.google-analytics.com</value> + </values> + </policy> <policy id="img-src"> <values> <value id="google_ad_services" type="host">www.googleadservices.com</value> From 55172bfd643757335ddc79723527ee4f20a3b449 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Wed, 11 Nov 2020 13:22:04 -0600 Subject: [PATCH 139/490] MC-38746: Performance degradation due to multiple calls of /guest-carts/{cart_id}/totals-information endpoint - Reverted #18700 PR that causes redundant calls of totals-information web-api --- .../view/frontend/web/js/model/cart/estimate-service.js | 1 - .../frontend/js/model/cart/estimate-service.test.js | 7 ------- 2 files changed, 8 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js index fd12eed76ed50..71e6c39b4e319 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js @@ -80,5 +80,4 @@ define([ quote.shippingAddress.subscribe(estimateTotalsAndUpdateRates); quote.shippingMethod.subscribe(estimateTotalsShipping); quote.billingAddress.subscribe(estimateTotalsBilling); - customerData.get('cart').subscribe(estimateTotalsShipping); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js index ce9c98c9d2560..3d8325a3ecd54 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js @@ -150,12 +150,5 @@ define([ }); expect(mocks['Magento_Checkout/js/model/cart/totals-processor/default'].estimateTotals).toHaveBeenCalled(); }); - - it('test subscribe when cart data was changed', function () { - mocks['Magento_Customer/js/customer-data'].get('cart')({ - dataId: 2 - }); - expect(mocks['Magento_Checkout/js/model/cart/totals-processor/default'].estimateTotals).toHaveBeenCalled(); - }); }); }); From 0a0add81633c40ed43998863b0ddb46be6652e77 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Wed, 11 Nov 2020 16:40:10 -0600 Subject: [PATCH 140/490] MC-37484: Cart query error when trying to switch store view --- .../Model/Resolver/CartItemPrices.php | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index d4ced5b8b97b0..da5f0efcedf2b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -11,34 +11,13 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Quote\Model\Cart\Totals; use Magento\Quote\Model\Quote\Item; -use Magento\Quote\Model\Quote\TotalsCollector; /** * @inheritdoc */ class CartItemPrices implements ResolverInterface { - /** - * @var TotalsCollector - */ - private $totalsCollector; - - /** - * @var Totals - */ - private $totals; - - /** - * @param TotalsCollector $totalsCollector - */ - public function __construct( - TotalsCollector $totalsCollector - ) { - $this->totalsCollector = $totalsCollector; - } - /** * @inheritdoc */ @@ -49,12 +28,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } /** @var Item $cartItem */ $cartItem = $value['model']; - - if (!$this->totals) { - // The totals calculation is based on quote address. - // But the totals should be calculated even if no address is set - $this->totals = $this->totalsCollector->collectQuoteTotals($cartItem->getQuote()); - } $currencyCode = $cartItem->getQuote()->getQuoteCurrencyCode(); return [ From b21be308c2a369bcbcde2db5921faaf8b2b237af Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Wed, 11 Nov 2020 17:50:28 -0600 Subject: [PATCH 141/490] - Modified assigncomparelust output to match schema in architecture - Added validations for list_id of one customer cannot be accessed by other customer - Added item_count - tests pending for above --- .../Model/CompareListIdToMaskedListId.php | 8 +++++- .../Model/MaskedListIdToCompareListId.php | 10 ++++--- .../Resolver/AddProductsToCompareList.php | 21 ++++++++------- .../Resolver/AssignCompareListToCustomer.php | 27 ++++++++++++++++--- .../Model/Resolver/CompareList.php | 7 ++++- .../Model/Resolver/DeleteCompareList.php | 6 ++++- .../RemoveProductsFromCompareList.php | 6 ++++- .../Model/Service/AddToCompareList.php | 1 + .../Customer/SetCustomerToCompareList.php | 8 +++--- .../Model/Service/GetComparableItems.php | 15 ++--------- .../Model/Service/GetCompareList.php | 14 +++++++--- .../CompareListGraphQl/etc/schema.graphqls | 13 +++++---- .../GraphQl/CompareList/CompareListTest.php | 22 ++++++++++----- 13 files changed, 105 insertions(+), 53 deletions(-) diff --git a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php index f17244a2ed836..a911980b98894 100644 --- a/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php +++ b/app/code/Magento/Catalog/Model/CompareListIdToMaskedListId.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Model; use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; +use Magento\Framework\Exception\LocalizedException; /** * CompareListId to MaskedListId resolver @@ -41,12 +42,17 @@ public function __construct( * * @param int $listId * + * @param int|null $customerId * @return null|string + * @throws LocalizedException */ - public function execute(int $listId): ?string + public function execute(int $listId, int $customerId = null): ?string { $compareList = $this->compareListFactory->create(); $this->compareListResource->load($compareList, $listId, 'list_id'); + if ((int)$compareList->getCustomerId() !== (int)$customerId) { + throw new LocalizedException(__('This customer is not authorized to access this list')); + } return $compareList->getListIdMask() ?? null; } } diff --git a/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php index 47cea9dc09ce7..cd1506c970763 100644 --- a/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php +++ b/app/code/Magento/Catalog/Model/MaskedListIdToCompareListId.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Model; use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as CompareListResource; +use Magento\Framework\Exception\LocalizedException; /** * MaskedListId to ListId resolver @@ -40,14 +41,17 @@ public function __construct( * Get maskedId by listId * * @param string $maskedListId - * + * @param int $customerId * @return int + * @throws LocalizedException */ - public function execute(string $maskedListId): int + public function execute(string $maskedListId, int $customerId = null): int { $compareList = $this->compareListFactory->create(); $this->compareListResource->load($compareList, $maskedListId, 'list_id_mask'); - + if ((int)$compareList->getCustomerId() !== (int)$customerId) { + throw new LocalizedException(__('This customer is not authorized to access this list')); + } return (int)$compareList->getListId(); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php index 04d4ed8e1424e..2aab3a0cb266e 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AddProductsToCompareList.php @@ -11,6 +11,7 @@ use Magento\CompareListGraphQl\Model\Service\AddToCompareList; use Magento\CompareListGraphQl\Model\Service\Customer\GetListIdByCustomerId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -90,23 +91,23 @@ public function resolve( throw new GraphQlInputException(__('"products" value must be specified.')); } - $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid']); + try { + $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid'], $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } + if (!$listId) { throw new GraphQlInputException(__('"uid" value does not exist')); } - if ($userId = $context->getUserId()) { - $customerListId = $this->getListIdByCustomerId->execute($userId); - if ($listId === $customerListId) { - $this->addProductToCompareList->execute($customerListId, $args['input']['products'], $context); - - return $this->getCompareList->execute($customerListId, $context); - } + try { + $this->addProductToCompareList->execute($listId, $args['input']['products'], $context); + } catch (\Exception $exception) { + throw new GraphQlInputException(__($exception->getMessage())); } - $this->addProductToCompareList->execute($listId, $args['input']['products'], $context); - return $this->getCompareList->execute($listId, $context); } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index 6d847e3f05c4c..d3597ebdb1021 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\CompareListGraphQl\Model\Service\Customer\SetCustomerToCompareList; +use Magento\CompareListGraphQl\Model\Service\GetCompareList; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -32,16 +33,23 @@ class AssignCompareListToCustomer implements ResolverInterface */ private $maskedListIdToCompareListId; + /** + * @var GetCompareList + */ + private $getCompareList; + /** * @param SetCustomerToCompareList $setCustomerToCompareList * @param MaskedListIdToCompareListId $maskedListIdToCompareListId */ public function __construct( SetCustomerToCompareList $setCustomerToCompareList, - MaskedListIdToCompareListId $maskedListIdToCompareListId + MaskedListIdToCompareListId $maskedListIdToCompareListId, + GetCompareList $getCompareList ) { $this->setCustomerToCompareList = $setCustomerToCompareList; $this->maskedListIdToCompareListId = $maskedListIdToCompareListId; + $this->getCompareList = $getCompareList; } /** @@ -73,12 +81,21 @@ public function resolve( throw new GraphQlInputException(__('Customer must be logged')); } - $listId = $this->maskedListIdToCompareListId->execute($args['uid']); - $result = false; + try { + $listId = $this->maskedListIdToCompareListId->execute($args['uid']); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } if ($listId) { try { $result = $this->setCustomerToCompareList->execute($listId, $context->getUserId()); + if ($result) { + return [ + 'result' => true, + 'compare_list' => $this->getCompareList->execute($listId, $context) + ]; + } } catch (LocalizedException $exception) { throw new GraphQlInputException( __('Something was wrong during assigning customer.') @@ -86,6 +103,8 @@ public function resolve( } } - return $result; + return [ + 'result' => false + ]; } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php index ca1314d8ec15e..861f3ce36d555 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/CompareList.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\MaskedListIdToCompareListId; use Magento\CompareListGraphQl\Model\Service\GetCompareList; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -69,7 +70,11 @@ public function resolve( throw new GraphQlInputException(__('"uid" value must be specified')); } - $listId = $this->maskedListIdToCompareListId->execute($args['uid']); + try { + $listId = $this->maskedListIdToCompareListId->execute($args['uid'], $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } if (!$listId) { return null; diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php index 80ed98e6c776c..a811478718985 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/DeleteCompareList.php @@ -87,7 +87,11 @@ public function resolve( throw new GraphQlInputException(__('"uid" value must be specified')); } - $listId = $this->maskedListIdToCompareListId->execute($args['uid']); + try { + $listId = $this->maskedListIdToCompareListId->execute($args['uid'], $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } $removed = ['result' => false]; if ($userId = $context->getUserId()) { diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php index 2e78e351ae64c..6e4e4d8951cb9 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/RemoveProductsFromCompareList.php @@ -92,7 +92,11 @@ public function resolve( throw new GraphQlInputException(__('"uid" value must be specified.')); } - $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid']); + try { + $listId = $this->maskedListIdToCompareListId->execute($args['input']['uid'], $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } if (!$listId) { throw new GraphQlInputException(__('"uid" value does not exist')); diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index ef1f0ab46e51f..1a0aace67b6c5 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -56,6 +56,7 @@ public function __construct( * @param ContextInterface $context * * @return int + * @throws \Exception */ public function execute(int $listId, array $products, ContextInterface $context): int { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php index 901a04b674594..c496a0ced5933 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php @@ -55,13 +55,13 @@ public function __construct( * @param int $listId * @param int $customerId * - * @return bool + * @return CompareList * * @throws GraphQlAuthenticationException * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException */ - public function execute(int $listId, int $customerId): bool + public function execute(int $listId, int $customerId): ?CompareList { if ($this->validateCustomer->execute($customerId)) { /** @var CompareList $compareListModel */ @@ -69,9 +69,9 @@ public function execute(int $listId, int $customerId): bool $this->resourceCompareList->load($compareList, $listId, 'list_id'); $compareList->setCustomerId($customerId); $this->resourceCompareList->save($compareList); - return true; + return $compareList; } - return false; + return null; } } diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php index 367d37013253d..1cf42553718fd 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetComparableItems.php @@ -8,14 +8,12 @@ namespace Magento\CompareListGraphQl\Model\Service; use Magento\Catalog\Block\Product\Compare\ListCompare; -use Magento\Catalog\Model\CompareListIdToMaskedListId; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ProductRepository; use Magento\CompareListGraphQl\Model\Service\Collection\GetComparableItemsCollection as ComparableItemsCollection; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; -use Magento\Store\Api\Data\StoreInterface; /** * Get comparable products @@ -37,27 +35,19 @@ class GetComparableItems */ private $productRepository; - /** - * @var CompareListIdToMaskedListId - */ - private $compareListIdToMaskedListId; - /** * @param ListCompare $listCompare * @param ComparableItemsCollection $comparableItemsCollection * @param ProductRepository $productRepository - * @param CompareListIdToMaskedListId $compareListIdToMaskedListId */ public function __construct( ListCompare $listCompare, ComparableItemsCollection $comparableItemsCollection, - ProductRepository $productRepository, - CompareListIdToMaskedListId $compareListIdToMaskedListId + ProductRepository $productRepository ) { $this->blockListCompare = $listCompare; $this->comparableItemsCollection = $comparableItemsCollection; $this->productRepository = $productRepository; - $this->compareListIdToMaskedListId = $compareListIdToMaskedListId; } /** @@ -72,11 +62,10 @@ public function __construct( public function execute(int $listId, ContextInterface $context) { $items = []; - $maskedListId = $this->compareListIdToMaskedListId->execute($listId); foreach ($this->comparableItemsCollection->execute($listId, $context) as $item) { /** @var Product $item */ $items[] = [ - 'uid' => $maskedListId, + 'uid' => $item->getId(), 'product' => $this->getProductData((int)$item->getId()), 'attributes' => $this->getProductComparableAttributes($listId, $item, $context) ]; diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php index dbd7cd9c30da2..5cef555479838 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/GetCompareList.php @@ -8,6 +8,7 @@ namespace Magento\CompareListGraphQl\Model\Service; use Magento\Catalog\Model\CompareListIdToMaskedListId; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; @@ -57,11 +58,18 @@ public function __construct( */ public function execute(int $listId, ContextInterface $context) { - $maskedListId = $this->compareListIdToMaskedListId->execute($listId); + try { + $maskedListId = $this->compareListIdToMaskedListId->execute($listId, $context->getUserId()); + } catch (LocalizedException $exception) { + throw new GraphQlInputException(__($exception->getMessage())); + } + $comparableItems = $this->comparableItemsService->execute($listId, $context); + return [ 'uid' => $maskedListId, - 'items' => $this->comparableItemsService->execute($listId, $context), - 'attributes' => $this->comparableAttributesService->execute($listId, $context) + 'items' => $comparableItems, + 'attributes' => $this->comparableAttributesService->execute($listId, $context), + 'item_count' => count($comparableItems) ]; } } diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 5f643e792def3..31b4743a30b51 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -3,13 +3,10 @@ type ComparableItem { uid: ID! - product: ComparableProduct! + product: ProductInterface! attributes: [ProductAttribute]! @doc(description: "Product comparable attributes") } -type ComparableProduct implements ProductInterface { -} - type ProductAttribute { code: String! @doc(description:"Attribute code") value: String! @doc(description:"Attribute display value") @@ -24,6 +21,7 @@ type CompareList { uid: ID! @doc(description: "Compare list id") items: [ComparableItem] @doc(description: "Comparable products") attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") + item_count: Int! } type Customer { @@ -38,7 +36,7 @@ type Mutation { createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to compare list") removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from compare list") - assignCompareListToCustomer(uid: ID!): Boolean @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") + assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete compare list") } @@ -59,3 +57,8 @@ input RemoveProductsFromCompareListInput { type DeleteCompareListOutput { result: Boolean! } + +type AssignCompareListToCustomerOutput { + result: Boolean! + compare_list: CompareList +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php index a8543fee28d47..3f522199974cd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php @@ -62,7 +62,7 @@ public function testCreateCompareListWithProducts() uid items { product { - sku + sku } } } @@ -110,7 +110,7 @@ public function testRemoveProductFromCompareList() uid items { product { - sku + sku } } } @@ -138,7 +138,7 @@ public function testGetCompareList() uid items { product { - sku + sku } } } @@ -197,7 +197,7 @@ public function testAssignCompareListToCustomer() uid items { product { - sku + sku } } } @@ -215,7 +215,15 @@ public function testAssignCompareListToCustomer() $assignCompareListToCustomer = <<<MUTATION mutation { - assignCompareListToCustomer(uid: "{$uid}") + assignCompareListToCustomer(uid: "{$uid}"){ + result + compare_list { + uid + items { + uid + } + } + } } MUTATION; $assignResponse = $this->graphQlMutation( @@ -224,7 +232,7 @@ public function testAssignCompareListToCustomer() '', $this->getCustomerAuthHeaders($currentEmail, $currentPassword) ); - $this->assertTrue($assignResponse['assignCompareListToCustomer']); + $this->assertTrue($assignResponse['assignCompareListToCustomer']['result']); $customerAssignedResponse = $this->graphQlQuery( $customerQuery, @@ -286,7 +294,7 @@ private function addProductsToCompareList($uid): array uid items { product { - sku + sku } } } From 0adbddbe601f2db77fbd1c70116ad70ec87c6014 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 11 Nov 2020 22:47:04 -0600 Subject: [PATCH 142/490] MC-38340: GraphQL code changes for a consistent object uid --- .../Category/CategoryUidsArgsProcessor.php | 69 +++++++++++++++++++ .../Model/Category/Hydrator.php | 1 + .../Model/Resolver/CategoriesQuery.php | 20 ++++-- .../Category/DataProvider/Breadcrumbs.php | 1 + .../Model/Resolver/CategoryList.php | 21 ++++-- .../Model/Resolver/Product/EntityIdToId.php | 5 +- .../Model/Resolver/Product/EntityIdToUid.php | 59 ++++++++++++++++ .../Resolver/Product/MediaGalleryEntries.php | 1 + .../Model/Resolver/Product/Options.php | 8 ++- ...ProductCollectionSearchCriteriaBuilder.php | 2 +- .../Query/CategoryUidArgsProcessor.php | 68 ++++++++++++++++++ .../Model/Resolver/Products/Query/Filter.php | 45 ++++++++---- .../Model/Resolver/Products/Query/Search.php | 34 ++++++--- .../Model/Resolver/RootCategoryId.php | 3 + .../Model/Resolver/RootCategoryUid.php | 26 +++++++ app/code/Magento/CatalogGraphQl/etc/di.xml | 13 +++- .../CatalogGraphQl/etc/schema.graphqls | 42 ++++++----- .../Model/Options/Collection.php | 28 ++++++-- .../Resolver/ConfigurableCartItemOptions.php | 9 +++ .../etc/schema.graphqls | 24 ++++--- .../Model/Customer/ExtractCustomerData.php | 1 + .../CustomerGraphQl/etc/schema.graphqls | 3 +- app/code/Magento/GraphQl/etc/di.xml | 1 + app/code/Magento/GraphQl/etc/schema.graphqls | 2 +- .../CartItem/CartItemUidArgsProcessor.php | 61 ++++++++++++++++ .../CartItem/CartItemsUidArgsProcessor.php | 65 +++++++++++++++++ .../DataProvider/CustomizableOption.php | 6 ++ .../CustomizableOptionValue/Dropdown.php | 12 ++++ .../CustomizableOptionValue/Multiple.php | 12 ++++ .../CustomizableOptionValue/Text.php | 1 + .../QuoteGraphQl/Model/Resolver/CartItems.php | 2 + .../Model/Resolver/RemoveItemFromCart.php | 20 ++++-- .../Model/Resolver/UpdateCartItems.php | 25 +++++-- app/code/Magento/QuoteGraphQl/etc/di.xml | 8 +++ .../Magento/QuoteGraphQl/etc/schema.graphqls | 19 +++-- .../UrlRewriteGraphQl/etc/schema.graphqls | 3 +- .../Resolver/ArgumentsCompositeProcessor.php | 52 ++++++++++++++ .../Resolver/ArgumentsProcessorInterface.php | 29 ++++++++ .../Magento/Framework/GraphQl/Query/Uid.php | 62 +++++++++++++++++ 39 files changed, 771 insertions(+), 92 deletions(-) create mode 100644 app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php create mode 100644 app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemUidArgsProcessor.php create mode 100644 app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemsUidArgsProcessor.php create mode 100644 lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php create mode 100644 lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsProcessorInterface.php create mode 100644 lib/internal/Magento/Framework/GraphQl/Query/Uid.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php new file mode 100644 index 0000000000000..d8a13acbd6a6e --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Category; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; + +/** + * Category UID processor class for category uid and category id arguments + */ +class CategoryUidsArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'ids'; + + private const UID = 'category_uids'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Composite processor that loops through available processors for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $filterKey = 'filters'; + $idFilter = $args[$filterKey][self::ID] ?? []; + $uidFilter = $args[$filterKey][self::UID] ?? []; + if (!empty($idFilter) + && !empty($uidFilter) + && ($fieldName === 'categories' || $fieldName === 'categoryList')) { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($uidFilter)) { + if (isset($uidFilter['eq'])) { + $args[$filterKey][self::ID]['eq'] = $this->uidEncoder->decode( + $uidFilter['eq'] + ); + } elseif (!empty($uidFilter['in'])) { + foreach ($uidFilter['in'] as $uids) { + $args[$filterKey][self::ID]['in'][] = $this->uidEncoder->decode($uids); + } + } + unset($args[$filterKey][self::UID]); + } + return $args; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php b/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php index d2c1fc8f7be9f..5892147b7a0a1 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php @@ -54,6 +54,7 @@ public function hydrateCategory(Category $category, $basicFieldsOnly = false) : $categoryData = $this->dataObjectProcessor->buildOutputDataArray($category, CategoryInterface::class); } $categoryData['id'] = $category->getId(); + $categoryData['uid'] = base64_encode($category->getId()); $categoryData['children'] = []; $categoryData['available_sort_by'] = $category->getAvailableSortBy(); $categoryData['model'] = $category; diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php index 4d7ce13fd23cc..0d7e61c023d8a 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php @@ -7,14 +7,16 @@ namespace Magento\CatalogGraphQl\Model\Resolver; +use Magento\CatalogGraphQl\Model\Category\CategoryFilter; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; -use Magento\CatalogGraphQl\Model\Category\CategoryFilter; /** * Categories resolver, used for GraphQL category data request processing. @@ -36,19 +38,28 @@ class CategoriesQuery implements ResolverInterface */ private $extractDataFromCategoryTree; + /** + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + /** * @param CategoryTree $categoryTree * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree * @param CategoryFilter $categoryFilter + * @param ArgumentsProcessorInterface|null $argsSelection */ public function __construct( CategoryTree $categoryTree, ExtractDataFromCategoryTree $extractDataFromCategoryTree, - CategoryFilter $categoryFilter + CategoryFilter $categoryFilter, + ArgumentsProcessorInterface $argsSelection = null ) { $this->categoryTree = $categoryTree; $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; $this->categoryFilter = $categoryFilter; + $this->argsSelection = $argsSelection ?: ObjectManager::getInstance() + ->get(ArgumentsProcessorInterface::class); } /** @@ -70,7 +81,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } try { - $filterResult = $this->categoryFilter->getResult($args, $store, [], $context); + $processedArgs = $this->argsSelection->process($info->fieldName, $args); + $filterResult = $this->categoryFilter->getResult($processedArgs, $store, [], $context); } catch (InputException $e) { throw new GraphQlInputException(__($e->getMessage())); } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php index dcd6f816088dd..d953b3b7b2d03 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php @@ -52,6 +52,7 @@ public function getData(string $categoryPath): array foreach ($collection as $category) { $breadcrumbsData[] = [ 'category_id' => $category->getId(), + 'category_uid' => base64_encode($category->getId()), 'category_name' => $category->getName(), 'category_level' => $category->getLevel(), 'category_url_key' => $category->getUrlKey(), diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php index 13db03bb2766b..e210c1152360e 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php @@ -7,14 +7,16 @@ namespace Magento\CatalogGraphQl\Model\Resolver; +use Magento\CatalogGraphQl\Model\Category\CategoryFilter; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; -use Magento\CatalogGraphQl\Model\Category\CategoryFilter; /** * Category List resolver, used for GraphQL category data request processing. @@ -36,19 +38,28 @@ class CategoryList implements ResolverInterface */ private $extractDataFromCategoryTree; + /** + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + /** * @param CategoryTree $categoryTree * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree * @param CategoryFilter $categoryFilter + * @param ArgumentsProcessorInterface|null $argsSelection */ public function __construct( CategoryTree $categoryTree, ExtractDataFromCategoryTree $extractDataFromCategoryTree, - CategoryFilter $categoryFilter + CategoryFilter $categoryFilter, + ArgumentsProcessorInterface $argsSelection = null ) { $this->categoryTree = $categoryTree; $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; $this->categoryFilter = $categoryFilter; + $this->argsSelection = $argsSelection ?: ObjectManager::getInstance() + ->get(ArgumentsProcessorInterface::class); } /** @@ -65,7 +76,9 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $args['filters']['ids'] = ['eq' => $store->getRootCategoryId()]; } try { - $filterResults = $this->categoryFilter->getResult($args, $store, [], $context); + $processedArgs = $this->argsSelection->process($info->fieldName, $args); + $filterResults = $this->categoryFilter->getResult($processedArgs, $store, [], $context); + $rootCategoryIds = $filterResults['category_ids']; } catch (InputException $e) { throw new GraphQlInputException(__($e->getMessage())); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php index 701ee70204486..2cfb78418bbae 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToId.php @@ -16,9 +16,10 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; /** - * @inheritdoc - * * Fixed the id related data in the product data + * + * @deprecated Use UID + * @see \Magento\CatalogGraphQl\Model\Resolver\Product\EntityIdToUid */ class EntityIdToId implements ResolverInterface { diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php new file mode 100644 index 0000000000000..8efd832fd4357 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Product; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; + +/** + * The uid related data in the product graphql interface type + */ +class EntityIdToUid implements ResolverInterface +{ + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @param MetadataPool $metadataPool + */ + public function __construct(MetadataPool $metadataPool) + { + $this->metadataPool = $metadataPool; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + + /** @var Product $product */ + $product = $value['model']; + + $productId = $product->getData( + $this->metadataPool->getMetadata(ProductInterface::class)->getIdentifierField() + ); + + return base64_encode($productId); + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php index 8843ad02320c6..e32981f4beb2b 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php @@ -53,6 +53,7 @@ public function resolve( if (!empty($product->getMediaGalleryEntries())) { foreach ($product->getMediaGalleryEntries() as $key => $entry) { $mediaGalleryEntries[$key] = $entry->getData(); + $mediaGalleryEntries[$key]['uid'] = base64_encode($entry->getId()); if ($entry->getExtensionAttributes() && $entry->getExtensionAttributes()->getVideoContent()) { $mediaGalleryEntries[$key]['video_content'] = $entry->getExtensionAttributes()->getVideoContent()->getData(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php index 76602288039c5..b4156c1d7afa4 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php @@ -20,6 +20,11 @@ */ class Options implements ResolverInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'custom-option'; + /** * @inheritdoc * @@ -55,7 +60,8 @@ public function resolve( $options[$key] = $option->getData(); $options[$key]['required'] = $option->getIsRequire(); $options[$key]['product_sku'] = $option->getProductSku(); - + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $options[$key]['uid'] = base64_encode(self::OPTION_TYPE . '/' . $option->getOptionId()); $values = $option->getValues() ?: []; /** @var Option\Value $value */ foreach ($values as $valueKey => $value) { diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch/ProductCollectionSearchCriteriaBuilder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch/ProductCollectionSearchCriteriaBuilder.php index 4a124d69bd20f..03e8358b1ee7a 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch/ProductCollectionSearchCriteriaBuilder.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch/ProductCollectionSearchCriteriaBuilder.php @@ -61,7 +61,7 @@ public function build(SearchCriteriaInterface $searchCriteria): SearchCriteriaIn foreach ($filterGroup->getFilters() as $filter) { if ($filter->getField() == CategoryProductLink::KEY_CATEGORY_ID) { $categoryFilter = $this->filterBuilder - ->setField($filter->getField()) + ->setField(CategoryProductLink::KEY_CATEGORY_ID) ->setValue($filter->getValue()) ->setConditionType($filter->getConditionType()) ->create(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php new file mode 100644 index 0000000000000..9f6fe35621f11 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Products\Query; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; + +/** + * Category UID processor class for category uid and category id arguments + */ +class CategoryUidArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'category_id'; + + private const UID = 'category_uid'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Composite processor that loops through available processors for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $idFilter = $args['filter'][self::ID] ?? []; + $uidFilter = $args['filter'][self::UID] ?? []; + if (!empty($idFilter) + && !empty($uidFilter) + && $fieldName === 'products') { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($uidFilter)) { + if (isset($uidFilter['eq'])) { + $args['filter'][self::ID]['eq'] = $this->uidEncoder->decode( + $uidFilter['eq'] + ); + } elseif (!empty($uidFilter['in'])) { + foreach ($uidFilter['in'] as $uids) { + $args['filter'][self::ID]['in'][] = $this->uidEncoder->decode($uids); + } + } + unset($args['filter'][self::UID]); + } + return $args; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Filter.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Filter.php index d70a3aa7e63c3..0f482fd12e4e3 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Filter.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Filter.php @@ -10,6 +10,7 @@ use Magento\Catalog\Model\Product; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Exception\InputException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\Argument\SearchCriteria\Builder as SearchCriteriaBuilder; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product as ProductProvider; @@ -19,6 +20,8 @@ use Magento\Search\Model\Query; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\ScopeInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; /** * Retrieve filtered product data based off given search criteria in a format that GraphQL can interpret. @@ -50,25 +53,34 @@ class Filter implements ProductQueryInterface */ private $scopeConfig; + /** + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + /** * @param SearchResultFactory $searchResultFactory * @param ProductProvider $productDataProvider * @param FieldSelection $fieldSelection * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param ScopeConfigInterface $scopeConfig + * @param ArgumentsProcessorInterface|null $argsSelection */ public function __construct( SearchResultFactory $searchResultFactory, ProductProvider $productDataProvider, FieldSelection $fieldSelection, SearchCriteriaBuilder $searchCriteriaBuilder, - ScopeConfigInterface $scopeConfig + ScopeConfigInterface $scopeConfig, + ArgumentsProcessorInterface $argsSelection = null ) { $this->searchResultFactory = $searchResultFactory; $this->productDataProvider = $productDataProvider; $this->fieldSelection = $fieldSelection; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->scopeConfig = $scopeConfig; + $this->argsSelection = $argsSelection ? : ObjectManager::getInstance() + ->get(ArgumentsProcessorInterface::class); } /** @@ -78,6 +90,7 @@ public function __construct( * @param ResolveInfo $info * @param ContextInterface $context * @return SearchResult + * @throws GraphQlInputException */ public function getResult( array $args, @@ -86,10 +99,10 @@ public function getResult( ): SearchResult { $fields = $this->fieldSelection->getProductsFieldSelection($info); try { - $searchCriteria = $this->buildSearchCriteria($args, $info); + $searchCriteria = $this->buildSearchCriteria($info->fieldName, $args); $searchResults = $this->productDataProvider->getList($searchCriteria, $fields, false, false, $context); } catch (InputException $e) { - return $this->createEmptyResult($args); + return $this->createEmptyResult((int)$args['pageSize'], (int)$args['currentPage']); } $productArray = []; @@ -120,19 +133,22 @@ public function getResult( /** * Build search criteria from query input args * + * @param string $fieldName * @param array $args - * @param ResolveInfo $info * @return SearchCriteriaInterface + * @throws GraphQlInputException + * @throws InputException */ - private function buildSearchCriteria(array $args, ResolveInfo $info): SearchCriteriaInterface + private function buildSearchCriteria(string $fieldName, array $args): SearchCriteriaInterface { - if (!empty($args['filter'])) { - $args['filter'] = $this->formatFilters($args['filter']); + $processedArgs = $this->argsSelection->process($fieldName, $args); + if (!empty($processedArgs['filter'])) { + $processedArgs['filter'] = $this->formatFilters($processedArgs['filter']); } - $criteria = $this->searchCriteriaBuilder->build($info->fieldName, $args); - $criteria->setCurrentPage($args['currentPage']); - $criteria->setPageSize($args['pageSize']); + $criteria = $this->searchCriteriaBuilder->build($fieldName, $processedArgs); + $criteria->setCurrentPage($processedArgs['currentPage']); + $criteria->setPageSize($processedArgs['pageSize']); return $criteria; } @@ -175,17 +191,18 @@ private function formatFilters(array $filters): array * * Used for handling exceptions gracefully * - * @param array $args + * @param int $pageSize + * @param int $currentPage * @return SearchResult */ - private function createEmptyResult(array $args): SearchResult + private function createEmptyResult(int $pageSize, int $currentPage): SearchResult { return $this->searchResultFactory->create( [ 'totalCount' => 0, 'productsSearchResult' => [], - 'pageSize' => $args['pageSize'], - 'currentPage' => $args['currentPage'], + 'pageSize' => $pageSize, + 'currentPage' => $currentPage, 'totalPages' => 0, ] ); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php index 4eb76fb5c2d5b..3d4266a11a359 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php @@ -12,7 +12,9 @@ use Magento\CatalogGraphQl\Model\Resolver\Products\SearchResult; use Magento\CatalogGraphQl\Model\Resolver\Products\SearchResultFactory; use Magento\Framework\Api\Search\SearchCriteriaInterface; -use Magento\Framework\Exception\InputException; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\GraphQl\Model\Query\ContextInterface; use Magento\Search\Api\SearchInterface; @@ -43,6 +45,11 @@ class Search implements ProductQueryInterface */ private $fieldSelection; + /** + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + /** * @var ProductSearch */ @@ -60,6 +67,7 @@ class Search implements ProductQueryInterface * @param FieldSelection $fieldSelection * @param ProductSearch $productsProvider * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param ArgumentsProcessorInterface|null $argsSelection */ public function __construct( SearchInterface $search, @@ -67,7 +75,8 @@ public function __construct( PageSizeProvider $pageSize, FieldSelection $fieldSelection, ProductSearch $productsProvider, - SearchCriteriaBuilder $searchCriteriaBuilder + SearchCriteriaBuilder $searchCriteriaBuilder, + ArgumentsProcessorInterface $argsSelection = null ) { $this->search = $search; $this->searchResultFactory = $searchResultFactory; @@ -75,6 +84,8 @@ public function __construct( $this->fieldSelection = $fieldSelection; $this->productsProvider = $productsProvider; $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->argsSelection = $argsSelection ?: ObjectManager::getInstance() + ->get(ArgumentsProcessorInterface::class); } /** @@ -84,7 +95,7 @@ public function __construct( * @param ResolveInfo $info * @param ContextInterface $context * @return SearchResult - * @throws InputException + * @throws GraphQlInputException */ public function getResult( array $args, @@ -92,7 +103,7 @@ public function getResult( ContextInterface $context ): SearchResult { $queryFields = $this->fieldSelection->getProductsFieldSelection($info); - $searchCriteria = $this->buildSearchCriteria($args, $info); + $searchCriteria = $this->buildSearchCriteria($queryFields, $args, $info->fieldName); $realPageSize = $searchCriteria->getPageSize(); $realCurrentPage = $searchCriteria->getCurrentPage(); @@ -136,16 +147,17 @@ public function getResult( /** * Build search criteria from query input args * + * @param array $productFields * @param array $args - * @param ResolveInfo $info + * @param string $fieldName * @return SearchCriteriaInterface + * @throws GraphQlInputException */ - private function buildSearchCriteria(array $args, ResolveInfo $info): SearchCriteriaInterface + private function buildSearchCriteria(array $productFields, array $args, string $fieldName): SearchCriteriaInterface { - $productFields = (array)$info->getFieldSelection(1); - $includeAggregations = isset($productFields['filters']) || isset($productFields['aggregations']); - $searchCriteria = $this->searchCriteriaBuilder->build($args, $includeAggregations); - - return $searchCriteria; + $fieldsKeys = array_flip($productFields); + $includeAggregations = isset($fieldsKeys['filters']) || isset($fieldsKeys['aggregations']); + $processedArgs = $this->argsSelection->process($fieldName, $args); + return $this->searchCriteriaBuilder->build($processedArgs, $includeAggregations); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryId.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryId.php index 4b3e0a1a58dfd..4575c2013dc9c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryId.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryId.php @@ -13,6 +13,9 @@ /** * Root category tree field resolver, used for GraphQL request processing. + * + * @deprecated Use the UID instead of a numeric id + * @see \Magento\CatalogGraphQl\Model\Resolver\RootCategoryUid */ class RootCategoryId implements ResolverInterface { diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php new file mode 100644 index 0000000000000..87af4ae6e520f --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Root category tree field resolver, used for GraphQL request processing. + */ +class RootCategoryUid implements ResolverInterface +{ + /** + * @inheritdoc + */ + public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) + { + return base64_encode($context->getExtensionAttributes()->getStore()->getRootCategoryId()); + } +} diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index fd3a834bff160..39c533b85e82b 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -67,6 +67,15 @@ </arguments> </type> + <type name="Magento\Framework\GraphQl\Query\Resolver\ArgumentsCompositeProcessor"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="category_uid" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\Query\CategoryUidArgsProcessor</item> + <item name="category_uids" xsi:type="object">Magento\CatalogGraphQl\Model\Category\CategoryUidsArgsProcessor</item> + </argument> + </arguments> + </type> + <type name="Magento\CatalogGraphQl\Plugin\Search\Request\ConfigReader"> <arguments> <argument name="exactMatchAttributes" xsi:type="array"> @@ -79,11 +88,11 @@ <plugin name="productAttributesDynamicFields" type="Magento\CatalogGraphQl\Plugin\Search\Request\ConfigReader" /> </type> - <preference type="\Magento\CatalogGraphQl\Model\Resolver\Product\Price\Provider" for="\Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface"/> + <preference type="Magento\CatalogGraphQl\Model\Resolver\Product\Price\Provider" for="Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface"/> <preference type="Magento\CatalogGraphQl\Model\Resolver\Products\Query\Search" for="Magento\CatalogGraphQl\Model\Resolver\Products\Query\ProductQueryInterface"/> - <type name="\Magento\CatalogGraphQl\Model\Resolver\Product\BatchProductLinks"> + <type name="Magento\CatalogGraphQl\Model\Resolver\Product\BatchProductLinks"> <arguments> <argument name="linkTypes" xsi:type="array"> <item name="related" xsi:type="string">related</item> diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 35067a6cb99af..fa0f985e31f76 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -83,7 +83,8 @@ interface ProductLinksInterface @typeResolver(class: "Magento\\CatalogGraphQl\\M } interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes.") { - id: Int @doc(description: "The ID number assigned to the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToId") + id: Int @deprecated(reason: "Use the `uid` field instead.") @doc(description: "The ID number assigned to the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToId") + uid: ID! @doc(description: "Unique identifier from objects implementing `ProductInterface`.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToUid") name: String @doc(description: "The product name. Customers use this name to identify the product.") sku: String @doc(description: "A number or code assigned to a product to identify the product, options, price, and manufacturer.") description: ComplexTextValue @doc(description: "Detailed information about the product. The value can include simple HTML tags.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute") @@ -132,7 +133,7 @@ type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") max_characters: Int @doc(description: "The maximum number of characters that can be entered for this customizable option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CategoryTree implements CategoryInterface @doc(description: "Category Tree implementation.") { @@ -154,7 +155,7 @@ type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CustomizableDropDownOption implements CustomizableOptionInterface @doc(description: "CustomizableDropDownOption contains information about a drop down menu that is defined as part of a customizable option.") { @@ -168,7 +169,7 @@ type CustomizableDropDownValue @doc(description: "CustomizableDropDownValue defi sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the option is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type CustomizableMultipleOption implements CustomizableOptionInterface @doc(description: "CustomizableMultipleOption contains information about a multiselect that is defined as part of a customizable option.") { @@ -195,7 +196,7 @@ type CustomizableFieldValue @doc(description: "CustomizableFieldValue defines th price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") max_characters: Int @doc(description: "The maximum number of characters that can be entered for this customizable option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CustomizableFileOption implements CustomizableOptionInterface @doc(description: "CustomizableFileOption contains information about a file picker that is defined as part of a customizable option.") { @@ -210,7 +211,7 @@ type CustomizableFileValue @doc(description: "CustomizableFileValue defines the file_extension: String @doc(description: "The file extension to accept.") image_size_x: Int @doc(description: "The maximum width of an image.") image_size_y: Int @doc(description: "The maximum height of an image.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } interface MediaGalleryInterface @doc(description: "Contains basic information about a product image or video.") @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\MediaGalleryTypeResolver") { @@ -231,7 +232,8 @@ interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGrap title: String @doc(description: "The display name for this option.") required: Boolean @doc(description: "Indicates whether the option is required.") sort_order: Int @doc(description: "The order in which the option is displayed.") - option_id: Int @doc(description: "Option ID.") + option_id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "Option ID.") + uid: ID! @doc(description: "Unique identifier for `CustomizableOptionInterface` object.") } interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "CustomizableProductInterface contains information about customizable product options.") { @@ -239,7 +241,8 @@ interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGra } interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CategoryInterfaceTypeResolver") @doc(description: "CategoryInterface contains the full set of attributes that can be returned in a category search.") { - id: Int @doc(description: "An ID that uniquely identifies the category.") + id: Int @deprecated(reason: "Use the `uid` argument instead.") @doc(description: "An ID that uniquely identifies the category.") + uid: ID! @doc(description: "Unique identifier from objects implementing `CategoryInterface`.") description: String @doc(description: "An optional description of the category.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoryHtmlAttribute") name: String @doc(description: "The display name of the category.") path: String @doc(description: "Category Path.") @@ -261,8 +264,9 @@ interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model breadcrumbs: [Breadcrumb] @doc(description: "Breadcrumbs, parent categories info.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Breadcrumbs") } -type Breadcrumb @doc(description: "Breadcrumb item."){ - category_id: Int @doc(description: "Category ID.") +type Breadcrumb @doc(description: "Breadcrumb item.") { + category_id: Int @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Category ID.") + category_uid: ID! @doc(description: "Unique identifier from objects implementing `CategoryInterface`.") category_name: String @doc(description: "Category name.") category_level: Int @doc(description: "Category level.") category_url_key: String @doc(description: "Category URL key.") @@ -280,7 +284,7 @@ type CustomizableRadioValue @doc(description: "CustomizableRadioValue defines th sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the radio button is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type CustomizableCheckboxOption implements CustomizableOptionInterface @doc(description: "CustomizableCheckbbixOption contains information about a set of checkbox values that are defined as part of a customizable option.") { @@ -294,7 +298,7 @@ type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defi sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the checkbox value is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type VirtualProduct implements ProductInterface, CustomizableProductInterface @doc(description: "A virtual product is non-tangible product that does not require shipping and is not kept in inventory.") { @@ -320,12 +324,14 @@ type CategoryProducts @doc(description: "The category products object returned i } input ProductAttributeFilterInput @doc(description: "ProductAttributeFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { - category_id: FilterEqualTypeInput @doc(description: "Filter product by category id") + category_id: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use `category_uid` to filter product by category id.") + category_uid: FilterEqualTypeInput @doc(description: "Filter product by category unique identifier from objects implementing `CategoryInterface`.") } input CategoryFilterInput @doc(description: "CategoryFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { - ids: FilterEqualTypeInput @doc(description: "Filter by category ID that uniquely identifies the category.") + ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uids` argument instead.") @doc(description: "Deprecated: use 'category_uids' to filter uniquely identifiers of categories.") + category_uids: FilterEqualTypeInput @doc(description: "Filter by category ID that uniquely identifies the category from objects implementing `CategoryInterface`.") url_key: FilterEqualTypeInput @doc(description: "Filter by the part of the URL that identifies the category.") name: FilterMatchTypeInput @doc(description: "Filter by the display name of the category.") url_path: FilterEqualTypeInput @doc(description: "Filter by the URL path for the category.") @@ -425,7 +431,8 @@ input ProductAttributeSortInput @doc(description: "ProductAttributeSortInput spe } type MediaGalleryEntry @doc(description: "MediaGalleryEntry defines characteristics about images and videos associated with a specific product.") { - id: Int @doc(description: "The identifier assigned to the object.") + id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The identifier assigned to the object.") + uid: ID! @doc(description: "Unique Identifier for `MediaGalleryEntry` objects.") media_type: String @doc(description: "image or video.") label: String @doc(description: "The alt text displayed on the UI when the user points to the image.") position: Int @doc(description: "The media item's position after it has been sorted.") @@ -453,7 +460,7 @@ type LayerFilterItem implements LayerFilterItemInterface { } -type Aggregation @doc(description: "A bucket that contains information for each filterable option (such as price, category ID, and custom attributes).") { +type Aggregation @doc(description: "A bucket that contains information for each filterable option (such as price, category `UID`, and custom attributes).") { count: Int @doc(description: "The number of options in the aggregation group.") label: String @doc(description: "The aggregation display name.") attribute_code: String! @doc(description: "Attribute code of the aggregation group.") @@ -490,7 +497,8 @@ type StoreConfig @doc(description: "The type contains information about a store grid_per_page : Int @doc(description: "Products per Page on Grid Default Value.") list_per_page : Int @doc(description: "Products per Page on List Default Value.") catalog_default_sort_by : String @doc(description: "Default Sort By.") - root_category_id: Int @doc(description: "The ID of the root category") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryId") + root_category_id: Int @deprecated(reason: "Use `root_category_uid` instead") @doc(description: "The ID of the root category") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryId") + root_category_uid: ID @doc(description: "Unique Identifier for the root category object implementing `CategoryInterface`.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryUid") } type SimpleWishlistItem implements WishlistItemInterface @doc(description: "A simple product wish list Item") { diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php index 5e3666407a383..45bba6d449491 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php @@ -21,6 +21,11 @@ */ class Collection { + /** + * Option type name + */ + private const OPTION_TYPE = 'configurable'; + /** * @var CollectionFactory */ @@ -121,11 +126,24 @@ private function fetch() : array $attributeData = $attribute->getData(); $this->attributeMap[$productId][$attribute->getId()] = $attribute->getData(); $this->attributeMap[$productId][$attribute->getId()]['id'] = $attribute->getId(); - $this->attributeMap[$productId][$attribute->getId()]['attribute_id_v2'] - = $attribute->getProductAttribute()->getAttributeId(); - $this->attributeMap[$productId][$attribute->getId()]['attribute_code'] - = $attribute->getProductAttribute()->getAttributeCode(); - $this->attributeMap[$productId][$attribute->getId()]['values'] = $attributeData['options']; + $this->attributeMap[$productId][$attribute->getId()]['uid'] = base64_encode( + self::OPTION_TYPE . '/' . $attribute->getAttributeId() + ); + $this->attributeMap[$productId][$attribute->getId()]['attribute_id_v2'] = + $attribute->getProductAttribute()->getAttributeId(); + $this->attributeMap[$productId][$attribute->getId()]['attribute_uid'] = + base64_encode($attribute->getProductAttribute()->getAttributeId()); + $this->attributeMap[$productId][$attribute->getId()]['product_uid'] = + base64_encode($attribute->getProductId()); + $this->attributeMap[$productId][$attribute->getId()]['attribute_code'] = + $attribute->getProductAttribute()->getAttributeCode(); + $this->attributeMap[$productId][$attribute->getId()]['values'] = array_map( + function ($value) use ($attribute) { + $value['attribute_id'] = $attribute->getAttributeId(); + return $value; + }, + $attributeData['options'] + ); $this->attributeMap[$productId][$attribute->getId()]['label'] = $attribute->getProductAttribute()->getStoreLabel(); } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php index 6624a2624f1c3..6f259944216fd 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -19,6 +19,11 @@ */ class ConfigurableCartItemOptions implements ResolverInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'configurable'; + /** * @var Configuration */ @@ -61,8 +66,12 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } $result[] = [ 'id' => $option['option_id'], + 'configurable_product_options_uid' => base64_encode(self::OPTION_TYPE . '/' . $option['option_id']), 'option_label' => $option['label'], 'value_id' => $option['option_value'], + 'configurable_product_options_values_uid' => base64_encode( + self::OPTION_TYPE . '/' . $option['option_id'] . '/' . $option['option_value'] + ), 'value_label' => $option['value'], ]; } diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 6fd3132aa6645..366088fcb4751 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -19,23 +19,27 @@ type ConfigurableAttributeOption @doc(description: "ConfigurableAttributeOption label: String @doc(description: "A string that describes the configurable attribute option") code: String @doc(description: "The ID assigned to the attribute") value_index: Int @doc(description: "A unique index number assigned to the configurable product option") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") } type ConfigurableProductOptions @doc(description: "ConfigurableProductOptions defines configurable attributes for the specified product") { - id: Int @doc(description: "The configurable option ID number assigned by the system") - attribute_id: String @deprecated(reason: "Use attribute_id_v2 instead") @doc(description: "The ID assigned to the attribute") - attribute_id_v2: Int @doc(description: "The ID assigned to the attribute") + id: Int @deprecated(reason: "Use uid instead") @doc(description: "The configurable option ID number assigned by the system") + uid: ID! @doc(description: "Unique identifier for `ConfigurableProductOptions` option object") + attribute_id: String @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") + attribute_id_v2: Int @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") + attribute_uid: ID! @doc(description: "The unique UID assigned to the attribute") attribute_code: String @doc(description: "A string that identifies the attribute") label: String @doc(description: "A string that describes the configurable product option, which is displayed on the UI") position: Int @doc(description: "A number that indicates the order in which the attribute is displayed") use_default: Boolean @doc(description: "Indicates whether the option is the default") values: [ConfigurableProductOptionsValues] @doc(description: "An array that defines the value_index codes assigned to the configurable product") - product_id: Int @doc(description: "This is the same as a product's id field") + product_id: Int @deprecated(reason: "User `product_uid` instead") @doc(description: "This is the same as a product's id field") + product_uid: ID! @doc(description: "This is the same as a product's id field") } type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOptionsValues contains the index number assigned to a configurable product option") { - value_index: Int @doc(description: "A unique index number assigned to the configurable product option") + value_index: Int @deprecated(reason: "Use `uid` instead") @doc(description: "A unique index number assigned to the configurable product option") + uid: ID @doc(description: "A unique uid assigned to the configurable product option value") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") label: String @doc(description: "The label of the product") default_label: String @doc(description: "The label of the product on the default store") store_label: String @doc(description: "The label of the product on the current store") @@ -53,7 +57,7 @@ type AddConfigurableProductsToCartOutput { input ConfigurableProductCartItemInput { data: CartItemInput! - variant_sku: String @deprecated(reason: "Use CartItemInput.sku instead.") + variant_sku: String @doc(description: "Deprecated. Use CartItemInput.sku instead.") parent_sku: String @doc(description: "Configurable product SKU.") customizable_options:[CustomizableOptionInput!] } @@ -64,9 +68,11 @@ type ConfigurableCartItem implements CartItemInterface { } type SelectedConfigurableOption { - id: Int! + id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_options_uid instead") + configurable_product_options_uid: ID! @doc(description: "Unique identifier for the selected configurable option object") option_label: String! - value_id: Int! + value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_options_values_uid instead") + configurable_product_options_values_uid: ID! @doc(description: "Unique identifier for the option value of the `SelectedConfigurableOption` object") value_label: String! } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php index c62a931809644..3dd0bc5b80990 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php @@ -104,6 +104,7 @@ public function execute(CustomerInterface $customer): array //Fields are deprecated and should not be exposed on storefront. $customerData['group_id'] = null; $customerData['id'] = null; + $customerData['uid'] = base64_encode((string)$customer->getId()); $customerData['model'] = $customer; diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index 5eed9a38a0350..e13f94be0ffd6 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -131,7 +131,8 @@ type Customer @doc(description: "Customer defines the customer name and address dob: String @doc(description: "The customer's date of birth") @deprecated(reason: "Use `date_of_birth` instead") date_of_birth: String @doc(description: "The customer's date of birth") taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") - id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") + id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "Use `uid` instead.") + uid: ID! @doc(description: "Unique identifier for the Customer object") is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") diff --git a/app/code/Magento/GraphQl/etc/di.xml b/app/code/Magento/GraphQl/etc/di.xml index 7195c05c0877b..865e8f223db54 100644 --- a/app/code/Magento/GraphQl/etc/di.xml +++ b/app/code/Magento/GraphQl/etc/di.xml @@ -14,6 +14,7 @@ <preference for="Magento\Framework\GraphQlSchemaStitching\GraphQlReader\TypeMetaReaderInterface" type="Magento\Framework\GraphQlSchemaStitching\GraphQlReader\TypeReaderComposite"/> <preference for="Magento\GraphQl\Model\Query\ContextFactoryInterface" type="Magento\GraphQl\Model\Query\ContextFactory"/> <preference for="Magento\GraphQl\Model\Query\ContextParametersInterface" type="Magento\GraphQl\Model\Query\ContextParameters"/> + <preference for="Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface" type="Magento\Framework\GraphQl\Query\Resolver\ArgumentsCompositeProcessor"/> <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index 7366567c2b95d..c93c229a8cae9 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -279,6 +279,6 @@ enum CurrencyEnum @doc(description: "The list of available currency codes") { } input EnteredOptionInput @doc(description: "Defines a customer-entered option") { - uid: ID! @doc(description: "An encoded ID") + uid: ID! @doc(description: "Unique identifier for the `EnteredOptionInput` object") value: String! @doc(description: "Text the customer entered") } diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemUidArgsProcessor.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemUidArgsProcessor.php new file mode 100644 index 0000000000000..1a53ae6f38190 --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemUidArgsProcessor.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\CartItem; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Category UID processor class for category uid and category id arguments + */ +class CartItemUidArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'cart_item_id'; + + private const UID = 'cart_item_uid'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Process the removeItemFromCart arguments for uids + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $filterKey = 'input'; + $idFilter = $args[$filterKey][self::ID] ?? []; + $uidFilter = $args[$filterKey][self::UID] ?? []; + if (!empty($idFilter) + && !empty($uidFilter) + && $fieldName === 'removeItemFromCart') { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($uidFilter)) { + $args[$filterKey][self::ID] = $this->uidEncoder->decode((string)$uidFilter); + unset($args[$filterKey][self::UID]); + } + return $args; + } +} diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemsUidArgsProcessor.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemsUidArgsProcessor.php new file mode 100644 index 0000000000000..85e744c026c43 --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/CartItemsUidArgsProcessor.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\CartItem; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Category UID processor class for category uid and category id arguments + */ +class CartItemsUidArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'cart_item_id'; + + private const UID = 'cart_item_uid'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Process the updateCartItems arguments for cart uids + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $filterKey = 'input'; + if (!empty($args[$filterKey]['cart_items'])) { + foreach ($args[$filterKey]['cart_items'] as $key => $cartItem) { + $idFilter = $cartItem[self::ID] ?? []; + $uidFilter = $cartItem[self::UID] ?? []; + if (!empty($idFilter) + && !empty($uidFilter) + && $fieldName === 'updateCartItems') { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($uidFilter)) { + $args[$filterKey]['cart_items'][$key][self::ID] = $this->uidEncoder->decode((string)$uidFilter); + unset($args[$filterKey]['cart_items'][$key][self::UID]); + } + } + } + return $args; + } +} diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php index 3199668060ea5..0b42a4cc94c7c 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php @@ -15,6 +15,11 @@ */ class CustomizableOption { + /** + * Option type name + */ + private const OPTION_TYPE = 'custom-option'; + /** * @var CustomizableOptionValueInterface */ @@ -56,6 +61,7 @@ public function getData(QuoteItem $cartItem, int $optionId): array return [ 'id' => $option->getId(), + 'customizable_option_uid' => base64_encode(self::OPTION_TYPE . '/' . $option->getId()), 'label' => $option->getTitle(), 'type' => $option->getType(), 'values' => $selectedOptionValueData, diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php index 74ed403465009..82d4b0d4fd08f 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php @@ -18,6 +18,11 @@ */ class Dropdown implements CustomizableOptionValueInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'custom-option'; + /** * @var PriceUnitLabel */ @@ -50,8 +55,15 @@ public function getData( $optionPriceType = (string)$optionValue->getPriceType(); $priceValueUnits = $this->priceUnitLabel->getData($optionPriceType); + $optionDetails = [ + self::OPTION_TYPE, + $option->getOptionId(), + $optionValue->getOptionTypeId() + ]; + $selectedOptionValueData = [ 'id' => $selectedOption->getId(), + 'customizable_option_value_uid' => base64_encode((string)implode('/', $optionDetails)), 'label' => $optionTypeRenderer->getFormattedOptionValue($selectedValue), 'value' => $selectedValue, 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php index b3fa22c0cf61c..df31686f4be4e 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php @@ -18,6 +18,11 @@ */ class Multiple implements CustomizableOptionValueInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'custom-option'; + /** * @var PriceUnitLabel */ @@ -51,8 +56,15 @@ public function getData( $optionValue = $option->getValueById($optionId); $priceValueUnits = $this->priceUnitLabel->getData($optionValue->getPriceType()); + $optionDetails = [ + self::OPTION_TYPE, + $option->getOptionId(), + $optionValue->getOptionTypeId() + ]; + $selectedOptionValueData[] = [ 'id' => $selectedOption->getId(), + 'customizable_option_value_uid' => base64_encode((string)implode('/', $optionDetails)), 'label' => $optionValue->getTitle(), 'value' => $optionId, 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php index 96f11badac82e..243a6cd66ead2 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php @@ -47,6 +47,7 @@ public function getData( $selectedOptionValueData = [ 'id' => $selectedOption->getId(), + 'customizable_option_value_uid' => base64_encode((string)$selectedOption->getId()), 'label' => '', 'value' => $optionTypeRenderer->getFormattedOptionValue($selectedOption->getValue()), 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php index 39cf287a518b4..b1319429e5856 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php @@ -68,6 +68,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $itemsData[] = [ 'id' => $cartItem->getItemId(), + 'uid' => base64_encode((string)$cartItem->getItemId()), 'quantity' => $cartItem->getQty(), 'product' => $productData, 'model' => $cartItem, @@ -89,6 +90,7 @@ private function getCartProductsData(Quote $cart): array foreach ($products as $product) { $productsData[$product->getId()] = $product->getData(); $productsData[$product->getId()]['model'] = $product; + $productsData[$product->getId()]['uid'] = base64_encode($product->getId()); } return $productsData; diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php index c2045d4a0e8d5..7ed2eb4ba8a07 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/RemoveItemFromCart.php @@ -16,6 +16,7 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Quote\Api\CartItemRepositoryInterface; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; /** * @inheritdoc @@ -32,16 +33,24 @@ class RemoveItemFromCart implements ResolverInterface */ private $cartItemRepository; + /** + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + /** * @param GetCartForUser $getCartForUser * @param CartItemRepositoryInterface $cartItemRepository + * @param ArgumentsProcessorInterface $argsSelection */ public function __construct( GetCartForUser $getCartForUser, - CartItemRepositoryInterface $cartItemRepository + CartItemRepositoryInterface $cartItemRepository, + ArgumentsProcessorInterface $argsSelection ) { $this->getCartForUser = $getCartForUser; $this->cartItemRepository = $cartItemRepository; + $this->argsSelection = $argsSelection; } /** @@ -49,15 +58,16 @@ public function __construct( */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - if (empty($args['input']['cart_id'])) { + $processedArgs = $this->argsSelection->process($info->fieldName, $args); + if (empty($processedArgs['input']['cart_id'])) { throw new GraphQlInputException(__('Required parameter "cart_id" is missing.')); } - $maskedCartId = $args['input']['cart_id']; + $maskedCartId = $processedArgs['input']['cart_id']; - if (empty($args['input']['cart_item_id'])) { + if (empty($processedArgs['input']['cart_item_id'])) { throw new GraphQlInputException(__('Required parameter "cart_item_id" is missing.')); } - $itemId = $args['input']['cart_item_id']; + $itemId = $processedArgs['input']['cart_item_id']; $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php index 005baaad0e1e5..58c2cf7e2aaed 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php @@ -17,6 +17,7 @@ use Magento\Quote\Api\CartRepositoryInterface; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; use Magento\QuoteGraphQl\Model\CartItem\DataProvider\UpdateCartItems as UpdateCartItemsProvider; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; /** * @inheritdoc @@ -39,18 +40,26 @@ class UpdateCartItems implements ResolverInterface private $updateCartItems; /** - * @param GetCartForUser $getCartForUser + * @var ArgumentsProcessorInterface + */ + private $argsSelection; + + /** + * @param GetCartForUser $getCartForUser * @param CartRepositoryInterface $cartRepository * @param UpdateCartItemsProvider $updateCartItems + * @param ArgumentsProcessorInterface $argsSelection */ public function __construct( GetCartForUser $getCartForUser, CartRepositoryInterface $cartRepository, - UpdateCartItemsProvider $updateCartItems + UpdateCartItemsProvider $updateCartItems, + ArgumentsProcessorInterface $argsSelection ) { $this->getCartForUser = $getCartForUser; $this->cartRepository = $cartRepository; $this->updateCartItems = $updateCartItems; + $this->argsSelection = $argsSelection; } /** @@ -58,19 +67,21 @@ public function __construct( */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - if (empty($args['input']['cart_id'])) { + $processedArgs = $this->argsSelection->process($info->fieldName, $args); + + if (empty($processedArgs['input']['cart_id'])) { throw new GraphQlInputException(__('Required parameter "cart_id" is missing.')); } - $maskedCartId = $args['input']['cart_id']; + $maskedCartId = $processedArgs['input']['cart_id']; - if (empty($args['input']['cart_items']) - || !is_array($args['input']['cart_items']) + if (empty($processedArgs['input']['cart_items']) + || !is_array($processedArgs['input']['cart_items']) ) { throw new GraphQlInputException(__('Required parameter "cart_items" is missing.')); } - $cartItems = $args['input']['cart_items']; + $cartItems = $processedArgs['input']['cart_items']; $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); diff --git a/app/code/Magento/QuoteGraphQl/etc/di.xml b/app/code/Magento/QuoteGraphQl/etc/di.xml index 35b52dd495c5a..8dd35ab7f300b 100644 --- a/app/code/Magento/QuoteGraphQl/etc/di.xml +++ b/app/code/Magento/QuoteGraphQl/etc/di.xml @@ -33,4 +33,12 @@ </argument> </arguments> </type> + <type name="Magento\Framework\GraphQl\Query\Resolver\ArgumentsCompositeProcessor"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="cart_item_id" xsi:type="object">Magento\QuoteGraphQl\Model\CartItem\CartItemUidArgsProcessor</item> + <item name="cart_items_id" xsi:type="object">Magento\QuoteGraphQl\Model\CartItem\CartItemsUidArgsProcessor</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index cc9d1803b3e31..84015be0f1913 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -58,8 +58,8 @@ input CartItemInput { } input CustomizableOptionInput { - id: Int! - value_string: String! + id: Int @doc(description: "The customizable option id of the product") + value_string: String! @doc(description: "The string value of the option") } input ApplyCouponToCartInput { @@ -73,14 +73,16 @@ input UpdateCartItemsInput { } input CartItemUpdateInput { - cart_item_id: Int! + cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") + cart_item_uid: ID @doc(description: "Unique Identifier from objects implementing `CartItemInterface`") quantity: Float customizable_options: [CustomizableOptionInput!] } input RemoveItemFromCartInput { cart_id: String! - cart_item_id: Int! + cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") + cart_item_uid: ID @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") } input SetShippingAddressesOnCartInput { @@ -328,7 +330,8 @@ type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Car } interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { - id: String! + id: String! @deprecated(reason: "Use CartItemInterface.uid instead") + uid: ID! @doc(description: "Unique identifier for the `CartItemInterface` object") quantity: Float! prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") product: ProductInterface! @@ -348,7 +351,8 @@ type CartItemPrices { } type SelectedCustomizableOption { - id: Int! + id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") + customizable_option_uid: ID! @doc(description: "Unique identifier for the `SelectedCustomizableOption` object") label: String! is_required: Boolean! values: [SelectedCustomizableOptionValue!]! @@ -356,7 +360,8 @@ type SelectedCustomizableOption { } type SelectedCustomizableOptionValue { - id: Int! + id: Int! @deprecated(reason: "Use SelectedCustomizableOptionValue.customizable_option_value_uid instead") + customizable_option_value_uid: ID! @doc(description: "Unique identifier for the `SelectedCustomizableOptionValue` object") label: String! value: String! price: CartItemSelectedOptionValuePrice! diff --git a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls index 7f7ebb627b4dc..cb6279c9d71f9 100644 --- a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls @@ -6,7 +6,8 @@ type Query { } type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") { - id: Int @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") + id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") + entity_uid: ID @doc(description: "The unique identifier assigned to the object associated with the specified url. This could be a product UID, category UID, or cms page UID.") canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.") relative_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.") redirectCode: Int @doc(description: "301 or 302 HTTP code for url permanent or temporary redirect or 0 for the 200 no redirect") diff --git a/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php new file mode 100644 index 0000000000000..1332d080e50bb --- /dev/null +++ b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\GraphQl\Query\Resolver; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Composite processor class for arguments + */ +class ArgumentsCompositeProcessor implements ArgumentsProcessorInterface +{ + /** + * @var ArgumentsProcessorInterface[] + */ + private $processors = []; + + /** + * @param ArgumentsProcessorInterface[] $processors + */ + public function __construct(array $processors = []) + { + $this->processors = $processors; + } + + /** + * Composite processor that loops through available processors for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $processedArgs = $args; + foreach ($this->processors as $processor) { + $processedArgs = $processor->process( + $fieldName, + $args + ); + } + + return $processedArgs; + } +} diff --git a/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsProcessorInterface.php b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsProcessorInterface.php new file mode 100644 index 0000000000000..212211c349fd5 --- /dev/null +++ b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsProcessorInterface.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\GraphQl\Query\Resolver; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Processor for input arguments of a graphql type + */ +interface ArgumentsProcessorInterface +{ + /** + * Processor for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array; +} diff --git a/lib/internal/Magento/Framework/GraphQl/Query/Uid.php b/lib/internal/Magento/Framework/GraphQl/Query/Uid.php new file mode 100644 index 0000000000000..0fd29f2eaaca1 --- /dev/null +++ b/lib/internal/Magento/Framework/GraphQl/Query/Uid.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\GraphQl\Query; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Encodes and decodes id and uid values + */ +class Uid +{ + /** + * Decode UID value to ID + * + * @param string $uid + * @return false|string + * @phpcs:disable Magento2.Functions.DiscouragedFunction + * @throws GraphQlInputException + */ + public function decode(string $uid) + { + if ($this->isValidBase64($uid)) { + return base64_decode($uid, true); + } + throw new GraphQlInputException(__('Value of uid "%1" is incorrect.', $uid)); + } + + /** + * Encode ID value to UID + * + * @param string $id + * @return string + * @phpcs:disable Magento2.Functions.DiscouragedFunction + */ + public function encode(string $id): string + { + return base64_encode($id); + } + + /** + * Validate base64 encoded value + * + * @param string $data + * @return bool + * @phpcs:disable Magento2.Functions.DiscouragedFunction + */ + public function isValidBase64(string $data): bool + { + $decodedValue = base64_decode($data, true); + if ($decodedValue === false) { + return false; + } + + return base64_encode($decodedValue) === $data; + } +} From c93616132bc8c3e0d934e217ab98f83607cf04b2 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Thu, 12 Nov 2020 10:58:58 +0200 Subject: [PATCH 143/490] change super_group to grouped_options --- .../Magento/GroupedProduct/Model/Product/Type/Grouped.php | 2 +- .../GroupedProduct/Model/Quote/Item/CartItemProcessor.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index d1ffb92620746..769e3afc1158f 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -415,7 +415,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p ); if ($buyRequest->getSuperGroup()) { $serializedValue = $this->serializer->serialize($buyRequest->getSuperGroup()); - $_result[0]->addCustomOption('super_group', $serializedValue); + $_result[0]->addCustomOption('grouped_options', $serializedValue); } $products[] = $_result[0]; diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 05a59f42fca02..924630d6987ed 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -109,11 +109,11 @@ public function processOptions(CartItemInterface $cartItem): CartItemInterface return $cartItem; } - $superGroup = $cartItem->getOptionByCode(self::SUPER_GROUP_CODE); - $superGroupValues = $superGroup ? $this->jsonSerializer->unserialize($superGroup->getValue()) : null; - if ($superGroupValues) { + $groupedOptions = $cartItem->getOptionByCode('grouped_options'); + $groupedOptionsData = $groupedOptions ? $this->jsonSerializer->unserialize($groupedOptions->getValue()) : null; + if ($groupedOptionsData) { $productOptions = []; - foreach ($superGroupValues as $id => $qty) { + foreach ($groupedOptionsData as $id => $qty) { $productOptions[] = $this->groupedOptionFactory->create(['id' => $id, 'qty' => $qty]); } From f6bb0228a30f9c12059cce724a522257d6f50d14 Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Thu, 12 Nov 2020 11:04:04 -0600 Subject: [PATCH 144/490] MC-38915: Unable to change Customer Group on new customers created via an admin order when Enable Automatic Assignment to Customer Group is enabled - Updating group_id based on the vat validation on customer --- .../Observer/AfterAddressSaveObserver.php | 11 +- .../Observer/AfterAddressSaveObserverTest.php | 2 +- .../Adminhtml/Order/Create/Form/Account.php | 84 ++++++++--- .../Order/Create/Form/AccountTest.php | 137 +++++++++++++++++- 4 files changed, 202 insertions(+), 32 deletions(-) diff --git a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php index af0a04827d30f..33290306e4843 100644 --- a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php @@ -141,7 +141,8 @@ public function execute(Observer $observer) if ($customerAddress->getVatId() == '' || !$this->_customerVat->isCountryInEU($customerAddress->getCountry()) ) { - $defaultGroupId = $this->_groupManagement->getDefaultGroup($customer->getStore())->getId(); + $defaultGroupId = $customer->getGroupId() ? $customer->getGroupId() : + $this->_groupManagement->getDefaultGroup($customer->getStore())->getId(); if (!$customer->getDisableAutoGroupChange() && $customer->getGroupId() != $defaultGroupId) { $customer->setGroupId($defaultGroupId); $customer->save(); @@ -216,8 +217,8 @@ protected function _canProcessAddress($address) protected function _isDefaultBilling($address) { return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultBilling() - || $address->getIsPrimaryBilling() - || $address->getIsDefaultBilling(); + || $address->getIsPrimaryBilling() + || $address->getIsDefaultBilling(); } /** @@ -229,8 +230,8 @@ protected function _isDefaultBilling($address) protected function _isDefaultShipping($address) { return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultShipping() - || $address->getIsPrimaryShipping() - || $address->getIsDefaultShipping(); + || $address->getIsPrimaryShipping() + || $address->getIsDefaultShipping(); } /** diff --git a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php index f72cbbc281e90..146cecb09351f 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -341,7 +341,7 @@ public function testAfterAddressSaveDefaultGroup( $customer->expects($this->once()) ->method('getDisableAutoGroupChange') ->willReturn(false); - $customer->expects($this->once()) + $customer->expects($this->exactly(2)) ->method('getGroupId') ->willReturn(null); $customer->expects($this->once()) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php index e6a209b541198..9bb71d837cade 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php @@ -6,11 +6,24 @@ namespace Magento\Sales\Block\Adminhtml\Order\Create\Form; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Model\Session\Quote; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Api\GroupManagementInterface; +use Magento\Customer\Model\Metadata\Form; use Magento\Framework\Api\ExtensibleDataObjectConverter; use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\FormFactory; +use Magento\Customer\Model\Metadata\FormFactory as MetadataFormFactory; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Phrase; use Magento\Framework\Pricing\PriceCurrencyInterface; +use Magento\Framework\Reflection\DataObjectProcessor; +use Magento\Sales\Model\AdminOrder\Create; +use Magento\Store\Model\ScopeInterface; /** * Create order account form @@ -25,46 +38,48 @@ class Account extends AbstractForm /** * Metadata form factory * - * @var \Magento\Customer\Model\Metadata\FormFactory + * @var MetadataFormFactory */ protected $_metadataFormFactory; /** * Customer repository * - * @var \Magento\Customer\Api\CustomerRepositoryInterface + * @var CustomerRepositoryInterface */ protected $customerRepository; /** - * @var \Magento\Framework\Api\ExtensibleDataObjectConverter + * @var ExtensibleDataObjectConverter */ protected $_extensibleDataObjectConverter; + private const XML_PATH_EMAIL_REQUIRED_CREATE_ORDER = 'customer/create_account/email_required_create_order'; + /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param Context $context + * @param Quote $sessionQuote + * @param Create $orderCreate * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\Data\FormFactory $formFactory - * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor - * @param \Magento\Customer\Model\Metadata\FormFactory $metadataFormFactory - * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository + * @param FormFactory $formFactory + * @param DataObjectProcessor $dataObjectProcessor + * @param MetadataFormFactory $metadataFormFactory + * @param CustomerRepositoryInterface $customerRepository * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter * @param array $data * @param GroupManagementInterface|null $groupManagement * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, + Context $context, + Quote $sessionQuote, + Create $orderCreate, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\Data\FormFactory $formFactory, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, - \Magento\Customer\Model\Metadata\FormFactory $metadataFormFactory, - \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, - \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, + FormFactory $formFactory, + DataObjectProcessor $dataObjectProcessor, + MetadataFormFactory $metadataFormFactory, + CustomerRepositoryInterface $customerRepository, + ExtensibleDataObjectConverter $extensibleDataObjectConverter, array $data = [], ?GroupManagementInterface $groupManagement = null ) { @@ -103,7 +118,7 @@ public function getHeaderCssClass() /** * Return header text * - * @return \Magento\Framework\Phrase + * @return Phrase */ public function getHeaderText() { @@ -114,10 +129,12 @@ public function getHeaderText() * Prepare Form and add elements to form * * @return $this + * @throws LocalizedException + * @throws NoSuchEntityException */ protected function _prepareForm() { - /** @var \Magento\Customer\Model\Metadata\Form $customerForm */ + /** @var Form $customerForm */ $customerForm = $this->_metadataFormFactory->create('customer', 'adminhtml_checkout'); // prepare customer attributes to show @@ -170,6 +187,8 @@ protected function _addAdditionalFormElementData(AbstractElement $element) * Return Form Elements values * * @return array + * @throws LocalizedException + * @throws NoSuchEntityException */ public function getFormValues() { @@ -183,7 +202,7 @@ public function getFormValues() ? $this->_extensibleDataObjectConverter->toFlatArray( $customer, [], - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class ) : []; foreach ($this->getQuote()->getData() as $key => $value) { @@ -193,7 +212,7 @@ public function getFormValues() } if (array_key_exists('group_id', $data) && empty($data['group_id'])) { - $data['group_id'] = $this->groupManagement->getDefaultGroup($this->getQuote()->getStoreId())->getId(); + $data['group_id'] = $this->getSelectedGroupId(); } if ($this->getQuote()->getCustomerEmail()) { @@ -208,6 +227,8 @@ public function getFormValues() * * @param array $attributes * @return array + * @throws LocalizedException + * @throws NoSuchEntityException */ private function extractValuesFromAttributes(array $attributes): array { @@ -231,7 +252,24 @@ private function isEmailRequiredToCreateOrder() { return $this->_scopeConfig->getValue( self::XML_PATH_EMAIL_REQUIRED_CREATE_ORDER, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ); } + + /** + * Retrieve selected group id + * + * @return string + * @throws LocalizedException + * @throws NoSuchEntityException + */ + private function getSelectedGroupId(): string + { + $selectedGroupId = $this->groupManagement->getDefaultGroup($this->getQuote()->getStoreId())->getId(); + $orderDetails = $this->getRequest()->getParam('order'); + if (!empty($orderDetails) && !empty($orderDetails['account']['group_id'])) { + $selectedGroupId = $orderDetails['account']['group_id']; + } + return $selectedGroupId; + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php index 861559acd8c20..b7e3ffcf9cd9d 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php @@ -9,6 +9,7 @@ namespace Magento\Sales\Block\Adminhtml\Order\Create\Form; +use Magento\Backend\Block\Template\Context; use Magento\Backend\Model\Session\Quote as SessionQuote; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\AttributeMetadataInterface; @@ -17,6 +18,7 @@ use Magento\Customer\Model\Data\Option; use Magento\Customer\Model\Metadata\Form; use Magento\Customer\Model\Metadata\FormFactory; +use Magento\Framework\App\RequestInterface as Request; use Magento\Framework\View\LayoutInterface; use Magento\Quote\Model\Quote; use Magento\Store\Model\StoreManagerInterface; @@ -107,7 +109,7 @@ public function testGetFormWithCustomer() ); } - self::assertRegExp( + self::assertMatchesRegularExpression( '/<option value="'.$customerGroup.'".*?selected="selected"\>Wholesale\<\/option\>/is', $content, 'The Customer Group specified for the chosen customer should be selected.' @@ -150,13 +152,13 @@ public function testGetFormWithUserDefinedAttribute() $form->setUseContainer(true); $content = $form->toHtml(); - self::assertRegExp( + self::assertMatchesRegularExpression( '/\<option value="1".*?selected="selected"\>Yes\<\/option\>/is', $content, 'Default value for user defined custom attribute should be selected.' ); - self::assertRegExp( + self::assertMatchesRegularExpression( '/<option value="3".*?selected="selected"\>Retailer\<\/option\>/is', $content, 'The Customer Group specified for the chosen store should be selected.' @@ -203,6 +205,135 @@ public function testGetFormWithDefaultCustomerGroup() ); } + /** + * Test for get form with customer group based on vat id validation + * + * @dataProvider getDataForVatValidatedCustomer + * @param int $defaultCustomerGroupId + * @param int $vatValidatedCustomerGroupId + * @param array $customerDetails + * @param array $orderDetails + * @return void + */ + public function testGetFormWithVatValidatedCustomerGroup( + int $defaultCustomerGroupId, + int $vatValidatedCustomerGroupId, + array $customerDetails, + array $orderDetails + ): void { + $contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->getMock(); + $requestMock = $this->getMockBuilder(Request::class) + ->getMockForAbstractClass(); + $contextMock->expects($this->once()) + ->method('getRequest') + ->willReturn($requestMock); + $requestMock->expects($this->any()) + ->method('getParam') + ->willReturn($orderDetails); + + $quote = $this->objectManager->create(Quote::class); + $quote->setCustomerGroupId($defaultCustomerGroupId); + $quote->setData($customerDetails); + + $this->session = $this->getMockBuilder(SessionQuote::class) + ->disableOriginalConstructor() + ->setMethods(['getCustomerId', 'getQuote']) + ->getMock(); + $this->session->method('getQuote') + ->willReturn($quote); + $this->session->method('getCustomerId') + ->willReturn($customerDetails['customer_id']); + + $formFactory = $this->getFormFactoryMock(); + $this->objectManager->addSharedInstance($formFactory, FormFactory::class); + + /** @var LayoutInterface $layout */ + $layout = $this->objectManager->get(LayoutInterface::class); + $accountBlock = $layout->createBlock( + Account::class, + 'address_block' . rand(), + [ + 'context' => $contextMock, + 'sessionQuote' => $this->session + ] + ); + + $form = $accountBlock->getForm(); + + self::assertEquals( + $vatValidatedCustomerGroupId, + $form->getElement('group_id')->getValue(), + 'The Customer Group specified for the chosen customer should be selected.' + ); + } + + /** + * Data provider for vat validated customer group id + * + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function getDataForVatValidatedCustomer(): array + { + return [ + 'Validated customer group id when its set in quote' => [ + 'defaultCustomerGroupId' => 0, + 'vatValidatedCustomerGroupId' => 3, + 'customerDetails' => [ + 'entity_id' => '35', + 'store_id' => 1, + 'created_at' => '2020-11-09 01:03:35', + 'updated_at' => '2020-11-09 05:44:07', + 'customer_id' => 1, + 'customer_tax_class_id' => '3', + 'customer_group_id' => 3, + 'customer_email' => 'test@test.com', + 'customer_prefix' => null, + 'customer_firstname' => null, + 'customer_middlename' => null, + 'customer_lastname' => null, + 'customer_suffix' => null, + 'customer_dob' => null, + ], + 'orderDetails' => [ + 'account' => [ + 'group_id' => 3, + 'email' => 'test@test.com' + ] + ] + ], + 'Validated customer group id when its set in request' => [ + 'defaultCustomerGroupId' => 0, + 'vatValidatedCustomerGroupId' => 3, + 'customerDetails' => [ + 'entity_id' => '35', + 'store_id' => 1, + 'created_at' => '2020-11-09 01:03:35', + 'updated_at' => '2020-11-09 05:44:07', + 'customer_id' => 1, + 'customer_tax_class_id' => '3', + 'customer_group_id' => null, + 'customer_email' => 'test@test.com', + 'customer_prefix' => null, + 'customer_firstname' => null, + 'customer_middlename' => null, + 'customer_lastname' => null, + 'customer_suffix' => null, + 'customer_dob' => null, + ], + 'orderDetails' => [ + 'account' => [ + 'group_id' => 3, + 'email' => 'test@test.com' + ] + ] + ] + ]; + } + /** * Creates a mock for Form object. * From 5512626bfdfdede24ded8095998c647092d60ebb Mon Sep 17 00:00:00 2001 From: Lachlan Turner <lachlan.turner@aligent.com.au> Date: Fri, 13 Nov 2020 10:04:38 +1030 Subject: [PATCH 145/490] Ensure that url suffix resolvers return strings to match function declaration --- .../Model/Resolver/CategoryUrlSuffix.php | 2 +- .../Model/Resolver/ProductUrlSuffix.php | 2 +- .../Model/Resolver/CategoryUrlSuffixTest.php | 164 ++++++++++++++++++ .../Model/Resolver/ProductUrlSuffixTest.php | 164 ++++++++++++++++++ 4 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php create mode 100644 app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php index 59708d90c23b7..a6aa4bdfa5d32 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php @@ -75,7 +75,7 @@ private function getCategoryUrlSuffix(int $storeId): string self::$xml_path_category_url_suffix, ScopeInterface::SCOPE_STORE, $storeId - ); + ) ?? ''; } return $this->categoryUrlSuffix[$storeId]; } diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php index 9a0193ba36367..ac4c48b0ed5b7 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php @@ -75,7 +75,7 @@ private function getProductUrlSuffix(int $storeId): string self::$xml_path_product_url_suffix, ScopeInterface::SCOPE_STORE, $storeId - ); + ) ?? ''; } return $this->productUrlSuffix[$storeId]; } diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php new file mode 100644 index 0000000000000..315e1040046cb --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php @@ -0,0 +1,164 @@ +<?php +namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver; + +use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\GraphQl\Model\Query\ContextExtensionInterface; +use Magento\GraphQl\Model\Query\ContextInterface; +use Magento\Store\Api\Data\StoreInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\Config\ScopeConfigInterface; + +class CategoryUrlSuffixTest extends TestCase +{ + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var ContextInterface|MockObject + */ + private $contextMock; + + /** + * @var ContextExtensionInterface|MockObject + */ + private $contextExtensionMock; + + /** + * @var StoreInterface|MockObject + */ + private $storeMock; + + /** + * @var Field|MockObject + */ + private $fieldMock; + + /** + * @var ResolveInfo|MockObject + */ + private $resolveInfoMock; + + /** + * @var CategoryUrlSuffix + */ + private $resolver; + + + protected function setUp(): void + { + $this->contextMock = $this->getMockBuilder(ContextInterface::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'getExtensionAttributes' + ] + ) + ->getMockForAbstractClass(); + + $this->contextExtensionMock = $this->getMockBuilder(ContextExtensionInterface::class) + ->setMethods( + [ + 'getStore' + ] + ) + ->getMockForAbstractClass(); + + $this->storeMock = $this->getMockBuilder(StoreInterface::class) + ->setMethods( + [ + 'getId' + ] + ) + ->getMockForAbstractClass(); + + $this->fieldMock = $this->getMockBuilder(Field::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resolveInfoMock = $this->getMockBuilder(ResolveInfo::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->getMockForAbstractClass(); + + $this->resolver = new CategoryUrlSuffix( + $this->scopeConfigMock + ); + } + + /** + * Verify that empty string is returned when config value is null + */ + public function testNullValue() + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn(null); + + $this->contextMock + ->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->contextExtensionMock); + + $this->contextExtensionMock + ->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock + ->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $this->assertEquals( + '', + $this->resolver->resolve( + $this->fieldMock, + $this->contextMock, + $this->resolveInfoMock + ) + ); + } + + /** + * Verify that the configured value is returned + */ + public function testNonNullValue() + { + $value = 'html'; + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn($value); + + $this->contextMock + ->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->contextExtensionMock); + + $this->contextExtensionMock + ->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock + ->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $this->assertEquals( + $value, + $this->resolver->resolve( + $this->fieldMock, + $this->contextMock, + $this->resolveInfoMock + ) + ); + } +} diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php new file mode 100644 index 0000000000000..079389ede50fc --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php @@ -0,0 +1,164 @@ +<?php +namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver; + +use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\ProductUrlSuffix; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\GraphQl\Model\Query\ContextExtensionInterface; +use Magento\GraphQl\Model\Query\ContextInterface; +use Magento\Store\Api\Data\StoreInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\Config\ScopeConfigInterface; + +class ProductUrlSuffixTest extends TestCase +{ + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var ContextInterface|MockObject + */ + private $contextMock; + + /** + * @var ContextExtensionInterface|MockObject + */ + private $contextExtensionMock; + + /** + * @var StoreInterface|MockObject + */ + private $storeMock; + + /** + * @var Field|MockObject + */ + private $fieldMock; + + /** + * @var ResolveInfo|MockObject + */ + private $resolveInfoMock; + + /** + * @var ProductUrlSuffix + */ + private $resolver; + + + protected function setUp(): void + { + $this->contextMock = $this->getMockBuilder(ContextInterface::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'getExtensionAttributes' + ] + ) + ->getMockForAbstractClass(); + + $this->contextExtensionMock = $this->getMockBuilder(ContextExtensionInterface::class) + ->setMethods( + [ + 'getStore' + ] + ) + ->getMockForAbstractClass(); + + $this->storeMock = $this->getMockBuilder(StoreInterface::class) + ->setMethods( + [ + 'getId' + ] + ) + ->getMockForAbstractClass(); + + $this->fieldMock = $this->getMockBuilder(Field::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resolveInfoMock = $this->getMockBuilder(ResolveInfo::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->getMockForAbstractClass(); + + $this->resolver = new ProductUrlSuffix( + $this->scopeConfigMock + ); + } + + /** + * Verify that empty string is returned when config value is null + */ + public function testNullValue() + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn(null); + + $this->contextMock + ->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->contextExtensionMock); + + $this->contextExtensionMock + ->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock + ->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $this->assertEquals( + '', + $this->resolver->resolve( + $this->fieldMock, + $this->contextMock, + $this->resolveInfoMock + ) + ); + } + + /** + * Verify that the configured value is returned + */ + public function testNonNullValue() + { + $value = 'html'; + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn($value); + + $this->contextMock + ->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->contextExtensionMock); + + $this->contextExtensionMock + ->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->storeMock + ->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $this->assertEquals( + $value, + $this->resolver->resolve( + $this->fieldMock, + $this->contextMock, + $this->resolveInfoMock + ) + ); + } +} From 27a592cf38b501bcf05d9ef2e5401a9cff7e986b Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Thu, 12 Nov 2020 17:39:59 -0600 Subject: [PATCH 146/490] - Updated assigncomparelist impl - On assigning a compare list "A" to customer, if there already exist a list "B" for the customer, then all the items in "A" should be added to "B" and list "A" should be deleted --- .../Resolver/AssignCompareListToCustomer.php | 4 +- .../Customer/SetCustomerToCompareList.php | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php index d3597ebdb1021..8c43fcf5e9299 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php +++ b/app/code/Magento/CompareListGraphQl/Model/Resolver/AssignCompareListToCustomer.php @@ -89,11 +89,11 @@ public function resolve( if ($listId) { try { - $result = $this->setCustomerToCompareList->execute($listId, $context->getUserId()); + $result = $this->setCustomerToCompareList->execute($listId, $context->getUserId(), $context); if ($result) { return [ 'result' => true, - 'compare_list' => $this->getCompareList->execute($listId, $context) + 'compare_list' => $this->getCompareList->execute((int)$result->getListId(), $context) ]; } } catch (LocalizedException $exception) { diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php index c496a0ced5933..72216c6c70a16 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/Customer/SetCustomerToCompareList.php @@ -10,9 +10,13 @@ use Magento\Catalog\Model\CompareList; use Magento\Catalog\Model\CompareListFactory; use Magento\Catalog\Model\ResourceModel\Product\Compare\CompareList as ResourceCompareList; +use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Compare\Item\CollectionFactory as CompareItemsCollectionFactory; +use Magento\CompareListGraphQl\Model\Service\AddToCompareList; use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; /** * Assign customer to compare list @@ -34,6 +38,26 @@ class SetCustomerToCompareList */ private $resourceCompareList; + /** + * @var GetListIdByCustomerId + */ + private $getListIdByCustomerId; + + /** + * @var Collection + */ + private $items; + + /** + * @var CompareItemsCollectionFactory + */ + private $itemCollectionFactory; + + /** + * @var AddToCompareList + */ + private $addProductToCompareList; + /** * @param ValidateCustomer $validateCustomer * @param CompareListFactory $compareListFactory @@ -42,11 +66,17 @@ class SetCustomerToCompareList public function __construct( ValidateCustomer $validateCustomer, CompareListFactory $compareListFactory, - ResourceCompareList $resourceCompareList + ResourceCompareList $resourceCompareList, + GetListIdByCustomerId $getListIdByCustomerId, + CompareItemsCollectionFactory $itemCollectionFactory, + AddToCompareList $addProductToCompareList ) { $this->validateCustomer = $validateCustomer; $this->compareListFactory = $compareListFactory; $this->resourceCompareList = $resourceCompareList; + $this->getListIdByCustomerId = $getListIdByCustomerId; + $this->itemCollectionFactory = $itemCollectionFactory; + $this->addProductToCompareList = $addProductToCompareList; } /** @@ -61,12 +91,22 @@ public function __construct( * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException */ - public function execute(int $listId, int $customerId): ?CompareList + public function execute(int $listId, int $customerId, ContextInterface $context): ?CompareList { if ($this->validateCustomer->execute($customerId)) { /** @var CompareList $compareListModel */ $compareList = $this->compareListFactory->create(); + $customerListId = $this->getListIdByCustomerId->execute($customerId); $this->resourceCompareList->load($compareList, $listId, 'list_id'); + if ($customerListId) { + $this->items = $this->itemCollectionFactory->create(); + $products = $this->items->getProductsByListId($listId); + $this->addProductToCompareList->execute($customerListId, $products, $context); + $this->resourceCompareList->delete($compareList); + $compareList = $this->compareListFactory->create(); + $this->resourceCompareList->load($compareList, $customerListId, 'list_id'); + return $compareList; + } $compareList->setCustomerId($customerId); $this->resourceCompareList->save($compareList); return $compareList; From 92429205acf7958b50dd2a81796e027c99904713 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 12 Nov 2020 21:23:04 -0600 Subject: [PATCH 147/490] MC-38340: GraphQL code changes for a consistent object uid - inject uid encoder --- .../Model/Category/Hydrator.php | 13 ++++++++-- .../Category/DataProvider/Breadcrumbs.php | 13 ++++++++-- .../Model/Resolver/Product/EntityIdToUid.php | 18 +++++++++---- .../Resolver/Product/MediaGalleryEntries.php | 16 +++++++++++- .../Model/Resolver/Product/Options.php | 19 ++++++++++++-- .../Query/CategoryUidArgsProcessor.php | 8 +++--- .../Model/Resolver/RootCategoryUid.php | 14 ++++++++++- .../Model/Options/Collection.php | 25 +++++++++++++------ .../Resolver/ConfigurableCartItemOptions.php | 17 ++++++++++--- .../Model/Customer/ExtractCustomerData.php | 15 ++++++++--- .../DataProvider/CustomizableOption.php | 13 ++++++++-- .../CustomizableOptionValue/Dropdown.php | 13 ++++++++-- .../CustomizableOptionValue/Multiple.php | 13 ++++++++-- .../CustomizableOptionValue/Text.php | 13 ++++++++-- .../QuoteGraphQl/Model/Resolver/CartItems.php | 18 ++++++++++--- 15 files changed, 184 insertions(+), 44 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php b/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php index 5892147b7a0a1..675118b953102 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/Hydrator.php @@ -10,6 +10,8 @@ use Magento\Catalog\Api\Data\CategoryInterface; use Magento\Catalog\Model\Category; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CustomAttributesFlattener; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\Reflection\DataObjectProcessor; /** @@ -27,16 +29,23 @@ class Hydrator */ private $dataObjectProcessor; + /** @var Uid */ + private $uidEncoder; + /** * @param CustomAttributesFlattener $flattener * @param DataObjectProcessor $dataObjectProcessor + * @param Uid|null $uidEncoder */ public function __construct( CustomAttributesFlattener $flattener, - DataObjectProcessor $dataObjectProcessor + DataObjectProcessor $dataObjectProcessor, + Uid $uidEncoder = null ) { $this->flattener = $flattener; $this->dataObjectProcessor = $dataObjectProcessor; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -54,7 +63,7 @@ public function hydrateCategory(Category $category, $basicFieldsOnly = false) : $categoryData = $this->dataObjectProcessor->buildOutputDataArray($category, CategoryInterface::class); } $categoryData['id'] = $category->getId(); - $categoryData['uid'] = base64_encode($category->getId()); + $categoryData['uid'] = $this->uidEncoder->encode((string) $category->getId()); $categoryData['children'] = []; $categoryData['available_sort_by'] = $category->getAvailableSortBy(); $categoryData['model'] = $category; diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php index d953b3b7b2d03..04c1754e69eb8 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php @@ -9,6 +9,8 @@ use Magento\Catalog\Api\Data\CategoryInterface; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; /** * Breadcrumbs data provider @@ -20,13 +22,20 @@ class Breadcrumbs */ private $collectionFactory; + /** @var Uid */ + private $uidEncoder; + /** * @param CollectionFactory $collectionFactory + * @param Uid|null $uidEncoder */ public function __construct( - CollectionFactory $collectionFactory + CollectionFactory $collectionFactory, + Uid $uidEncoder = null ) { $this->collectionFactory = $collectionFactory; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -52,7 +61,7 @@ public function getData(string $categoryPath): array foreach ($collection as $category) { $breadcrumbsData[] = [ 'category_id' => $category->getId(), - 'category_uid' => base64_encode($category->getId()), + 'category_uid' => $this->uidEncoder->encode((string) $category->getId()), 'category_name' => $category->getName(), 'category_level' => $category->getLevel(), 'category_url_key' => $category->getUrlKey(), diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php index 8efd832fd4357..90d36e3ed8c82 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/EntityIdToUid.php @@ -7,13 +7,14 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** * The uid related data in the product graphql interface type @@ -25,12 +26,19 @@ class EntityIdToUid implements ResolverInterface */ private $metadataPool; + /** @var Uid */ + private $uidEncoder; + /** * @param MetadataPool $metadataPool + * @param Uid $uidEncoder */ - public function __construct(MetadataPool $metadataPool) - { + public function __construct( + MetadataPool $metadataPool, + Uid $uidEncoder + ) { $this->metadataPool = $metadataPool; + $this->uidEncoder = $uidEncoder; } /** @@ -54,6 +62,6 @@ public function resolve( $this->metadataPool->getMetadata(ProductInterface::class)->getIdentifierField() ); - return base64_encode($productId); + return $this->uidEncoder->encode((string) $productId); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php index e32981f4beb2b..d18386eddbe0a 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php @@ -7,8 +7,10 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Catalog\Model\Product; use Magento\Framework\GraphQl\Config\Element\Field; @@ -22,6 +24,18 @@ */ class MediaGalleryEntries implements ResolverInterface { + /** @var Uid */ + private $uidEncoder; + + /** + * Uid|null $uidEncoder + */ + public function __construct(Uid $uidEncoder = null) + { + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); + } + /** * @inheritdoc * @@ -53,7 +67,7 @@ public function resolve( if (!empty($product->getMediaGalleryEntries())) { foreach ($product->getMediaGalleryEntries() as $key => $entry) { $mediaGalleryEntries[$key] = $entry->getData(); - $mediaGalleryEntries[$key]['uid'] = base64_encode($entry->getId()); + $mediaGalleryEntries[$key]['uid'] = $this->uidEncoder->encode((string) $entry->getId()); if ($entry->getExtensionAttributes() && $entry->getExtensionAttributes()->getVideoContent()) { $mediaGalleryEntries[$key]['video_content'] = $entry->getExtensionAttributes()->getVideoContent()->getData(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php index b4156c1d7afa4..f735ab846689f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Options.php @@ -7,8 +7,10 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Option; @@ -25,6 +27,18 @@ class Options implements ResolverInterface */ private const OPTION_TYPE = 'custom-option'; + /** @var Uid */ + private $uidEncoder; + + /** + * Uid|null $uidEncoder + */ + public function __construct(Uid $uidEncoder = null) + { + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); + } + /** * @inheritdoc * @@ -60,8 +74,9 @@ public function resolve( $options[$key] = $option->getData(); $options[$key]['required'] = $option->getIsRequire(); $options[$key]['product_sku'] = $option->getProductSku(); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $options[$key]['uid'] = base64_encode(self::OPTION_TYPE . '/' . $option->getOptionId()); + $options[$key]['uid'] = $this->uidEncoder->encode( + self::OPTION_TYPE . '/' . $option->getOptionId() + ); $values = $option->getValues() ?: []; /** @var Option\Value $value */ foreach ($values as $valueKey => $value) { diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php index 9f6fe35621f11..33845c6dcce6e 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/CategoryUidArgsProcessor.php @@ -53,12 +53,10 @@ public function process( ); } elseif (!empty($uidFilter)) { if (isset($uidFilter['eq'])) { - $args['filter'][self::ID]['eq'] = $this->uidEncoder->decode( - $uidFilter['eq'] - ); + $args['filter'][self::ID]['eq'] = $this->uidEncoder->decode((string) $uidFilter['eq']); } elseif (!empty($uidFilter['in'])) { - foreach ($uidFilter['in'] as $uids) { - $args['filter'][self::ID]['in'][] = $this->uidEncoder->decode($uids); + foreach ($uidFilter['in'] as $uid) { + $args['filter'][self::ID]['in'][] = $this->uidEncoder->decode((string) $uid); } } unset($args['filter'][self::UID]); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php index 87af4ae6e520f..94e35cbbb2819 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php @@ -9,6 +9,7 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** @@ -16,11 +17,22 @@ */ class RootCategoryUid implements ResolverInterface { + /** @var Uid */ + private $uidEncoder; + + /** + * Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + /** * @inheritdoc */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - return base64_encode($context->getExtensionAttributes()->getStore()->getRootCategoryId()); + return $this->uidEncoder->decode((string) $context->getExtensionAttributes()->getStore()->getRootCategoryId()); } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php index 45bba6d449491..7801e4375f789 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php @@ -14,7 +14,9 @@ use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection as AttributeCollection; use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\GraphQl\Query\Uid; /** * Collection for fetching options for all configurable options pulled back in result set. @@ -51,19 +53,26 @@ class Collection */ private $attributeMap = []; + /** @var Uid */ + private $uidEncoder; + /** * @param CollectionFactory $attributeCollectionFactory * @param ProductFactory $productFactory * @param MetadataPool $metadataPool + * @param Uid|null $uidEncoder */ public function __construct( CollectionFactory $attributeCollectionFactory, ProductFactory $productFactory, - MetadataPool $metadataPool + MetadataPool $metadataPool, + Uid $uidEncoder = null ) { $this->attributeCollectionFactory = $attributeCollectionFactory; $this->productFactory = $productFactory; $this->metadataPool = $metadataPool; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -71,7 +80,7 @@ public function __construct( * * @param int $productId */ - public function addProductId(int $productId) : void + public function addProductId(int $productId): void { if (!in_array($productId, $this->productIds)) { $this->productIds[] = $productId; @@ -84,7 +93,7 @@ public function addProductId(int $productId) : void * @param int $productId * @return array */ - public function getAttributesByProductId(int $productId) : array + public function getAttributesByProductId(int $productId): array { $attributes = $this->fetch(); @@ -100,7 +109,7 @@ public function getAttributesByProductId(int $productId) : array * * @return array */ - private function fetch() : array + private function fetch(): array { if (empty($this->productIds) || !empty($this->attributeMap)) { return $this->attributeMap; @@ -126,15 +135,15 @@ private function fetch() : array $attributeData = $attribute->getData(); $this->attributeMap[$productId][$attribute->getId()] = $attribute->getData(); $this->attributeMap[$productId][$attribute->getId()]['id'] = $attribute->getId(); - $this->attributeMap[$productId][$attribute->getId()]['uid'] = base64_encode( - self::OPTION_TYPE . '/' . $attribute->getAttributeId() + $this->attributeMap[$productId][$attribute->getId()]['uid'] = $this->uidEncoder->encode( + self::OPTION_TYPE . '/' . $attribute->getId() ); $this->attributeMap[$productId][$attribute->getId()]['attribute_id_v2'] = $attribute->getProductAttribute()->getAttributeId(); $this->attributeMap[$productId][$attribute->getId()]['attribute_uid'] = - base64_encode($attribute->getProductAttribute()->getAttributeId()); + $this->uidEncoder->encode((string) $attribute->getProductAttribute()->getAttributeId()); $this->attributeMap[$productId][$attribute->getId()]['product_uid'] = - base64_encode($attribute->getProductId()); + $this->uidEncoder->encode((string) $attribute->getProductId()); $this->attributeMap[$productId][$attribute->getId()]['attribute_code'] = $attribute->getProductAttribute()->getAttributeCode(); $this->attributeMap[$productId][$attribute->getId()]['values'] = array_map( diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php index 6f259944216fd..e9458e21aff9e 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -8,8 +8,10 @@ namespace Magento\ConfigurableProductGraphQl\Model\Resolver; use Magento\Catalog\Helper\Product\Configuration; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Quote\Model\Quote\Item; @@ -29,13 +31,20 @@ class ConfigurableCartItemOptions implements ResolverInterface */ private $configurationHelper; + /** @var Uid */ + private $uidEncoder; + /** * @param Configuration $configurationHelper + * @param Uid|null $uidEncoder */ public function __construct( - Configuration $configurationHelper + Configuration $configurationHelper, + Uid $uidEncoder = null ) { $this->configurationHelper = $configurationHelper; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -66,10 +75,12 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } $result[] = [ 'id' => $option['option_id'], - 'configurable_product_options_uid' => base64_encode(self::OPTION_TYPE . '/' . $option['option_id']), + 'configurable_product_options_uid' => $this->uidEncoder->encode( + self::OPTION_TYPE . '/' . $option['option_id'] + ), 'option_label' => $option['label'], 'value_id' => $option['option_value'], - 'configurable_product_options_values_uid' => base64_encode( + 'configurable_product_options_values_uid' => $this->uidEncoder->encode( self::OPTION_TYPE . '/' . $option['option_id'] . '/' . $option['option_value'] ), 'value_label' => $option['value'], diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php index 3dd0bc5b80990..571e4aab4b51c 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php @@ -8,7 +8,9 @@ namespace Magento\CustomerGraphQl\Model\Customer; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\Serialize\SerializerInterface; use Magento\Framework\Webapi\ServiceOutputProcessor; use Magento\Customer\Api\Data\CustomerInterface; @@ -28,16 +30,23 @@ class ExtractCustomerData */ private $serializer; + /** @var Uid */ + private $uidEncoder; + /** * @param ServiceOutputProcessor $serviceOutputProcessor - * @param SerializerInterface $serializer + * @param SerializerInterface $serializer, + * @param Uid|null $uidEncoder */ public function __construct( ServiceOutputProcessor $serviceOutputProcessor, - SerializerInterface $serializer + SerializerInterface $serializer, + Uid $uidEncoder = null ) { $this->serviceOutputProcessor = $serviceOutputProcessor; $this->serializer = $serializer; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -104,7 +113,7 @@ public function execute(CustomerInterface $customer): array //Fields are deprecated and should not be exposed on storefront. $customerData['group_id'] = null; $customerData['id'] = null; - $customerData['uid'] = base64_encode((string)$customer->getId()); + $customerData['uid'] = $this->uidEncoder->encode((string) $customer->getId()); $customerData['model'] = $customer; diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php index 0b42a4cc94c7c..9d0c19cbc8f9c 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php @@ -7,7 +7,9 @@ namespace Magento\QuoteGraphQl\Model\CartItem\DataProvider; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Quote\Model\Quote\Item as QuoteItem; /** @@ -25,13 +27,20 @@ class CustomizableOption */ private $customizableOptionValue; + /** @var Uid */ + private $uidEncoder; + /** * @param CustomizableOptionValueInterface $customOptionValueDataProvider + * @param Uid|null $uidEncoder */ public function __construct( - CustomizableOptionValueInterface $customOptionValueDataProvider + CustomizableOptionValueInterface $customOptionValueDataProvider, + Uid $uidEncoder = null ) { $this->customizableOptionValue = $customOptionValueDataProvider; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -61,7 +70,7 @@ public function getData(QuoteItem $cartItem, int $optionId): array return [ 'id' => $option->getId(), - 'customizable_option_uid' => base64_encode(self::OPTION_TYPE . '/' . $option->getId()), + 'customizable_option_uid' => $this->uidEncoder->encode((string) self::OPTION_TYPE . '/' . $option->getId()), 'label' => $option->getTitle(), 'type' => $option->getType(), 'values' => $selectedOptionValueData, diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php index 82d4b0d4fd08f..d62c1951eda68 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Dropdown.php @@ -9,6 +9,8 @@ use Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product\Option\Type\Select as SelectOptionType; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Quote\Model\Quote\Item as QuoteItem; use Magento\Quote\Model\Quote\Item\Option as SelectedOption; use Magento\QuoteGraphQl\Model\CartItem\DataProvider\CustomizableOptionValueInterface; @@ -28,13 +30,20 @@ class Dropdown implements CustomizableOptionValueInterface */ private $priceUnitLabel; + /** @var Uid */ + private $uidEncoder; + /** * @param PriceUnitLabel $priceUnitLabel + * @param Uid|null $uidEncoder */ public function __construct( - PriceUnitLabel $priceUnitLabel + PriceUnitLabel $priceUnitLabel, + Uid $uidEncoder = null ) { $this->priceUnitLabel = $priceUnitLabel; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -63,7 +72,7 @@ public function getData( $selectedOptionValueData = [ 'id' => $selectedOption->getId(), - 'customizable_option_value_uid' => base64_encode((string)implode('/', $optionDetails)), + 'customizable_option_value_uid' => $this->uidEncoder->encode((string) implode('/', $optionDetails)), 'label' => $optionTypeRenderer->getFormattedOptionValue($selectedValue), 'value' => $selectedValue, 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php index df31686f4be4e..8831ee6304398 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php @@ -9,6 +9,8 @@ use Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product\Option\Type\DefaultType; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Quote\Model\Quote\Item as QuoteItem; use Magento\Quote\Model\Quote\Item\Option as SelectedOption; use Magento\QuoteGraphQl\Model\CartItem\DataProvider\CustomizableOptionValueInterface; @@ -28,13 +30,20 @@ class Multiple implements CustomizableOptionValueInterface */ private $priceUnitLabel; + /** @var Uid */ + private $uidEncoder; + /** * @param PriceUnitLabel $priceUnitLabel + * @param Uid|null $uidEncoder */ public function __construct( - PriceUnitLabel $priceUnitLabel + PriceUnitLabel $priceUnitLabel, + Uid $uidEncoder = null ) { $this->priceUnitLabel = $priceUnitLabel; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -64,7 +73,7 @@ public function getData( $selectedOptionValueData[] = [ 'id' => $selectedOption->getId(), - 'customizable_option_value_uid' => base64_encode((string)implode('/', $optionDetails)), + 'customizable_option_value_uid' => $this->uidEncoder->encode((string)implode('/', $optionDetails)), 'label' => $optionValue->getTitle(), 'value' => $optionId, 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php index 243a6cd66ead2..63877ee4b97d8 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php @@ -9,6 +9,8 @@ use Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product\Option\Type\Text as TextOptionType; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Quote\Model\Quote\Item as QuoteItem; use Magento\Quote\Model\Quote\Item\Option as SelectedOption; use Magento\QuoteGraphQl\Model\CartItem\DataProvider\CustomizableOptionValueInterface; @@ -23,13 +25,20 @@ class Text implements CustomizableOptionValueInterface */ private $priceUnitLabel; + /** @var Uid */ + private $uidEncoder; + /** * @param PriceUnitLabel $priceUnitLabel + * @param Uid|null $uidEncoder */ public function __construct( - PriceUnitLabel $priceUnitLabel + PriceUnitLabel $priceUnitLabel, + Uid $uidEncoder = null ) { $this->priceUnitLabel = $priceUnitLabel; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -47,7 +56,7 @@ public function getData( $selectedOptionValueData = [ 'id' => $selectedOption->getId(), - 'customizable_option_value_uid' => base64_encode((string)$selectedOption->getId()), + 'customizable_option_value_uid' => $this->uidEncoder->encode((string) $selectedOption->getId()), 'label' => '', 'value' => $optionTypeRenderer->getFormattedOptionValue($selectedOption->getValue()), 'price' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php index b1319429e5856..76788440f2f82 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php @@ -7,11 +7,13 @@ namespace Magento\QuoteGraphQl\Model\Resolver; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Quote\Model\Quote; use Magento\Quote\Model\Quote\Item as QuoteItem; @@ -27,12 +29,20 @@ class CartItems implements ResolverInterface */ private $getCartProducts; + /** @var Uid */ + private $uidEncoder; + /** * @param GetCartProducts $getCartProducts + * @param Uid|null $uidEncoder */ - public function __construct(GetCartProducts $getCartProducts) - { + public function __construct( + GetCartProducts $getCartProducts, + Uid $uidEncoder = null + ) { $this->getCartProducts = $getCartProducts; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -68,7 +78,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $itemsData[] = [ 'id' => $cartItem->getItemId(), - 'uid' => base64_encode((string)$cartItem->getItemId()), + 'uid' => $this->uidEncoder->encode((string) $cartItem->getItemId()), 'quantity' => $cartItem->getQty(), 'product' => $productData, 'model' => $cartItem, @@ -90,7 +100,7 @@ private function getCartProductsData(Quote $cart): array foreach ($products as $product) { $productsData[$product->getId()] = $product->getData(); $productsData[$product->getId()]['model'] = $product; - $productsData[$product->getId()]['uid'] = base64_encode($product->getId()); + $productsData[$product->getId()]['uid'] = $this->uidEncoder->encode((string) $product->getId()); } return $productsData; From 1c2769ed959b908722d2b6415580749041a8e59b Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 12 Nov 2020 21:29:58 -0600 Subject: [PATCH 148/490] MC-38340: GraphQL code changes for a consistent object uid - fix encode --- .../Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php index 94e35cbbb2819..9503e9f09b03c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/RootCategoryUid.php @@ -33,6 +33,6 @@ public function __construct(Uid $uidEncoder) */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - return $this->uidEncoder->decode((string) $context->getExtensionAttributes()->getStore()->getRootCategoryId()); + return $this->uidEncoder->encode((string) $context->getExtensionAttributes()->getStore()->getRootCategoryId()); } } From 0ce11a6b5b8dc7fe839f789a592cf87d6a1ec380 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 12 Nov 2020 22:54:32 -0600 Subject: [PATCH 149/490] MC-38340: GraphQL code changes for a consistent object uid - fix args processor --- .../Model/Category/CategoryUidsArgsProcessor.php | 2 +- app/code/Magento/CatalogGraphQl/etc/schema.graphqls | 4 ++-- .../GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php index d8a13acbd6a6e..e091be32698c7 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/CategoryUidsArgsProcessor.php @@ -18,7 +18,7 @@ class CategoryUidsArgsProcessor implements ArgumentsProcessorInterface { private const ID = 'ids'; - private const UID = 'category_uids'; + private const UID = 'category_uid'; /** @var Uid */ private $uidEncoder; diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index fa0f985e31f76..b97e086c46f6b 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -330,8 +330,8 @@ input ProductAttributeFilterInput @doc(description: "ProductAttributeFilterInput input CategoryFilterInput @doc(description: "CategoryFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { - ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uids` argument instead.") @doc(description: "Deprecated: use 'category_uids' to filter uniquely identifiers of categories.") - category_uids: FilterEqualTypeInput @doc(description: "Filter by category ID that uniquely identifies the category from objects implementing `CategoryInterface`.") + ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") + category_uid: FilterEqualTypeInput @doc(description: "Filter by category ID that uniquely identifies the category from objects implementing `CategoryInterface`.") url_key: FilterEqualTypeInput @doc(description: "Filter by the part of the URL that identifies the category.") name: FilterMatchTypeInput @doc(description: "Filter by the display name of the category.") url_path: FilterEqualTypeInput @doc(description: "Filter by the URL path for the category.") diff --git a/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php index 1332d080e50bb..8515164e4323e 100644 --- a/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php +++ b/lib/internal/Magento/Framework/GraphQl/Query/Resolver/ArgumentsCompositeProcessor.php @@ -43,7 +43,7 @@ public function process( foreach ($this->processors as $processor) { $processedArgs = $processor->process( $fieldName, - $args + $processedArgs ); } From 9a7506e0bc2534cd071e7fcd5dd542fcf6727f95 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 12 Nov 2020 23:20:06 -0600 Subject: [PATCH 150/490] MC-38340: GraphQL code changes for a consistent object uid - fix category test --- .../GraphQl/Catalog/CategoryListTest.php | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php index 43612575a7dcb..7cb7dacf2b188 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php @@ -42,6 +42,7 @@ public function testFilterSingleCategoryByField($field, $condition, $value, $exp { categoryList(filters: { $field : { $condition : "$value" } }){ id + uid name url_key url_path @@ -71,6 +72,7 @@ public function testFilterMultipleCategoriesByField($field, $condition, $value, { categoryList(filters: { $field : { $condition : $value } }){ id + uid name url_key url_path @@ -337,6 +339,7 @@ public function testEmptyFiltersReturnRootCategory() { categoryList{ id + uid name url_key url_path @@ -354,6 +357,7 @@ public function testEmptyFiltersReturnRootCategory() $this->assertArrayHasKey('categoryList', $result); $this->assertEquals('Default Category', $result['categoryList'][0]['name']); $this->assertEquals($storeRootCategoryId, $result['categoryList'][0]['id']); + $this->assertEquals(base64_encode($storeRootCategoryId), $result['categoryList'][0]['uid']); } /** @@ -370,6 +374,7 @@ public function testMinimumMatchQueryLength() { categoryList(filters: {name: {match: "mo"}}){ id + uid name url_key url_path @@ -542,6 +547,22 @@ public function filterSingleCategoryDataProvider(): array '4', [ 'id' => '4', + 'uid' => base64_encode('4'), + 'name' => 'Category 1.1', + 'url_key' => 'category-1-1', + 'url_path' => 'category-1/category-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4', + 'position' => '1' + ] + ], + [ + 'category_uid', + 'eq', + base64_encode('4'), + [ + 'id' => '4', + 'uid' => base64_encode('4'), 'name' => 'Category 1.1', 'url_key' => 'category-1-1', 'url_path' => 'category-1/category-1-1', @@ -556,6 +577,7 @@ public function filterSingleCategoryDataProvider(): array 'Movable Position 2', [ 'id' => '10', + 'uid' => base64_encode('10'), 'name' => 'Movable Position 2', 'url_key' => 'movable-position-2', 'url_path' => 'movable-position-2', @@ -596,6 +618,45 @@ public function filterMultipleCategoriesDataProvider(): array [ [ 'id' => '4', + 'uid' => base64_encode('4'), + 'name' => 'Category 1.1', + 'url_key' => 'category-1-1', + 'url_path' => 'category-1/category-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4', + 'position' => '1' + ], + [ + 'id' => '9', + 'uid' => base64_encode('9'), + 'name' => 'Movable Position 1', + 'url_key' => 'movable-position-1', + 'url_path' => 'movable-position-1', + 'children_count' => '0', + 'path' => '1/2/9', + 'position' => '5' + ], + [ + 'id' => '10', + 'uid' => base64_encode('10'), + 'name' => 'Movable Position 2', + 'url_key' => 'movable-position-2', + 'url_path' => 'movable-position-2', + 'children_count' => '0', + 'path' => '1/2/10', + 'position' => '6' + ] + ] + ], + //Filter by multiple UIDs + [ + 'category_uid', + 'in', + '["' . base64_encode('4') . '", "' . base64_encode('9') . '", "' . base64_encode('10') . '"]', + [ + [ + 'id' => '4', + 'uid' => base64_encode('4'), 'name' => 'Category 1.1', 'url_key' => 'category-1-1', 'url_path' => 'category-1/category-1-1', @@ -605,6 +666,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '9', + 'uid' => base64_encode('9'), 'name' => 'Movable Position 1', 'url_key' => 'movable-position-1', 'url_path' => 'movable-position-1', @@ -614,6 +676,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '10', + 'uid' => base64_encode('10'), 'name' => 'Movable Position 2', 'url_key' => 'movable-position-2', 'url_path' => 'movable-position-2', @@ -631,6 +694,7 @@ public function filterMultipleCategoriesDataProvider(): array [ [ 'id' => '13', + 'uid' => base64_encode('13'), 'name' => 'Category 1.2', 'url_key' => 'category-1-2', 'url_path' => 'category-1/category-1-2', @@ -640,6 +704,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '7', + 'uid' => base64_encode('7'), 'name' => 'Movable', 'url_key' => 'movable', 'url_path' => 'movable', @@ -657,6 +722,7 @@ public function filterMultipleCategoriesDataProvider(): array [ [ 'id' => '9', + 'uid' => base64_encode('9'), 'name' => 'Movable Position 1', 'url_key' => 'movable-position-1', 'url_path' => 'movable-position-1', @@ -666,6 +732,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '10', + 'uid' => base64_encode('10'), 'name' => 'Movable Position 2', 'url_key' => 'movable-position-2', 'url_path' => 'movable-position-2', @@ -675,6 +742,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '11', + 'uid' => base64_encode('11'), 'name' => 'Movable Position 3', 'url_key' => 'movable-position-3', 'url_path' => 'movable-position-3', @@ -725,6 +793,7 @@ public function testFilterCategoryInlineFragment() categoryList(filters: {ids: {eq: "6"}}){ ... on CategoryTree { id + uid name url_key url_path @@ -739,6 +808,7 @@ public function testFilterCategoryInlineFragment() $this->assertArrayNotHasKey('errors', $result); $this->assertCount(1, $result['categoryList']); $this->assertEquals($result['categoryList'][0]['name'], 'Category 2'); + $this->assertEquals($result['categoryList'][0]['uid'], base64_encode('6')); $this->assertEquals($result['categoryList'][0]['url_path'], 'category-2'); } @@ -756,6 +826,7 @@ public function testFilterCategoryNamedFragment() fragment Cat on CategoryTree { id + uid name url_key url_path @@ -768,6 +839,7 @@ public function testFilterCategoryNamedFragment() $this->assertArrayNotHasKey('errors', $result); $this->assertCount(1, $result['categoryList']); $this->assertEquals($result['categoryList'][0]['name'], 'Category 2'); + $this->assertEquals($result['categoryList'][0]['uid'], base64_encode('6')); $this->assertEquals($result['categoryList'][0]['url_path'], 'category-2'); } } From 94d21ef40b8636a73ab46b72d7ad521ab5a75907 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Fri, 13 Nov 2020 00:22:57 -0600 Subject: [PATCH 151/490] MC-38576: Apply default quantity for Bundle product options when there is large amount of options - fixed - modified mftf test --- .../Mftf/Test/AdminAddBundleItemsTest.xml | 23 +++++++++++++++++++ .../web/js/components/bundle-option-qty.js | 20 +++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 26119c5267d86..39d026ac74731 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -59,6 +59,18 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> + <!-- Check that Bundle Options initialized with default quantity --> + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/> + <assertEquals stepKey="assertFirstBundleOptionDefaultQuantity"> + <expectedResult type="string">1</expectedResult> + <actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/> + <assertEquals stepKey="assertSecondBundleOptionDefaultQuantity"> + <expectedResult type="string">1</expectedResult> + <actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult> + </assertEquals> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> @@ -108,6 +120,17 @@ </actionGroup> <checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddNewSelectedBundleProducts"/> + <!-- Check that existing Bundle Options do not loose user input quantity values --> + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/> + <assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput"> + <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> + <actualResult type="string">$grabbedFirstBundleOptionQuantityAfterUserInput</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantityAfterUserInput"/> + <assertEquals stepKey="assertSecondBundleOptionDefaultQuantityAfterUserInput"> + <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> + <actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult> + </assertEquals> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '2')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '3')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js index e61def6e962a4..1190d96d03bc4 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js @@ -17,6 +17,25 @@ define([ } }, + /** + * + * @inheritdoc + */ + setInitialValue:function () { + this.initialValue = this.getInitialValue(); + if (this.initialValue === undefined || this.initialValue === '') { + this.initialValue = 1; + } + + if (this.value.peek() !== this.initialValue) { + this.value(this.initialValue); + } + + this.on('value', this.onUpdate.bind(this)); + this.isUseDefault(this.disabled()); + return this; + }, + /** * @inheritdoc */ @@ -33,6 +52,5 @@ define([ return !this.visible() ? false : notEqual; } - }); }); From ffba6aaa87dcef232bb8337d9bab03d63cbdab50 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Fri, 13 Nov 2020 01:05:38 -0600 Subject: [PATCH 152/490] MC-38576 Apply default quantity for Bundle product options when there is large amount of options - fixed static test fail --- .../view/adminhtml/web/js/components/bundle-option-qty.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js index 1190d96d03bc4..8009e47426ffa 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js @@ -21,7 +21,7 @@ define([ * * @inheritdoc */ - setInitialValue:function () { + setInitialValue: function () { this.initialValue = this.getInitialValue(); if (this.initialValue === undefined || this.initialValue === '') { this.initialValue = 1; From 09b41aef042dbc2a37d4b9739eda008195185d73 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Fri, 13 Nov 2020 01:09:51 -0600 Subject: [PATCH 153/490] MC-38576 Apply default quantity for Bundle product options when there is large amount of options - doc comment block --- .../Bundle/view/adminhtml/web/js/components/bundle-option-qty.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js index 8009e47426ffa..e430fecbb028a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js @@ -18,7 +18,6 @@ define([ }, /** - * * @inheritdoc */ setInitialValue: function () { From c06db23994728390d6a7e60d9f6e7b2bbc86a315 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Fri, 13 Nov 2020 01:56:30 -0600 Subject: [PATCH 154/490] MC-38576 Apply default quantity for Bundle product options when there is large amount of options - static failure new lines --- .../view/adminhtml/web/js/components/bundle-option-qty.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js index e430fecbb028a..5904b20a5dabe 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js @@ -22,6 +22,7 @@ define([ */ setInitialValue: function () { this.initialValue = this.getInitialValue(); + if (this.initialValue === undefined || this.initialValue === '') { this.initialValue = 1; } @@ -32,6 +33,7 @@ define([ this.on('value', this.onUpdate.bind(this)); this.isUseDefault(this.disabled()); + return this; }, From 923c723e840e9c79f5e757b4517e4172e04faaa2 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 13 Nov 2020 10:24:53 +0200 Subject: [PATCH 155/490] Update schema description --- .../CompareListGraphQl/etc/schema.graphqls | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 31b4743a30b51..510a9250bb7d3 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -2,60 +2,60 @@ # See COPYING.txt for license details. type ComparableItem { - uid: ID! + uid: ID! @doc(description: "The unique ID of an item in a compare list") product: ProductInterface! - attributes: [ProductAttribute]! @doc(description: "Product comparable attributes") + attributes: [ProductAttribute]! @doc(description: "An array of product attributes that can be used to compare products") } type ProductAttribute { - code: String! @doc(description:"Attribute code") - value: String! @doc(description:"Attribute display value") + code: String! @doc(description: "The unique identifier for a product attribute code.") + value: String! @doc(description:"The display value of the attribute") } type ComparableAttribute { - code: String! @doc(description: "Attribute code") - label: String! @doc(description: "Attribute label") + code: String! @doc(description: "An attribute code that is enabled for product comparisons") + label: String! @doc(description: "The label of the attribute code") } type CompareList { - uid: ID! @doc(description: "Compare list id") - items: [ComparableItem] @doc(description: "Comparable products") - attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") + uid: ID! @doc(description: "The unique ID assigned to the compare list") + items: [ComparableItem] @doc(description: "An array of products to compare") + attributes: [ComparableAttribute] @doc(description: "An array of attributes that can be used for comparing products") item_count: Int! } type Customer { - compare_list: CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CustomerCompareList") @doc(description: "Active customers compare list") + compare_list: CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CustomerCompareList") @doc(description: "The contents of the customer's compare list") } type Query { - compareList(uid: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Compare list") + compareList(uid: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Return products that have been added to the specified compare list") } type Mutation { - createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") - addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to compare list") - removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from compare list") + createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. The compare list is saved for logged in customers") + addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to the specified compare list") + removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from the specified compare list") assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") - deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete compare list") + deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete the specified compare list") } input CreateCompareListInput { - products: [ID!] + products: [ID!] @doc(description: "An array of product IDs to add to the compare list") } input AddProductsToCompareListInput { - uid: ID!, - products: [ID!]! + uid: ID!, @doc(description: "The unique identifier of the compare list to modify") + products: [ID!]! @doc(description: "An array of product IDs to add to the compare list") } input RemoveProductsFromCompareListInput { - uid: ID!, - products: [ID!]! + uid: ID!, @doc(description: "The unique identifier of the compare list to modify") + products: [ID!]! @doc(description: "An array of product IDs to remove from the compare list") } type DeleteCompareListOutput { - result: Boolean! + result: Boolean! @doc(description: "Indicates whether the compare list was successfully deleted") } type AssignCompareListToCustomerOutput { From 34790b045fdf2caffbf19f7469fd8b5c56ca3a0b Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 13 Nov 2020 12:05:32 +0200 Subject: [PATCH 156/490] minor changes --- app/code/Magento/CompareListGraphQl/etc/schema.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 510a9250bb7d3..ebae3ca0ff940 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -3,7 +3,7 @@ type ComparableItem { uid: ID! @doc(description: "The unique ID of an item in a compare list") - product: ProductInterface! + product: ProductInterface! @doc(description: "Contains details about a product in a compare list") attributes: [ProductAttribute]! @doc(description: "An array of product attributes that can be used to compare products") } @@ -36,7 +36,7 @@ type Mutation { createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. The compare list is saved for logged in customers") addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to the specified compare list") removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from the specified compare list") - assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign compare list to customer") + assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign the specified compare list to the logged in customer") deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete the specified compare list") } From 8fcac9d9bd81270a717f5311f774850a42980d5a Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 13 Nov 2020 14:39:07 +0200 Subject: [PATCH 157/490] fix iterate on null for getActiveCarriers, add unit test --- app/code/Magento/Shipping/Model/Config.php | 44 +++-- .../Shipping/Test/Unit/Model/ConfigTest.php | 152 ++++++++++++++++++ 2 files changed, 183 insertions(+), 13 deletions(-) create mode 100644 app/code/Magento/Shipping/Test/Unit/Model/ConfigTest.php diff --git a/app/code/Magento/Shipping/Model/Config.php b/app/code/Magento/Shipping/Model/Config.php index d6e13dbea0faf..b71d983bd064c 100644 --- a/app/code/Magento/Shipping/Model/Config.php +++ b/app/code/Magento/Shipping/Model/Config.php @@ -4,16 +4,21 @@ * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Shipping\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\DataObject; use Magento\Shipping\Model\Carrier\AbstractCarrierInterface; +use Magento\Store\Model\ScopeInterface; /** - * Class Config + * Config model for shipping * @api * @since 100.0.2 */ -class Config extends \Magento\Framework\DataObject +class Config extends DataObject { /** * Shipping origin settings @@ -29,25 +34,25 @@ class Config extends \Magento\Framework\DataObject /** * Core store config * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\Shipping\Model\CarrierFactory + * @var CarrierFactory */ protected $_carrierFactory; /** * Constructor * - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory + * @param ScopeConfigInterface $scopeConfig + * @param CarrierFactory $carrierFactory * @param array $data */ public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Shipping\Model\CarrierFactory $carrierFactory, + ScopeConfigInterface $scopeConfig, + CarrierFactory $carrierFactory, array $data = [] ) { $this->_scopeConfig = $scopeConfig; @@ -61,14 +66,14 @@ public function __construct( * @param mixed $store * @return AbstractCarrierInterface[] */ - public function getActiveCarriers($store = null) + public function getActiveCarriers($store = null): array { $carriers = []; - $config = $this->_scopeConfig->getValue('carriers', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store); + $config = $this->getCarriersConfig($store); foreach (array_keys($config) as $carrierCode) { if ($this->_scopeConfig->isSetFlag( 'carriers/' . $carrierCode . '/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + ScopeInterface::SCOPE_STORE, $store )) { $carrierModel = $this->_carrierFactory->create($carrierCode, $store); @@ -77,6 +82,7 @@ public function getActiveCarriers($store = null) } } } + return $carriers; } @@ -86,16 +92,28 @@ public function getActiveCarriers($store = null) * @param mixed $store * @return AbstractCarrierInterface[] */ - public function getAllCarriers($store = null) + public function getAllCarriers($store = null): array { $carriers = []; - $config = $this->_scopeConfig->getValue('carriers', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store) ?: []; + $config = $this->getCarriersConfig($store); foreach (array_keys($config) as $carrierCode) { $model = $this->_carrierFactory->create($carrierCode, $store); if ($model) { $carriers[$carrierCode] = $model; } } + return $carriers; } + + /** + * Returns carriers config by store + * + * @param mixed $store + * @return array + */ + private function getCarriersConfig($store = null): array + { + return $this->_scopeConfig->getValue('carriers', ScopeInterface::SCOPE_STORE, $store) ?: []; + } } diff --git a/app/code/Magento/Shipping/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Shipping/Test/Unit/Model/ConfigTest.php new file mode 100644 index 0000000000000..e676b698c7f0e --- /dev/null +++ b/app/code/Magento/Shipping/Test/Unit/Model/ConfigTest.php @@ -0,0 +1,152 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Shipping\Test\Unit\Model; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Shipping\Model\CarrierFactory; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Shipping\Model\Config; + +/** + * Test for \Magento\Shipping\Model\Config. + */ +class ConfigTest extends TestCase +{ + private const STUB_STORE_CODE = 'default'; + + /** + * @var array + */ + private $shippingCarriersData = [ + 'flatrate' => [ + 'active' => '1', + 'name' => 'Fixed', + 'title' => 'Flat Rate', + ], + 'tablerate' => [ + 'active' => '0', + 'name' => 'Table Rate', + 'title' => 'Best Way', + ] + ]; + + /** + * @var Config + */ + private $model; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var CarrierFactory|MockObject + */ + private $carrierFactoryMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->carrierFactoryMock = $this->createMock(CarrierFactory::class); + + $this->model = new Config($this->scopeConfigMock, $this->carrierFactoryMock, []); + } + + /** + * Get active carriers when there is no active on the store + * + * @return void + */ + public function testGetActiveCarriersWhenThereIsNoAvailable(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with('carriers', ScopeInterface::SCOPE_STORE, null) + ->willReturn(null); + + $this->assertEquals([], $this->model->getActiveCarriers()); + } + + /** + * Test for getActiveCarriers + * + * @return void + */ + public function testGetActiveCarriers(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with('carriers', ScopeInterface::SCOPE_STORE, self::STUB_STORE_CODE) + ->willReturn($this->shippingCarriersData); + + $this->scopeConfigMock->expects($this->exactly(2)) + ->method('isSetFlag') + ->withConsecutive( + ['carriers/flatrate/active', ScopeInterface::SCOPE_STORE, self::STUB_STORE_CODE], + ['carriers/tablerate/active', ScopeInterface::SCOPE_STORE, self::STUB_STORE_CODE], + ) + ->willReturnOnConsecutiveCalls( + true, + false, + ); + + $this->carrierFactoryMock->expects($this->once()) + ->method('create') + ->with('flatrate', self::STUB_STORE_CODE) + ->willReturn(true); + + $this->assertEquals(['flatrate' => true], $this->model->getActiveCarriers(self::STUB_STORE_CODE)); + } + + /** + * Get all carriers when there is no carriers available on the store + * + * @return void + */ + public function testGetAllCarriersWhenThereIsNoAvailable(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with('carriers', ScopeInterface::SCOPE_STORE, null) + ->willReturn(null); + + $this->assertEquals([], $this->model->getAllCarriers()); + } + + /** + * Test for getAllCarriers + * + * @return void + */ + public function testGetAllCarriers(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with('carriers', ScopeInterface::SCOPE_STORE, self::STUB_STORE_CODE) + ->willReturn($this->shippingCarriersData); + + $this->carrierFactoryMock->expects($this->exactly(2)) + ->method('create') + ->withConsecutive( + ['flatrate', self::STUB_STORE_CODE], + ['tablerate', self::STUB_STORE_CODE], + ) + ->willReturnOnConsecutiveCalls( + true, + false, + ); + + $this->assertEquals(['flatrate' => true], $this->model->getAllCarriers(self::STUB_STORE_CODE)); + } +} From c07e1b1635e975cf782f6e43ac9fbc78df7b7a65 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Fri, 13 Nov 2020 11:15:23 -0600 Subject: [PATCH 158/490] MC-37484: Cart query error when trying to switch store view --- .../QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php index fb6c1e678f1f0..bc753d50db68a 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php @@ -69,6 +69,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->checkCartCheckoutAllowance->execute($cart); $this->setPaymentMethodOnCart->execute($cart, $paymentData); + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); return [ 'cart' => [ From a9cffd6382e75dae59a8d7f69d1a45ef01e2646f Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Fri, 13 Nov 2020 20:32:44 +0200 Subject: [PATCH 159/490] changes in composer.json --- app/code/Magento/CompareListGraphQl/composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/composer.json b/app/code/Magento/CompareListGraphQl/composer.json index 0c3c76e49f85d..dd9c998857258 100644 --- a/app/code/Magento/CompareListGraphQl/composer.json +++ b/app/code/Magento/CompareListGraphQl/composer.json @@ -1,14 +1,12 @@ { "name": "magento/module-compare-list-graph-ql", - "version": "1.0.0", "description": "N/A", "type": "magento2-module", "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-catalog": "*", - "magento/module-customer": "*", - "magento/module-store": "*" + "magento/module-customer": "*" }, "license": [ "OSL-3.0", From 0ed37908f12e709ad4edfee071e25df2f780af6c Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 13 Nov 2020 12:55:35 -0600 Subject: [PATCH 160/490] MC-38340: GraphQL code changes for a consistent object uid - fix category test --- .../CategoriesQuery/CategoriesFilterTest.php | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php index 09f39bf1441f5..4d39b5f9bd3bb 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php @@ -32,6 +32,7 @@ public function testFilterSingleCategoryByField($field, $condition, $value, $exp categories(filters: { $field : { $condition : "$value" } }){ items{ id + uid name url_key url_path @@ -63,6 +64,7 @@ public function testFilterMultipleCategoriesByField($field, $condition, $value, categories(filters: { $field : { $condition : $value } }){ items{ id + uid name url_key url_path @@ -92,6 +94,7 @@ public function testFilterCategoryByMultipleFields() total_count items{ id + uid name url_key url_path @@ -122,6 +125,7 @@ public function testFilterWithInactiveCategory() categories(filters: {url_key: {in: ["inactive", "category-2"]}}){ items{ id + uid name url_key url_path @@ -147,6 +151,7 @@ public function testQueryChildCategoriesWithProducts() categories(filters: {ids: {in: ["3"]}}){ items{ id + uid name url_key url_path @@ -233,6 +238,7 @@ public function testQueryCategoryWithDisabledChildren() categories(filters: {ids: {in: ["3"]}}){ items{ id + uid name image url_key @@ -315,6 +321,7 @@ public function testNoResultsFound() categories(filters: {url_key: {in: ["inactive", "does-not-exist"]}}){ items{ id + uid name url_key url_path @@ -343,6 +350,7 @@ public function testEmptyFiltersReturnRootCategory() categories{ items{ id + uid name url_key url_path @@ -378,6 +386,7 @@ public function testMinimumMatchQueryLength() categories(filters: {name: {match: "mo"}}){ items{ id + uid name url_key url_path @@ -412,6 +421,7 @@ public function testCategoryImageNameAndSeoDisabled() categories(filters: {ids: {in: ["$categoryId"]}}) { items{ id + uid name image } @@ -444,6 +454,7 @@ public function testFilterByUrlPathTopLevelCategory() categories(filters: {url_path: {eq: "$urlPath"}}){ items{ id + uid name url_key url_path @@ -473,6 +484,7 @@ public function testFilterByUrlPathNestedCategory() categories(filters: {url_path: {eq: "$urlPath"}}){ items{ id + uid name url_key url_path @@ -503,6 +515,7 @@ public function testFilterByUrlPathMultipleCategories() categories(filters: {url_path: {in: [$urlPathsString]}}){ items{ id + uid name url_key url_path @@ -533,6 +546,7 @@ public function testFilterByUrlPathNoResults() categories(filters: {url_path: {in: ["not-a-category url path"]}}){ items{ id + uid name url_key url_path @@ -561,6 +575,22 @@ public function filterSingleCategoryDataProvider(): array '4', [ 'id' => '4', + 'uid' => base64_encode('4'), + 'name' => 'Category 1.1', + 'url_key' => 'category-1-1', + 'url_path' => 'category-1/category-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4', + 'position' => '1' + ] + ], + [ + 'category_uid', + 'eq', + base64_encode('4'), + [ + 'id' => '4', + 'uid' => base64_encode('4'), 'name' => 'Category 1.1', 'url_key' => 'category-1-1', 'url_path' => 'category-1/category-1-1', @@ -575,6 +605,7 @@ public function filterSingleCategoryDataProvider(): array 'Movable Position 2', [ 'id' => '10', + 'uid' => base64_encode('10'), 'name' => 'Movable Position 2', 'url_key' => 'movable-position-2', 'url_path' => 'movable-position-2', @@ -589,6 +620,7 @@ public function filterSingleCategoryDataProvider(): array 'category-1-1-1', [ 'id' => '5', + 'uid' => base64_encode('5'), 'name' => 'Category 1.1.1', 'url_key' => 'category-1-1-1', 'url_path' => 'category-1/category-1-1/category-1-1-1', @@ -642,6 +674,44 @@ public function filterMultipleCategoriesDataProvider(): array ] ] ], + //Filter by multiple UIDs + [ + 'category_uid', + 'in', + '["' . base64_encode('4') . '", "' . base64_encode('9') . '", "' . base64_encode('10') . '"]', + [ + [ + 'id' => '4', + 'uid' => base64_encode('4'), + 'name' => 'Category 1.1', + 'url_key' => 'category-1-1', + 'url_path' => 'category-1/category-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4', + 'position' => '1' + ], + [ + 'id' => '9', + 'uid' => base64_encode('9'), + 'name' => 'Movable Position 1', + 'url_key' => 'movable-position-1', + 'url_path' => 'movable-position-1', + 'children_count' => '0', + 'path' => '1/2/9', + 'position' => '5' + ], + [ + 'id' => '10', + 'uid' => base64_encode('10'), + 'name' => 'Movable Position 2', + 'url_key' => 'movable-position-2', + 'url_path' => 'movable-position-2', + 'children_count' => '0', + 'path' => '1/2/10', + 'position' => '6' + ] + ] + ], //Filter by multiple url keys [ 'url_key', @@ -650,6 +720,7 @@ public function filterMultipleCategoriesDataProvider(): array [ [ 'id' => '13', + 'uid' => base64_encode('13'), 'name' => 'Category 1.2', 'url_key' => 'category-1-2', 'url_path' => 'category-1/category-1-2', @@ -659,6 +730,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '7', + 'uid' => base64_encode('7'), 'name' => 'Movable', 'url_key' => 'movable', 'url_path' => 'movable', @@ -676,6 +748,7 @@ public function filterMultipleCategoriesDataProvider(): array [ [ 'id' => '9', + 'uid' => base64_encode('9'), 'name' => 'Movable Position 1', 'url_key' => 'movable-position-1', 'url_path' => 'movable-position-1', @@ -685,6 +758,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '10', + 'uid' => base64_encode('10'), 'name' => 'Movable Position 2', 'url_key' => 'movable-position-2', 'url_path' => 'movable-position-2', @@ -694,6 +768,7 @@ public function filterMultipleCategoriesDataProvider(): array ], [ 'id' => '11', + 'uid' => base64_encode('11'), 'name' => 'Movable Position 3', 'url_key' => 'movable-position-3', 'url_path' => 'movable-position-3', From 72d4b83f811c7b6a10977e2320074dd2c2505257 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 13 Nov 2020 14:29:53 -0600 Subject: [PATCH 161/490] MC-38340: GraphQL code changes for a consistent object uid - fix category test --- .../GraphQl/Catalog/ProductViewTest.php | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 9946e74a24994..385df7d594900 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -50,6 +50,7 @@ public function testQueryAllFieldsSimpleProduct() created_at gift_message_available id + uid categories { name url_path @@ -65,6 +66,7 @@ public function testQueryAllFieldsSimpleProduct() disabled file id + uid label media_type position @@ -91,6 +93,7 @@ public function testQueryAllFieldsSimpleProduct() options_container ... on CustomizableProductInterface { options { + uid title required sort_order @@ -232,7 +235,7 @@ public function testQueryAllFieldsSimpleProduct() special_from_date special_price special_to_date - swatch_image + swatch_image tier_price tier_prices { @@ -307,11 +310,13 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() categories { id + uid } country_of_manufacture created_at gift_message_available id + uid image {url, label} meta_description meta_keyword @@ -321,6 +326,7 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() disabled file id + uid label media_type position @@ -351,6 +357,7 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() required sort_order option_id + uid ... on CustomizableFieldOption { product_sku field_option: value { @@ -588,6 +595,7 @@ public function testProductPrices() attribute_set_id created_at id + uid name price { minimalPrice { @@ -679,6 +687,7 @@ private function assertMediaGalleryEntries($product, $actualResponse) 'disabled' => (bool)$mediaGalleryEntry->isDisabled(), 'file' => $mediaGalleryEntry->getFile(), 'id' => $mediaGalleryEntry->getId(), + 'uid' => base64_encode($mediaGalleryEntry->getId()), 'label' => $mediaGalleryEntry->getLabel(), 'media_type' => $mediaGalleryEntry->getMediaType(), 'position' => $mediaGalleryEntry->getPosition(), @@ -744,7 +753,11 @@ private function assertOptions($product, $actualResponse) ['response_field' => 'sort_order', 'expected_value' => $option->getSortOrder()], ['response_field' => 'title', 'expected_value' => $option->getTitle()], ['response_field' => 'required', 'expected_value' => $option->getIsRequire()], - ['response_field' => 'option_id', 'expected_value' => $option->getOptionId()] + ['response_field' => 'option_id', 'expected_value' => $option->getOptionId()], + [ + 'response_field' => 'uid', + 'expected_value' => base64_encode('custom-option/' . $option->getOptionId()) + ] ]; if (!empty($option->getValues())) { @@ -813,14 +826,13 @@ private function assertOptions($product, $actualResponse) */ private function assertBaseFields($product, $actualResponse) { - $assertionMap = [ ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], ['response_field' => 'id', 'expected_value' => $product->getId()], + ['response_field' => 'uid', 'expected_value' => base64_encode($product->getId())], ['response_field' => 'name', 'expected_value' => $product->getName()], - ['response_field' => 'price', 'expected_value' => - [ + ['response_field' => 'price', 'expected_value' => [ 'minimalPrice' => [ 'amount' => [ 'value' => $product->getSpecialPrice(), @@ -956,6 +968,7 @@ public function testProductInAllAnchoredCategories() name categories { id + uid name is_anchor } @@ -982,6 +995,7 @@ public function testProductInAllAnchoredCategories() [ 'name' => $category->getName(), 'id' => $category->getId(), + 'uid' => base64_encode($category->getId()), 'is_anchor' => $category->getIsAnchor() ] ); @@ -1006,6 +1020,7 @@ public function testProductWithNonAnchoredParentCategory() name categories { id + uid name is_anchor } @@ -1037,6 +1052,7 @@ public function testProductWithNonAnchoredParentCategory() [ 'name' => $category->getName(), 'id' => $category->getId(), + 'uid' => base64_encode($category->getId()), 'is_anchor' => $category->getIsAnchor() ] ); @@ -1054,7 +1070,7 @@ public function testProductInNonAnchoredSubCategories() $query = <<<QUERY { - products(filter: + products(filter: { sku: {in:["12345"]} } @@ -1066,6 +1082,7 @@ public function testProductInNonAnchoredSubCategories() name categories { id + uid name is_anchor } @@ -1098,6 +1115,7 @@ public function testProductInNonAnchoredSubCategories() [ 'name' => $category->getName(), 'id' => $category->getId(), + 'uid' => base64_encode($category->getId()), 'is_anchor' => $category->getIsAnchor() ] ); From 8d6e84e2ae52f6d4358589dc3f1ebec9fa80448f Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 13 Nov 2020 17:01:49 -0600 Subject: [PATCH 162/490] MC-38340: GraphQL code changes for a consistent object uid - fix category test --- .../CategoriesQuery/CategoryTreeTest.php | 31 ++++++++++ .../Magento/GraphQl/Catalog/CategoryTest.php | 5 ++ .../GraphQl/Catalog/ProductSearchTest.php | 57 +++++++++++++++++-- 3 files changed, 87 insertions(+), 6 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php index dbbeaebc15936..242c96f3f9c89 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryTreeTest.php @@ -636,6 +636,37 @@ public function testCategoryImage(?string $imagePrefix) $this->assertEquals($expectedImageUrl, $childCategory['image']); } + /** + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testGetCategoryWithIdAndUid() + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('`ids` and `category_uid` can\'t be used at the same time'); + + $categoryId = 8; + $categoryUid = base64_encode((string) 8); + $query = <<<QUERY +{ +categories(filters: {ids: {in: ["$categoryId"]}, category_uid: {in: ["$categoryUid"]}}) { + items { + id + name + url_key + image + children { + id + name + url_key + image + } + } +} +} +QUERY; + $this->graphQlQuery($query); + } + /** * @return array */ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index 72b014fd39f0e..03f625125572a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -541,6 +541,7 @@ public function testBreadCrumbs() name breadcrumbs { category_id + category_uid category_name category_level category_url_key @@ -556,6 +557,7 @@ public function testBreadCrumbs() 'breadcrumbs' => [ [ 'category_id' => 3, + 'category_uid' => base64_encode('3'), 'category_name' => "Category 1", 'category_level' => 2, 'category_url_key' => "category-1", @@ -563,6 +565,7 @@ public function testBreadCrumbs() ], [ 'category_id' => 4, + 'category_uid' => base64_encode('4'), 'category_name' => "Category 1.1", 'category_level' => 3, 'category_url_key' => "category-1-1", @@ -679,6 +682,7 @@ public function testBreadCrumbsWithDisabledParentCategory() name breadcrumbs { category_id + category_uid category_name } } @@ -691,6 +695,7 @@ public function testBreadCrumbsWithDisabledParentCategory() 'breadcrumbs' => [ [ 'category_id' => 3, + 'category_uid' => base64_encode('3'), 'category_name' => "Category 1", ] ] diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 7b14fe9159c57..8d1b48d8acac4 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -65,6 +65,25 @@ public function testFilterForNonExistingCategory() ); } + /** + * Verify that filters id and uid can't be used at the same time + */ + public function testUidAndIdUsageErrorOnProductFilteringCategory() + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('`category_id` and `category_uid` can\'t be used at the same time'); + $query = <<<QUERY +{ + products(filter: {category_id: {eq: "99999999"}, category_uid: {eq: "OTk5OTk5OTk="}}) { + filters { + name + } + } +} +QUERY; + $this->graphQlQuery($query); + } + /** * Verify that layered navigation filters and aggregations are correct for product query * @@ -607,10 +626,11 @@ public function testFilterByCategoryIdAndCustomAttribute() $getCategoryByName = Bootstrap::getObjectManager()->get(GetCategoryByName::class); $category = $getCategoryByName->execute('Category 1.2'); $optionValue = $this->getDefaultAttributeOptionValue('second_test_configurable'); + $categoryUid = base64_encode($category->getId()); $query = <<<QUERY { products(filter:{ - category_id : {eq:"{$category->getId()}"} + category_uid : {eq:"{$categoryUid}"} second_test_configurable: {eq: "{$optionValue}"} }, pageSize: 3 @@ -1349,7 +1369,6 @@ public function testFilterByMultipleFilterFieldsSortedByMultipleSortFields() */ public function testFilterProductsForExactMatchingName() { - $query = <<<QUERY { @@ -1502,17 +1521,20 @@ public function testFilteringForProductsFromMultipleCategories() * * @magentoApiDataFixture Magento/Catalog/_files/product_in_multiple_categories.php * @return void + * @dataProvider filterProductsBySingleCategoryIdDataProvider */ - public function testFilterProductsBySingleCategoryId() + public function testFilterProductsBySingleCategoryId(string $fieldName, string $queryCategoryId) { - $queryCategoryId = 333; + if (is_numeric($queryCategoryId)) { + $queryCategoryId = (int) $queryCategoryId; + } $query = <<<QUERY { products( filter: { - category_id:{eq:"{$queryCategoryId}"} + {$fieldName}:{eq:"{$queryCategoryId}"} } pageSize:2 @@ -1526,6 +1548,7 @@ public function testFilterProductsBySingleCategoryId() categories{ name id + uid path children_count product_count @@ -1545,7 +1568,9 @@ public function testFilterProductsBySingleCategoryId() /** @var CategoryRepositoryInterface $categoryRepository */ $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); - $links = $productLinks->getAssignedProducts($queryCategoryId); + $links = $productLinks->getAssignedProducts( + is_numeric($queryCategoryId) ? $queryCategoryId : base64_decode($queryCategoryId) + ); $links = array_reverse($links); foreach ($response['products']['items'] as $itemIndex => $itemData) { $this->assertNotEmpty($itemData); @@ -1574,6 +1599,7 @@ public function testFilterProductsBySingleCategoryId() [ 'name' => $category->getName(), 'id' => $category->getId(), + 'uid' => base64_encode($category->getId()), 'path' => $category->getPath(), 'children_count' => $category->getChildrenCount(), 'product_count' => $category->getProductCount(), @@ -2514,4 +2540,23 @@ private function assertProductItemsWithPriceCheck(array $filteredProducts, array ); } } + + /** + * Data provider for product single category filtering + * + * @return array[][] + */ + public function filterProductsBySingleCategoryIdDataProvider(): array + { + return [ + [ + 'fieldName' => 'category_id', + 'categoryId' => '333', + ], + [ + 'fieldName' => 'category_uid', + 'categoryId' => base64_encode('333'), + ], + ]; + } } From e8294f84c1fde1072fecf197eee71737be7faf29 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 16 Nov 2020 11:42:50 +0200 Subject: [PATCH 163/490] fix SVC --- app/code/Magento/Shipping/Model/Config.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Shipping/Model/Config.php b/app/code/Magento/Shipping/Model/Config.php index b71d983bd064c..565901ebe8ef0 100644 --- a/app/code/Magento/Shipping/Model/Config.php +++ b/app/code/Magento/Shipping/Model/Config.php @@ -63,10 +63,10 @@ public function __construct( /** * Retrieve active system carriers * - * @param mixed $store - * @return AbstractCarrierInterface[] + * @param mixed $store + * @return AbstractCarrierInterface[] */ - public function getActiveCarriers($store = null): array + public function getActiveCarriers($store = null) { $carriers = []; $config = $this->getCarriersConfig($store); @@ -89,10 +89,10 @@ public function getActiveCarriers($store = null): array /** * Retrieve all system carriers * - * @param mixed $store - * @return AbstractCarrierInterface[] + * @param mixed $store + * @return AbstractCarrierInterface[] */ - public function getAllCarriers($store = null): array + public function getAllCarriers($store = null) { $carriers = []; $config = $this->getCarriersConfig($store); From 5a5b6f7d4ada5ffbf55821499c547d182f8509c1 Mon Sep 17 00:00:00 2001 From: Pawel Siejba <pawel.siejba@vaimo.com> Date: Fri, 23 Oct 2020 16:30:49 +0200 Subject: [PATCH 164/490] Handle exceptions thrown in child processes forked by ProcessManager, instead of handling them in the parent process execution flow --- .../Magento/Indexer/Model/ProcessManager.php | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Indexer/Model/ProcessManager.php b/app/code/Magento/Indexer/Model/ProcessManager.php index 2f2c500e028cf..2b25c8c6a3d15 100644 --- a/app/code/Magento/Indexer/Model/ProcessManager.php +++ b/app/code/Magento/Indexer/Model/ProcessManager.php @@ -7,6 +7,9 @@ namespace Magento\Indexer\Model; +use Magento\Framework\App\ObjectManager; +use Psr\Log\LoggerInterface; + /** * Provide functionality for executing user functions in multi-thread mode. */ @@ -29,15 +32,22 @@ class ProcessManager /** @var int|null */ private $threadsCount; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param \Magento\Framework\App\ResourceConnection $resource * @param \Magento\Framework\Registry $registry * @param int|null $threadsCount + * @param LoggerInterface|null $logger */ public function __construct( \Magento\Framework\App\ResourceConnection $resource, \Magento\Framework\Registry $registry = null, - int $threadsCount = null + int $threadsCount = null, + LoggerInterface $logger = null ) { $this->resource = $resource; if (null === $registry) { @@ -47,6 +57,9 @@ public function __construct( } $this->registry = $registry; $this->threadsCount = (int)$threadsCount; + $this->logger = $logger ?? ObjectManager::getInstance()->get( + LoggerInterface::class + ); } /** @@ -135,11 +148,20 @@ private function isSetupMode(): bool */ private function startChildProcess(callable $userFunction) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $status = call_user_func($userFunction); - $status = is_int($status) ? $status : 0; - // phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage - exit($status); + try { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $status = call_user_func($userFunction); + $status = is_int($status) ? $status : 0; + } catch (\Throwable $e) { + $status = 1; + $this->logger->error( + __('Child process failed with message: %1', $e->getMessage()), + ['exception' => $e] + ); + } finally { + // phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage + exit($status); + } } /** From ce4fc73b634d94dc2e21ae5a4a2dcac2efde271d Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 16 Nov 2020 20:24:05 +0200 Subject: [PATCH 165/490] Update app/code/Magento/CompareListGraphQl/etc/module.xml Co-authored-by: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> --- app/code/Magento/CompareListGraphQl/etc/module.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CompareListGraphQl/etc/module.xml b/app/code/Magento/CompareListGraphQl/etc/module.xml index 050093c2032ec..b3c330fc38df2 100644 --- a/app/code/Magento/CompareListGraphQl/etc/module.xml +++ b/app/code/Magento/CompareListGraphQl/etc/module.xml @@ -12,6 +12,7 @@ <module name="Magento_Catalog"/> <module name="Magento_Customer"/> <module name="Magento_GraphQl"/> + <module name="Magento_CatalogGraphQl"/> </sequence> </module> </config> From b65b86c6497686fed0316a1af45ede3cdc567f57 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 16 Nov 2020 17:27:38 -0600 Subject: [PATCH 166/490] MC-38900: Mutation setGuestEmailOnCart doesn't update quote address --- app/code/Magento/Quote/Model/Quote/Address.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index aee86eb1f8935..5ecae97834eb0 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -139,7 +139,7 @@ class Address extends AbstractAddress implements const ADDRESS_TYPE_BILLING = 'billing'; const ADDRESS_TYPE_SHIPPING = 'shipping'; - + private const CACHED_ITEMS_ALL = 'cached_items_all'; /** @@ -1652,12 +1652,7 @@ public function setCustomerId($customerId) */ public function getEmail() { - $email = $this->getData(self::KEY_EMAIL); - if (!$email && $this->getQuote()) { - $email = $this->getQuote()->getCustomerEmail(); - $this->setEmail($email); - } - return $email; + return $this->getData(self::KEY_EMAIL); } /** From a54bb60f3460fda2b1fc156f38c85dfcf13b89f0 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Mon, 16 Nov 2020 19:53:44 -0600 Subject: [PATCH 167/490] MC-38340: GraphQL code changes for a consistent object uid - fix product search --- .../Model/Resolver/Products/Query/Search.php | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php index 3d4266a11a359..221a402cb2fff 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php @@ -102,8 +102,7 @@ public function getResult( ResolveInfo $info, ContextInterface $context ): SearchResult { - $queryFields = $this->fieldSelection->getProductsFieldSelection($info); - $searchCriteria = $this->buildSearchCriteria($queryFields, $args, $info->fieldName); + $searchCriteria = $this->buildSearchCriteria($args, $info); $realPageSize = $searchCriteria->getPageSize(); $realCurrentPage = $searchCriteria->getCurrentPage(); @@ -119,7 +118,7 @@ public function getResult( $searchResults = $this->productsProvider->getList( $searchCriteria, $itemsResults, - $queryFields, + $this->fieldSelection->getProductsFieldSelection($info), $context ); @@ -147,17 +146,17 @@ public function getResult( /** * Build search criteria from query input args * - * @param array $productFields * @param array $args - * @param string $fieldName + * @param ResolveInfo $info * @return SearchCriteriaInterface - * @throws GraphQlInputException */ - private function buildSearchCriteria(array $productFields, array $args, string $fieldName): SearchCriteriaInterface + private function buildSearchCriteria(array $args, ResolveInfo $info): SearchCriteriaInterface { - $fieldsKeys = array_flip($productFields); - $includeAggregations = isset($fieldsKeys['filters']) || isset($fieldsKeys['aggregations']); - $processedArgs = $this->argsSelection->process($fieldName, $args); - return $this->searchCriteriaBuilder->build($processedArgs, $includeAggregations); + $productFields = (array)$info->getFieldSelection(1); + $includeAggregations = isset($productFields['filters']) || isset($productFields['aggregations']); + $processedArgs = $this->argsSelection->process((string) $info->fieldName, $args); + $searchCriteria = $this->searchCriteriaBuilder->build($processedArgs, $includeAggregations); + + return $searchCriteria; } } From 320e509a0d093434271e764945576fbba7ed877c Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Mon, 16 Nov 2020 20:27:00 -0600 Subject: [PATCH 168/490] MC-38340: GraphQL code changes for a consistent object uid - restore di backslashes, it doens't work without it --- app/code/Magento/CatalogGraphQl/etc/di.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index 39c533b85e82b..8c6fac0fe621c 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -88,11 +88,11 @@ <plugin name="productAttributesDynamicFields" type="Magento\CatalogGraphQl\Plugin\Search\Request\ConfigReader" /> </type> - <preference type="Magento\CatalogGraphQl\Model\Resolver\Product\Price\Provider" for="Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface"/> + <preference type="\Magento\CatalogGraphQl\Model\Resolver\Product\Price\Provider" for="\Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface"/> <preference type="Magento\CatalogGraphQl\Model\Resolver\Products\Query\Search" for="Magento\CatalogGraphQl\Model\Resolver\Products\Query\ProductQueryInterface"/> - <type name="Magento\CatalogGraphQl\Model\Resolver\Product\BatchProductLinks"> + <type name="\Magento\CatalogGraphQl\Model\Resolver\Product\BatchProductLinks"> <arguments> <argument name="linkTypes" xsi:type="array"> <item name="related" xsi:type="string">related</item> From 3c9341e0f6716aad5585cea50e88df387b7054f9 Mon Sep 17 00:00:00 2001 From: Andrii Dimov <andimov@gmail.com> Date: Mon, 16 Nov 2020 23:50:51 -0600 Subject: [PATCH 169/490] MCP-51: Update performance measurement infrastructure to work with JMeter 5 --- setup/performance-toolkit/benchmark.jmx | 3242 +++++++++++------------ 1 file changed, 1567 insertions(+), 1675 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index fef19b05deafd..948135268b864 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -41,7 +41,7 @@ </elementProp> <elementProp name="admin_password" elementType="Argument"> <stringProp name="Argument.name">admin_password</stringProp> - <stringProp name="Argument.value">${__P(admin_password,123123q)}</stringProp> + <stringProp name="Argument.value">${__P(admin_password,)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> <elementProp name="admin_path" elementType="Argument"> @@ -436,7 +436,7 @@ </elementProp> <elementProp name="customer_password" elementType="Argument"> <stringProp name="Argument.name">customer_password</stringProp> - <stringProp name="Argument.value">${__P(customer_password,123123q)}</stringProp> + <stringProp name="Argument.value">${__P(customer_password,)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> <elementProp name="customers_page_size" elementType="Argument"> @@ -775,7 +775,7 @@ </value> </objProp> <stringProp name="filename"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/view_results_tree.jmx</stringProp></ResultCollector> + <stringProp name="TestPlan.comments">tool/fragments/ce/view_results_tree.jmx</stringProp></ResultCollector> <hashTree/> <ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="false"> @@ -810,7 +810,7 @@ </value> </objProp> <stringProp name="filename">/tmp/aggregate-jmeter-results.jtl</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/aggregate_report.jmx</stringProp></ResultCollector> + <stringProp name="TestPlan.comments">tool/fragments/ce/aggregate_report.jmx</stringProp></ResultCollector> <hashTree/> <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true"> @@ -826,7 +826,7 @@ <stringProp name="HTTPSampler.path"/> <stringProp name="HTTPSampler.implementation">Java</stringProp> <stringProp name="HTTPSampler.concurrentPool">4</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_request_default.jmx</stringProp></ConfigTestElement> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_request_default.jmx</stringProp></ConfigTestElement> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -848,7 +848,7 @@ <stringProp name="Header.value">gzip, deflate</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_header_manager.jmx</stringProp></HeaderManager> <hashTree/> <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true"> @@ -864,7 +864,7 @@ <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/setup.jmx</stringProp></SetupThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/setup.jmx</stringProp></SetupThreadGroup> <hashTree> <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"> @@ -888,7 +888,7 @@ </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: Initialize" enabled="true"> @@ -918,7 +918,7 @@ props.put("environment", environment);</stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/initialize.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/initialize.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: validate user defined variables" enabled="true"> @@ -942,7 +942,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/validate_user_defined_variables.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/validate_user_defined_variables.jmx</stringProp></BeanShellSampler> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Login admin" enabled="true"/> @@ -1046,7 +1046,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/login.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/login.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert logged-in" enabled="true"> @@ -1071,7 +1071,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract admin users" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_admin_users.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_admin_users.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Extract Admin Users" enabled="true"> @@ -1129,52 +1129,10 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract customers" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_customers.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_customers.jmx</stringProp> </TestFragmentController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Open Customer Grid" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> - <stringProp name="filename"/> - <stringProp name="parameters"/> - <boolProp name="resetInterpreter">true</boolProp> - <stringProp name="script">import org.apache.jmeter.protocol.http.control.CookieManager; -import org.apache.jmeter.protocol.http.control.Cookie; -CookieManager manager = sampler.getCookieManager(); -Cookie cookie = new Cookie("adminhtml",vars.get("COOKIE_adminhtml"),vars.get("host"),"/",false,0); -manager.add(cookie); </stringProp> - </BeanShellPreProcessor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Customer Grid" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-679437259">Customers</stringProp> - <stringProp name="495525733"><title>Customers / Customers / Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Search Customers" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Customers" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> <elementProp name="namespace" elementType="HTTPArgument"> @@ -1265,8 +1223,6 @@ manager.add(cookie); </stringProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> @@ -1275,113 +1231,45 @@ manager.add(cookie); </stringProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> - <stringProp name="JSON_PATH">$.totalRecords</stringProp> - <stringProp name="EXPECTED_VALUE">0</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">true</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer emails" enabled="true"> - <stringProp name="VAR">customer_emails</stringProp> - <stringProp name="JSONPATH">$.items[*].email</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer ids" enabled="true"> - <stringProp name="VAR">customer_ids</stringProp> - <stringProp name="JSONPATH">$.items[*].entity_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Make email list" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Parse variables" enabled="true"> + <stringProp name="scriptLanguage">groovy</stringProp> <stringProp name="parameters"/> <stringProp name="filename"/> - <stringProp name="script">import java.util.LinkedList; -LinkedList emailsList = new LinkedList(); -props.put("customer_emails_list", emailsList);</stringProp> - </BeanShellPostProcessor> - <hashTree/> - </hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Controller: customer emails loop (search result)" enabled="true"> - <stringProp name="ForeachController.inputVal">customer_emails</stringProp> - <stringProp name="ForeachController.returnVal">customer_email</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - </ForeachController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">email_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">false</boolProp> - </CounterConfig> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: Collect customer emails" enabled="true"> - <stringProp name="BeanShellSampler.query"> -try { + <stringProp name="cacheKey">true</stringProp> + <stringProp name="script">import groovy.json.JsonSlurper +import java.util.ArrayList; +import java.util.LinkedList; -props.get("customer_emails_list").add(vars.get("customer_email")); +emailsList = new LinkedList(); +idsList = new ArrayList(); -} catch (java.lang.Exception e) { - log.error("error…", e); - SampleResult.setStopThread(true); -} - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Controller: customer ids loop (search result)" enabled="true"> - <stringProp name="ForeachController.inputVal">customer_ids</stringProp> - <stringProp name="ForeachController.returnVal">customer_id</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - </ForeachController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">id_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">false</boolProp> - </CounterConfig> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: Collect customer ids" enabled="true"> - <stringProp name="BeanShellSampler.query">import java.util.ArrayList; -// If it is first iteration of cycle then recreate idsList -if (1 == Integer.parseInt(vars.get("id_counter"))) { - idsList = new ArrayList(); - props.put("customer_ids_list", idsList); -} else { - idsList = props.get("customer_ids_list"); +def jsonSlurper = new JsonSlurper(); +def jsonResponse = jsonSlurper.parseText(prev.getResponseDataAsString()); + +jsonResponse.items.each { item -> + emailsList.add(item.email); + idsList.add(item.entity_id.toString()); } -idsList.add(vars.get("customer_id"));</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> + +props.put("customer_emails_list", emailsList); +props.put("customer_ids_list", idsList); +// +log.info("Cust IDs: " + idsList); +log.info("Emails: " + emailsList); +</stringProp> + </JSR223PostProcessor> <hashTree/> </hashTree> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract region ids" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_region_ids.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_region_ids.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Extract Region ids" enabled="true"> @@ -1434,7 +1322,7 @@ regionResponse.each { region -> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Api Data Retrieval" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -1448,7 +1336,7 @@ regionResponse.each { region -> <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -1476,7 +1364,7 @@ regionResponse.each { region -> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -1506,7 +1394,7 @@ regionResponse.each { region -> <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="SetUp - Get CMS pages" enabled="true"/> @@ -1544,7 +1432,7 @@ regionResponse.each { region -> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/get_cms_pages.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/get_cms_pages.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert results are present" enabled="true"> @@ -1577,139 +1465,97 @@ props.put("cms_pages", cmsPages); </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract configurable products" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_configurable_products.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_configurable_products.jmx</stringProp> </TestFragmentController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get configurable products" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">type_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> - </elementProp> - <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">configurable</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> - </elementProp> - <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_products_count}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/products</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_products_url_keys</stringProp> - <stringProp name="RegexExtractor.regex">url_key\",\"value\":\"(.*?)\"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_ids</stringProp> - <stringProp name="RegexExtractor.regex">\"id\":(\d+),\"sku\"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product titles" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_names</stringProp> - <stringProp name="RegexExtractor.regex">name\":\"(.*?)\"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product skus" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_skus</stringProp> - <stringProp name="RegexExtractor.regex">sku\":\"(.*?)\"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Controller: Prepare configurable products" enabled="true"> - <stringProp name="ForeachController.inputVal">configurable_product_ids</stringProp> - <stringProp name="ForeachController.returnVal">configurable_product_id</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - </ForeachController> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get configurable products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">type_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_products_count}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + </HTTPSamplerProxy> <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">configurable_products_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">false</boolProp> - </CounterConfig> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: Collect configurable product" enabled="true"> - <stringProp name="BeanShellSampler.query">import java.util.ArrayList; -import java.util.HashMap; + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Parse variables" enabled="true"> + <stringProp name="scriptLanguage">groovy</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="script">import groovy.json.JsonSlurper +import java.util.ArrayList; +import java.util.LinkedList; import org.apache.commons.codec.binary.Base64; -ArrayList productList; -// If it is first iteration of cycle then recreate productList -if (1 == Integer.parseInt(vars.get("configurable_products_counter"))) { - productList = new ArrayList(); - props.put("configurable_products_list", productList); -} else { - productList = props.get("configurable_products_list"); +def jsonSlurper = new JsonSlurper(); +def jsonResponse = jsonSlurper.parseText(prev.getResponseDataAsString()); + + +productList = new ArrayList(); +jsonResponse.items.each { item -> + + Map productMap = new HashMap(); + productMap.put("id", item.id.toString()); + productMap.put("title", item.name); + productMap.put("sku", item.sku); + url_key = item.custom_attributes.find({ it.attribute_code == "url_key" }).value + productMap.put("url_key", url_key); + + productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + url_key + vars.get("url_suffix"); + encodedUrl = new String(Base64.encodeBase64(productUrl.getBytes())); + productMap.put("uenc", encodedUrl); + + // Collect products map in products list + productList.add(productMap); } -String productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + vars.get("configurable_products_url_keys_" + vars.get("configurable_products_counter"))+ vars.get("url_suffix"); -encodedUrl = Base64.encodeBase64(productUrl.getBytes()); -// Create product map -Map productMap = new HashMap(); -productMap.put("id", vars.get("configurable_product_id")); -productMap.put("title", vars.get("configurable_product_names_" + vars.get("configurable_products_counter"))); -productMap.put("sku", vars.get("configurable_product_skus_" + vars.get("configurable_products_counter"))); -productMap.put("url_key", vars.get("configurable_products_url_keys_" + vars.get("configurable_products_counter"))); -productMap.put("uenc", new String(encodedUrl)); +props.put("configurable_products_list", productList); -// Collect products map in products list -productList.add(productMap);</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> +log.info("Products: " + productList); + + + + +</stringProp> + </JSR223PostProcessor> <hashTree/> </hashTree> + </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract configurable products for edit" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_configurable_products_for_edit.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_configurable_products_for_edit.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get configurable products for edit" enabled="true"> @@ -1847,7 +1693,7 @@ editProductList.add(editProductMap);</stringProp> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract simple products" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_simple_products.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_simple_products.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get simple products" enabled="true"> @@ -1992,7 +1838,7 @@ productList.add(productMap);</stringProp> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract simple products for edit" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_simple_products_for_edit.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_simple_products_for_edit.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get simple products for edit" enabled="true"> @@ -2144,7 +1990,7 @@ editProductList.add(editProductMap);</stringProp> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract categories (First Level)" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_categories.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_categories.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Categories Names and skus" enabled="true"> @@ -2244,7 +2090,7 @@ props.put("category_names_list",categoryNames);</stringProp> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract categories id of last level" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_categories_id_of_last_level.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_categories_id_of_last_level.jmx</stringProp> </TestFragmentController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - BeanShell Sampler: Clear Admin Category Management properties" enabled="true"> @@ -2352,7 +2198,7 @@ adminCategoryIdsList.add(vars.get("category_id"));</stringProp> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Extract coupon codes" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/extract_coupon_codes.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/extract_coupon_codes.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get coupon codes" enabled="true"> @@ -2441,7 +2287,7 @@ if (props.get("cms_pages") == null) { <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/validate_properties.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/validate_properties.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - WarmUp Add To Cart" enabled="true"> @@ -2491,7 +2337,7 @@ if (props.get("cms_pages") == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/warmup_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/warmup_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree/> </hashTree> @@ -2508,7 +2354,7 @@ if (props.get("cms_pages") == null) { <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> @@ -2531,7 +2377,7 @@ function doCache(){ } } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Catalog Browsing By Customer" enabled="true"> @@ -2539,7 +2385,7 @@ function doCache(){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${browseCatalogByCustomerPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -2555,7 +2401,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -2587,11 +2433,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -2623,16 +2469,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -2670,7 +2516,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -2730,7 +2576,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -2823,7 +2669,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -2854,7 +2700,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -2891,7 +2737,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -2921,7 +2767,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -2942,7 +2788,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -2959,7 +2805,7 @@ vars.put("product_sku", product.get("sku")); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -2989,7 +2835,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> @@ -3010,7 +2856,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3042,7 +2888,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3062,7 +2908,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -3073,7 +2919,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${browseCatalogByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -3089,7 +2935,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -3121,11 +2967,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -3157,7 +3003,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -3178,7 +3024,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3209,7 +3055,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3246,7 +3092,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -3276,7 +3122,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -3297,7 +3143,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3314,7 +3160,7 @@ vars.put("product_sku", product.get("sku")); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -3344,7 +3190,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> @@ -3365,7 +3211,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3386,7 +3232,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${siteSearchPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -3402,7 +3248,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -3421,7 +3267,7 @@ if (testLabel <boolProp name="recycle">true</boolProp> <boolProp name="stopThread">false</boolProp> <stringProp name="shareMode">shareMode.thread</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> @@ -3445,7 +3291,7 @@ function doCache(){ } } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> @@ -3453,7 +3299,7 @@ function doCache(){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -3469,7 +3315,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -3501,7 +3347,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -3522,7 +3368,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3561,7 +3407,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3596,7 +3442,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -3624,7 +3470,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> @@ -3652,13 +3498,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -3672,7 +3518,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -3703,7 +3549,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3724,7 +3570,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -3740,7 +3586,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -3772,7 +3618,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -3793,7 +3639,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3832,7 +3678,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -3894,7 +3740,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -3922,7 +3768,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> @@ -3940,7 +3786,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 1 present in layered navigation" enabled="true"> <stringProp name="IfController.condition">${attribute_1_options_count} > 0</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Url 2" enabled="true"> <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_1_filter_url"));</stringProp> @@ -4012,7 +3858,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 2 present in layered navigation" enabled="true"> <stringProp name="IfController.condition">${attribute_2_options_count} > 0</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Ul 3" enabled="true"> <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_2_filter_url"));</stringProp> @@ -4076,13 +3922,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -4096,7 +3942,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -4127,7 +3973,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4148,7 +3994,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -4164,7 +4010,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -4196,7 +4042,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -4217,7 +4063,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4249,7 +4095,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4360,7 +4206,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4395,13 +4241,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -4415,7 +4261,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -4446,7 +4292,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4469,7 +4315,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${addToCartByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -4485,7 +4331,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -4517,11 +4363,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -4539,7 +4385,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -4564,7 +4410,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -4585,7 +4431,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4616,7 +4462,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4653,7 +4499,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -4683,11 +4529,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -4718,7 +4564,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4778,7 +4624,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -4787,7 +4633,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -4831,7 +4677,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4868,7 +4714,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -4876,7 +4722,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -4906,11 +4752,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -4941,7 +4787,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -4957,7 +4803,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -5114,7 +4960,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -5143,7 +4989,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -5153,7 +4999,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -5197,7 +5043,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5234,7 +5080,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -5246,7 +5092,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${addToWishlistPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -5262,7 +5108,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -5294,11 +5140,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -5317,11 +5163,11 @@ vars.putObject("randomIntGenerator", random); <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -5359,7 +5205,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5419,7 +5265,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5497,7 +5343,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Produts to Wishlist" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">5</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -5527,7 +5373,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -5548,7 +5394,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5602,7 +5448,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5664,7 +5510,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5686,7 +5532,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="ForeachController.inputVal">wishListItems</stringProp> <stringProp name="ForeachController.returnVal">wishListItem</stringProp> <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -5754,7 +5600,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5774,7 +5620,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -5785,7 +5631,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${compareProductsPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -5801,7 +5647,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -5833,11 +5679,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -5855,7 +5701,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -5880,7 +5726,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> @@ -5901,7 +5747,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -5937,7 +5783,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Compare" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -5967,11 +5813,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6002,7 +5848,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6055,7 +5901,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> @@ -6098,7 +5944,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6115,7 +5961,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Compare" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -6145,11 +5991,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6180,7 +6026,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6233,7 +6079,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> @@ -6276,7 +6122,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6308,14 +6154,14 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Product Compare - Pause" enabled="true"> <intProp name="ActionProcessor.action">1</intProp> <intProp name="ActionProcessor.target">0</intProp> <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${productCompareDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products Clear" enabled="true"> @@ -6344,7 +6190,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> <hashTree/> </hashTree> @@ -6354,7 +6200,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${checkoutByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -6370,7 +6216,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -6402,11 +6248,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -6424,7 +6270,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -6449,7 +6295,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -6470,7 +6316,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6501,7 +6347,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6538,7 +6384,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -6568,11 +6414,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6603,7 +6449,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6663,7 +6509,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -6672,7 +6518,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -6716,7 +6562,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6753,7 +6599,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -6761,7 +6607,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -6791,11 +6637,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6826,7 +6672,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -6842,7 +6688,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -6999,7 +6845,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -7028,7 +6874,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -7038,7 +6884,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -7082,7 +6928,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7119,13 +6965,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -7137,7 +6983,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> @@ -7158,7 +7004,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7225,7 +7071,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -7284,7 +7130,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -7343,7 +7189,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -7402,7 +7248,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -7473,7 +7319,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7495,7 +7341,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${checkoutByCustomerPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -7511,7 +7357,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -7543,11 +7389,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -7565,7 +7411,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -7590,16 +7436,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -7637,7 +7483,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7668,7 +7514,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7728,7 +7574,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7821,7 +7667,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7858,7 +7704,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -7888,11 +7734,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -7923,7 +7769,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -7983,7 +7829,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -7992,7 +7838,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -8036,7 +7882,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8073,7 +7919,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -8081,7 +7927,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -8111,11 +7957,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -8146,7 +7992,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8162,7 +8008,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -8319,7 +8165,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -8348,7 +8194,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -8358,7 +8204,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -8402,7 +8248,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8439,13 +8285,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -8457,7 +8303,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> @@ -8478,7 +8324,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8585,7 +8431,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -8644,7 +8490,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -8703,7 +8549,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -8755,7 +8601,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8788,7 +8634,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -8810,7 +8656,7 @@ if(curSampler.getName().contains("Checkout success")) { manager.clear(); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> <hashTree/> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> @@ -8821,7 +8667,7 @@ if(curSampler.getName().contains("Checkout success")) { customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -8832,7 +8678,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${reviewByCustomerPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -8848,7 +8694,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -8880,11 +8726,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -8903,11 +8749,11 @@ vars.putObject("randomIntGenerator", random); <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -8945,7 +8791,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9005,7 +8851,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9083,7 +8929,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Review Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -9113,7 +8959,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -9134,7 +8980,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9208,7 +9054,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_review/product_review.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_review/product_review.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9261,14 +9107,14 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_review/load_review.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_review/load_review.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Product Rating and Review - Pause" enabled="true"> <intProp name="ActionProcessor.action">1</intProp> <intProp name="ActionProcessor.target">0</intProp> <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${reviewDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_review/product_review_pause.jmx</stringProp></TestAction> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_review/product_review_pause.jmx</stringProp></TestAction> <hashTree/> </hashTree> @@ -9290,7 +9136,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9310,7 +9156,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -9321,7 +9167,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${addToCartByCustomerPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -9337,7 +9183,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -9369,11 +9215,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -9391,7 +9237,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -9416,16 +9262,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -9463,7 +9309,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9523,7 +9369,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9616,7 +9462,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9647,7 +9493,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9684,7 +9530,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -9714,11 +9560,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -9749,7 +9595,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9809,7 +9655,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -9818,7 +9664,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -9862,7 +9708,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9899,7 +9745,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -9907,7 +9753,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -9937,11 +9783,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -9972,7 +9818,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -9988,7 +9834,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -10145,7 +9991,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -10174,7 +10020,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -10184,7 +10030,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -10228,7 +10074,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10265,13 +10111,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Make Cart Empty" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Cart" enabled="true"> @@ -10292,7 +10138,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/open_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/open_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Cart Opened" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10317,7 +10163,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Remove Items From Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${cart_items_qty_inputs_matchNr}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -10339,7 +10185,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove item" enabled="true"> @@ -10382,7 +10228,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart.jmx</stringProp></HTTPSamplerProxy> </hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Cart is Empty" enabled="true"> @@ -10425,7 +10271,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/check_cart_is_empty.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/check_cart_is_empty.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10457,7 +10303,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10477,7 +10323,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -10488,7 +10334,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${accountManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -10504,7 +10350,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -10536,16 +10382,16 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -10583,7 +10429,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10614,7 +10460,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10674,7 +10520,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10767,7 +10613,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10790,7 +10636,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_orders.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_orders.jmx</stringProp> <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -10930,7 +10776,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -10962,7 +10808,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Downloadables Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -10985,7 +10831,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11016,7 +10862,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> <hashTree/> </hashTree> @@ -11056,7 +10902,7 @@ vars.put("customer_email", customerUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> </RegexExtractor> <hashTree/> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Verify that there are items in the wishlist" enabled="true"> @@ -11071,7 +10917,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Wish List Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> <stringProp name="IfController.condition">"${buttonTitle}" === "FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -11094,7 +10940,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11148,7 +10994,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11180,7 +11026,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11200,7 +11046,7 @@ vars.put("customer_email", customerUser); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -11221,14 +11067,14 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin CMS Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminCMSManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -11244,7 +11090,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -11278,7 +11124,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -11305,21 +11151,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -11334,7 +11181,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -11368,7 +11215,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11450,7 +11297,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -11460,17 +11307,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin CMS Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -11683,7 +11530,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -11697,7 +11544,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -11708,7 +11555,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${browseProductGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -11724,7 +11571,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -11758,7 +11605,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -11785,21 +11632,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -11814,7 +11662,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -11848,7 +11696,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -11930,7 +11778,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -11940,7 +11788,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -11963,11 +11811,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -12053,7 +11901,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -12170,7 +12018,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -12212,7 +12060,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -12298,7 +12146,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -12319,11 +12167,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -12460,7 +12308,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -12474,7 +12322,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -12485,7 +12333,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${browseOrderGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -12501,7 +12349,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -12535,7 +12383,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -12562,21 +12410,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -12591,7 +12440,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -12625,7 +12474,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -12707,7 +12556,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -12717,7 +12566,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -12740,11 +12589,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -12830,7 +12679,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -12947,7 +12796,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -12989,7 +12838,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -13075,7 +12924,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -13096,11 +12945,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -13237,7 +13086,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -13251,7 +13100,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -13262,7 +13111,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminProductCreationPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -13278,7 +13127,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -13312,7 +13161,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -13339,21 +13188,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -13368,7 +13218,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -13402,7 +13252,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -13484,7 +13334,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -13494,17 +13344,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/once_only_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> </OnceOnlyController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); @@ -13520,7 +13370,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -13534,7 +13384,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -13562,7 +13412,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -13592,7 +13442,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> @@ -13642,7 +13492,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> <stringProp name="VAR">product_attributes</stringProp> @@ -13710,7 +13560,7 @@ vars.putObject("product_attributes", attributes); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> @@ -13737,17 +13587,20 @@ vars.put("attribute_set_filter", new String(encodedBytes)); </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); + if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); +number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); + simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); vars.put("simple_product_1_name", simpleList.get("title")); @@ -13780,11 +13633,11 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -15692,7 +15545,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Create Configurable Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -15713,7 +15566,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -15744,7 +15597,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -16274,7 +16127,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -16365,7 +16218,7 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> </hashTree> @@ -16886,7 +16739,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -16995,13 +16848,13 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> </hashTree> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Downloadable Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -18626,7 +18479,7 @@ function addConfigurableMatrix(attributes) { </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Simple Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -20159,7 +20012,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -20173,7 +20026,7 @@ function addConfigurableMatrix(attributes) { adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -20184,7 +20037,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminProductEditingPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -20200,7 +20053,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -20234,7 +20087,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -20261,21 +20114,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -20290,7 +20144,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -20324,7 +20178,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -20406,7 +20260,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -20416,23 +20270,24 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Edit Product" enabled="true"/> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> <stringProp name="BeanShellSampler.query">import java.util.ArrayList; import java.util.HashMap; import java.util.Random; + int relatedIndex; try { Random random = new Random(); if (${seedForRandom} > 0) { @@ -20554,6 +20409,7 @@ vars.put("admin_user", adminUser); import java.util.Random; Random randomGenerator = new Random(); + int newCategoryId; if (${seedForRandom} > 0) { randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); } @@ -20564,7 +20420,7 @@ vars.put("admin_user", adminUser); if (categoryList.size() > 1) { do { int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = categoryList.get(index); + newCategoryId = categoryList.get(index).parseInt(); } while (categoryId == newCategoryId); vars.put("category_additional", newCategoryId.toString()); @@ -22654,7 +22510,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -22668,7 +22524,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -22689,14 +22545,14 @@ vars.put("admin_user", adminUser); <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Returns Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminReturnsManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -22712,7 +22568,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -22746,7 +22602,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -22773,21 +22629,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -22802,7 +22659,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -22836,7 +22693,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -22918,7 +22775,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -22928,13 +22785,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> @@ -22955,7 +22812,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23066,7 +22923,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23183,7 +23040,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23217,7 +23074,7 @@ vars.put("admin_user", adminUser); </hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.ArrayList; import java.util.HashMap; @@ -23285,7 +23142,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23311,7 +23168,7 @@ vars.put("admin_user", adminUser); <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -23331,7 +23188,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23402,7 +23259,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23433,7 +23290,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23522,7 +23379,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23539,7 +23396,7 @@ vars.put("admin_user", adminUser); <intProp name="ActionProcessor.action">1</intProp> <intProp name="ActionProcessor.target">0</intProp> <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> <hashTree/> </hashTree> </hashTree> @@ -23562,7 +23419,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -23576,7 +23433,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -23587,7 +23444,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${browseCustomerGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -23603,7 +23460,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -23637,7 +23494,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -23664,21 +23521,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -23693,7 +23551,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -23727,7 +23585,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -23809,7 +23667,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -23819,7 +23677,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -23842,11 +23700,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -23932,7 +23790,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -24049,7 +23907,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -24091,7 +23949,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -24177,7 +24035,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -24198,11 +24056,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -24339,7 +24197,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -24353,7 +24211,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -24364,7 +24222,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminCreateOrderPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -24380,7 +24238,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -24414,7 +24272,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -24441,21 +24299,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -24470,7 +24329,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -24504,7 +24363,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -24586,7 +24445,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -24596,13 +24455,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -24614,25 +24473,38 @@ vars.put("admin_user", adminUser); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); + +int number1 = 1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } + +number = random.nextInt(props.get("configurable_products_list").size()); +configurableList = props.get("configurable_products_list").get(number); +vars.put("configurable_product_1_url_key", configurableList.get("url_key")); +vars.put("configurable_product_1_name", configurableList.get("title")); +vars.put("configurable_product_1_id", configurableList.get("id")); +vars.put("configurable_product_1_sku", configurableList.get("sku")); +vars.put("configurable_attribute_id", configurableList.get("attribute_id")); +vars.put("configurable_option_id", configurableList.get("attribute_option_id")); + number = random.nextInt(props.get("simple_products_list").size()); simpleList = props.get("simple_products_list").get(number); vars.put("simple_product_1_url_key", simpleList.get("url_key")); vars.put("simple_product_1_name", simpleList.get("title")); vars.put("simple_product_1_id", simpleList.get("id")); +number1 = random.nextInt(props.get("configurable_products_list").size()); do { number1 = random.nextInt(props.get("simple_products_list").size()); } while(number == number1); @@ -24641,15 +24513,6 @@ vars.put("simple_product_2_url_key", simpleList.get("url_key")); vars.put("simple_product_2_name", simpleList.get("title")); vars.put("simple_product_2_id", simpleList.get("id")); -number = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_sku", configurableList.get("sku")); -vars.put("configurable_attribute_id", configurableList.get("attribute_id")); -vars.put("configurable_option_id", configurableList.get("attribute_option_id")); - customers_index = 0; if (!props.containsKey("customer_ids_index")) { @@ -25657,7 +25520,7 @@ catch (java.lang.Exception e) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -25671,7 +25534,7 @@ catch (java.lang.Exception e) { adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -25692,14 +25555,14 @@ catch (java.lang.Exception e) { <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${apiBasePercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -25715,7 +25578,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -25736,7 +25599,7 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -25764,7 +25627,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -25794,7 +25657,7 @@ if (testLabel <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Create Customer" enabled="true"> @@ -25802,7 +25665,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -25818,7 +25681,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -25861,7 +25724,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_customer.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_customer.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer id" enabled="true"> <stringProp name="VAR">customer_id</stringProp> @@ -25902,7 +25765,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/check_customer.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_customer.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$.id</stringProp> @@ -25921,7 +25784,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -25937,7 +25800,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -25965,7 +25828,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/get_categories.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_categories.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -26017,7 +25880,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/get_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -26067,7 +25930,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/get_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_products.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -26089,7 +25952,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -26105,7 +25968,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -26169,7 +26032,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/search_for_product_frontend.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/search_for_product_frontend.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert results are present" enabled="true"> <stringProp name="JSON_PATH">$.total_count</stringProp> @@ -26207,7 +26070,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -26223,7 +26086,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -26242,11 +26105,11 @@ if (testLabel vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -26280,7 +26143,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create quote" enabled="true"> @@ -26301,7 +26164,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_quote.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_quote.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> <stringProp name="VAR">quote_id</stringProp> @@ -26356,7 +26219,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/add_product_to_quote_hardwired_sku.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_product_to_quote_hardwired_sku.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> @@ -26387,7 +26250,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/check_product_in_quote_hardwired_sku.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_product_in_quote_hardwired_sku.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$[0].sku</stringProp> @@ -26426,7 +26289,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_guest_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_guest_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">cart_id</stringProp> @@ -26481,7 +26344,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/add_product_to_guest_cart_hardwired_sku.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_product_to_guest_cart_hardwired_sku.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$.quote_id</stringProp> @@ -26523,7 +26386,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/add_gift_message_to_guest_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_gift_message_to_guest_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$</stringProp> @@ -26560,7 +26423,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -26619,7 +26482,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -26678,7 +26541,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -26738,7 +26601,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -26754,7 +26617,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -26795,7 +26658,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_product_no_custom_attributes.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_product_no_custom_attributes.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> <stringProp name="VAR">simple_product_id</stringProp> @@ -26887,7 +26750,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/update_product_stock_info.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/update_product_stock_info.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$</stringProp> @@ -26924,7 +26787,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/check_product.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_product.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> <stringProp name="JSON_PATH">$.sku</stringProp> @@ -27027,7 +26890,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> <stringProp name="VAR">simple_product_id</stringProp> @@ -27113,7 +26976,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/check_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> <stringProp name="JSON_PATH">$.sku</stringProp> @@ -27168,14 +27031,14 @@ if (testLabel <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Import Products" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${importProductsPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -27191,7 +27054,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -27225,7 +27088,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -27252,21 +27115,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -27281,7 +27145,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -27315,7 +27179,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -27397,7 +27261,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -27407,13 +27271,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> @@ -27425,7 +27289,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/import_products/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/import_products/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> @@ -27446,7 +27310,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -27538,7 +27402,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -27634,7 +27498,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -27666,7 +27530,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -27680,7 +27544,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -27691,7 +27555,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${importCustomersPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -27707,7 +27571,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -27741,7 +27605,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -27768,21 +27632,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -27797,7 +27662,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -27831,7 +27696,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -27913,7 +27778,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -27923,7 +27788,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -27937,11 +27802,11 @@ vars.put("adminImportFilePath", filepath); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/import_customers/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/import_customers/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> @@ -27962,7 +27827,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28054,7 +27919,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28150,7 +28015,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28182,7 +28047,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -28196,7 +28061,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -28207,7 +28072,7 @@ vars.put("adminImportFilePath", filepath); </stringProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${apiSinglePercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -28223,7 +28088,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -28244,7 +28109,7 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -28272,7 +28137,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -28302,7 +28167,7 @@ if (testLabel <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Process Orders" enabled="true"> @@ -28310,7 +28175,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -28326,7 +28191,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -28339,14 +28204,12 @@ if (testLabel <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> <stringProp name="BeanShellSampler.query">// Each thread gets an equal number of orders, based on how many orders are available. + int ordersPerThread = 1; int apiProcessOrders = Integer.parseInt("${apiProcessOrders}"); if (apiProcessOrders > 0) { - ordersPerThread = apiProcessOrders; - } else { - ordersPerThread = 1; + ordersPerThread = apiProcessOrders; } - threadNum = ${__threadNum}; vars.put("ordersPerThread", String.valueOf(ordersPerThread)); vars.put("threadNum", String.valueOf(threadNum)); @@ -28355,7 +28218,7 @@ if (testLabel <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/process_orders/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Orders" enabled="true"> @@ -28405,7 +28268,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/process_orders/get_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/get_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract entity ids" enabled="true"> <stringProp name="VAR">entity_ids</stringProp> @@ -28421,7 +28284,7 @@ if (testLabel <stringProp name="ForeachController.inputVal">entity_ids</stringProp> <stringProp name="ForeachController.returnVal">order_id</stringProp> <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/process_orders/for_each_order.jmx</stringProp></ForeachController> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/for_each_order.jmx</stringProp></ForeachController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Invoice" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -28441,7 +28304,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/process_orders/create_invoice.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_invoice.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28472,7 +28335,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/process_orders/create_shipment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_shipment.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28493,7 +28356,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">100</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -28509,7 +28372,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -28550,7 +28413,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_attribute_set.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_set.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_set_id" enabled="true"> <stringProp name="VAR">attribute_set_id</stringProp> @@ -28603,7 +28466,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_attribute_group.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_group.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_group_id" enabled="true"> <stringProp name="VAR">attribute_group_id</stringProp> @@ -28664,7 +28527,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_attribute.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_id" enabled="true"> <stringProp name="VAR">attribute_id</stringProp> @@ -28736,7 +28599,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/add_attribute_to_attribute_set.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_attribute_to_attribute_set.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert response is not null" enabled="true"> <stringProp name="JSON_PATH">$</stringProp> @@ -28757,7 +28620,7 @@ if (testLabel <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminCategoryManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -28773,7 +28636,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -28807,7 +28670,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -28834,21 +28697,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -28863,7 +28727,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -28897,7 +28761,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -28979,7 +28843,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -28989,17 +28853,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> </TestFragmentController> <hashTree> <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> @@ -29776,7 +29640,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -29790,7 +29654,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -29801,7 +29665,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminPromotionRulesPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -29817,7 +29681,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -29851,7 +29715,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -29878,21 +29742,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -29907,7 +29772,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -29941,7 +29806,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -30023,7 +29888,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -30033,17 +29898,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -30460,7 +30325,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -30474,7 +30339,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -30485,7 +30350,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminCustomerManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -30501,7 +30366,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -30535,7 +30400,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -30562,21 +30427,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -30591,7 +30457,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -30625,7 +30491,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -30707,7 +30573,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -30717,17 +30583,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -32609,7 +32475,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -32623,7 +32489,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -32634,7 +32500,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${adminEditOrderPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -32650,7 +32516,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -32684,7 +32550,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -32711,21 +32577,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -32740,7 +32607,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -32774,7 +32641,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -32856,7 +32723,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -32866,13 +32733,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> @@ -32893,7 +32760,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33004,7 +32871,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33121,7 +32988,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33155,7 +33022,7 @@ vars.put("admin_user", adminUser); </hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.ArrayList; import java.util.HashMap; @@ -33223,7 +33090,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33249,7 +33116,7 @@ vars.put("admin_user", adminUser); <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -33293,7 +33160,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33324,7 +33191,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33395,7 +33262,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33426,7 +33293,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33487,7 +33354,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33520,7 +33387,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -33534,7 +33401,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -33545,7 +33412,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${catalogGraphQLPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -33561,7 +33428,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -33572,7 +33439,7 @@ if (testLabel <hashTree/> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Admin Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/once_only_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> </OnceOnlyController> <hashTree> <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> @@ -33599,7 +33466,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -33626,21 +33493,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -33655,7 +33523,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -33689,7 +33557,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -33771,7 +33639,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -33781,17 +33649,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Indexer Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Indexers Management Catalog Set On Save" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Index Page" enabled="true"> @@ -33891,7 +33759,7 @@ vars.put("admin_user", adminUser); </hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); @@ -33907,7 +33775,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -33921,7 +33789,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -33949,7 +33817,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -33979,7 +33847,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> @@ -34029,7 +33897,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> <stringProp name="VAR">product_attributes</stringProp> @@ -34097,7 +33965,7 @@ vars.putObject("product_attributes", attributes); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> @@ -34126,10 +33994,13 @@ vars.put("attribute_set_filter", new String(encodedBytes)); <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); + if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); +number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); + simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); vars.put("simple_product_1_name", simpleList.get("title")); @@ -34162,11 +34033,11 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -36076,7 +35947,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Test Fragment" enabled="true"/> <hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Create Cms Page with Page Builder Product List" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> @@ -36273,7 +36144,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -36287,12 +36158,12 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Product Fixtures Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -36306,7 +36177,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -36334,7 +36205,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -36364,7 +36235,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create product with extensible data objects" enabled="true"> @@ -36434,7 +36305,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> <stringProp name="VAR">simple_product_id</stringProp> @@ -36496,7 +36367,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create configurable product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx</stringProp> </OnceOnlyController> <hashTree> <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> @@ -37275,7 +37146,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create bundle product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx</stringProp> </OnceOnlyController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create bundle product with extensible data objects" enabled="true"> @@ -37717,7 +37588,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create downloadable product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx</stringProp> </OnceOnlyController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create downloadable product with extensible data objects" enabled="true"> @@ -38232,7 +38103,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> @@ -38295,7 +38166,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create grouped product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx</stringProp> </OnceOnlyController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create grouped product with extensible data objects" enabled="true"> @@ -38505,7 +38376,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Graphql Query Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -38519,7 +38390,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -38547,7 +38418,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -38577,7 +38448,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query multiple products" enabled="true"> @@ -38605,7 +38476,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38662,7 +38533,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38738,7 +38609,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38807,7 +38678,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38875,7 +38746,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38935,7 +38806,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -38995,7 +38866,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39055,7 +38926,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39112,7 +38983,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39181,7 +39052,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39268,7 +39139,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39335,7 +39206,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39414,7 +39285,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer id" enabled="true"> @@ -39455,7 +39326,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/check_customer.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_customer.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> @@ -39505,7 +39376,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/create_customer.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_customer.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer token" enabled="true"> @@ -39542,7 +39413,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> @@ -39593,7 +39464,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_root_category.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39650,7 +39521,7 @@ if (name == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_root_category_list.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category_list.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -39710,7 +39581,7 @@ if (name == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> @@ -39741,14 +39612,14 @@ if (name == null) { <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get List of Products by category_id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetListOfProductsByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -39764,7 +39635,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -39785,11 +39656,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -39821,7 +39692,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> @@ -39849,7 +39720,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -39870,7 +39741,7 @@ vars.putObject("category", categories[number]); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByProductUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -39886,7 +39757,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -39907,11 +39778,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -39945,7 +39816,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by product_url_key" enabled="true"> @@ -39973,7 +39844,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -39994,7 +39865,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByNamePercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40010,7 +39881,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40031,11 +39902,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40069,7 +39940,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> @@ -40097,7 +39968,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -40118,7 +39989,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40134,7 +40005,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40155,11 +40026,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40193,7 +40064,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by product_url_key" enabled="true"> @@ -40221,7 +40092,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -40242,7 +40113,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByNamePercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40258,7 +40129,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40279,11 +40150,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40317,7 +40188,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -40345,7 +40216,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -40366,7 +40237,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetProductSearchByTextAndCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40382,7 +40253,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40403,11 +40274,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40439,7 +40310,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Product Search by text and category_id" enabled="true"> @@ -40467,7 +40338,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -40509,7 +40380,7 @@ if (totalCount == null) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40525,7 +40396,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40546,11 +40417,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40582,7 +40453,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_id" enabled="true"> @@ -40612,7 +40483,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_category_list_by_category_id.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> @@ -40657,7 +40528,7 @@ function assertCategoryChildren(category, response) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40673,7 +40544,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40694,11 +40565,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40730,7 +40601,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_url_key" enabled="true"> @@ -40758,7 +40629,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> @@ -40804,7 +40675,7 @@ function assertCategoryChildren(category, response) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40820,7 +40691,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40841,11 +40712,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -40892,7 +40763,7 @@ vars.put("category_id_2", categories[numbers[1]].id); vars.put("category_id_3", categories[numbers[2]].id); vars.put("category_id_4", categories[numbers[3]].id); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> </JSR223Sampler> <hashTree/> @@ -40921,7 +40792,7 @@ vars.put("category_id_4", categories[numbers[3]].id); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> @@ -40952,7 +40823,7 @@ if(response.data.categoryList.length !== 4){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -40968,7 +40839,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -40989,11 +40860,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41040,7 +40911,7 @@ vars.put("category_id_2", categories[numbers[1]].id); vars.put("category_id_3", categories[numbers[2]].id); vars.put("category_id_4", categories[numbers[3]].id); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> </JSR223Sampler> <hashTree/> @@ -41069,7 +40940,7 @@ vars.put("category_id_4", categories[numbers[3]].id); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> @@ -41100,7 +40971,7 @@ if(response.data.categories.items.length !== 4){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41116,7 +40987,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41137,7 +41008,7 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[categories query] Get many categories by name" enabled="true"> @@ -41165,7 +41036,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> @@ -41196,7 +41067,7 @@ if(response.data.categories.items.length != 20){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlUrlInfoByUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41212,7 +41083,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41233,11 +41104,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41269,7 +41140,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Url Info by url_key" enabled="true"> @@ -41299,7 +41170,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -41319,7 +41190,7 @@ vars.putObject("category", categories[number]); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetCmsPageByIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41335,7 +41206,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41356,11 +41227,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41389,7 +41260,7 @@ var number = random.nextInt(cmsPages.length); vars.put("cms_page_id", cmsPages[number].id); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> @@ -41419,7 +41290,7 @@ vars.put("cms_page_id", cmsPages[number].id); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> @@ -41439,7 +41310,7 @@ vars.put("cms_page_id", cmsPages[number].id); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetNavigationMenuByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41455,7 +41326,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41476,11 +41347,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41512,7 +41383,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> @@ -41540,7 +41411,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -41561,7 +41432,7 @@ vars.putObject("category", categories[number]); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlCreateEmptyCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41577,7 +41448,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41598,11 +41469,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41644,7 +41515,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -41673,7 +41544,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlGetEmptyCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41689,7 +41560,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41710,11 +41581,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41756,7 +41627,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -41803,7 +41674,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -41824,7 +41695,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlSetShippingAddressOnCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -41840,7 +41711,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -41861,11 +41732,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -41907,7 +41778,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -41954,7 +41825,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -41993,7 +41864,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42014,7 +41885,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlSetBillingAddressOnCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -42030,7 +41901,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -42051,11 +41922,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -42097,7 +41968,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -42144,7 +42015,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42183,7 +42054,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42204,7 +42075,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlAddSimpleProductToCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -42220,7 +42091,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -42241,11 +42112,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -42287,7 +42158,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -42326,7 +42197,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -42354,7 +42225,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42376,7 +42247,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlAddConfigurableProductToCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -42392,7 +42263,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -42413,11 +42284,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -42459,7 +42330,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -42498,7 +42369,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -42526,7 +42397,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42545,7 +42416,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> @@ -42574,7 +42445,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42596,7 +42467,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -42612,7 +42483,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -42633,11 +42504,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -42679,7 +42550,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -42718,7 +42589,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -42746,7 +42617,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42786,7 +42657,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -42833,7 +42704,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -42854,7 +42725,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -42870,7 +42741,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -42891,11 +42762,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -42937,7 +42808,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -42976,7 +42847,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -43004,7 +42875,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43023,7 +42894,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> @@ -43052,7 +42923,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43092,7 +42963,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -43139,7 +43010,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43160,7 +43031,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartWithPricesPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -43176,7 +43047,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -43197,11 +43068,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -43243,7 +43114,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -43282,7 +43153,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart With Prices" enabled="true"> @@ -43310,7 +43181,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43350,7 +43221,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -43397,7 +43268,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43419,7 +43290,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -43435,7 +43306,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -43456,11 +43327,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -43502,7 +43373,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -43541,7 +43412,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -43569,7 +43440,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43588,7 +43459,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> @@ -43617,7 +43488,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43657,7 +43528,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -43704,7 +43575,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43726,7 +43597,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveSimpleProductFromCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -43742,7 +43613,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -43763,11 +43634,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -43809,7 +43680,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -43848,7 +43719,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -43876,7 +43747,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43916,7 +43787,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -43963,7 +43834,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -43984,7 +43855,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveConfigurableProductFromCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -44000,7 +43871,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -44021,11 +43892,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -44067,7 +43938,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -44106,7 +43977,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -44134,7 +44005,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44153,7 +44024,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> @@ -44182,7 +44053,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44222,7 +44093,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> @@ -44269,7 +44140,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44290,7 +44161,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlApplyCouponToCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -44306,7 +44177,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -44327,11 +44198,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -44373,7 +44244,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -44412,7 +44283,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -44440,7 +44311,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44467,7 +44338,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> </JSR223Sampler> <hashTree/> @@ -44496,7 +44367,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44517,7 +44388,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveCouponFromCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -44533,7 +44404,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -44554,11 +44425,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -44600,7 +44471,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -44639,7 +44510,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -44667,7 +44538,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44694,7 +44565,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> </JSR223Sampler> <hashTree/> @@ -44723,7 +44594,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44762,7 +44633,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44783,7 +44654,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlCatalogBrowsingByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -44799,7 +44670,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -44820,11 +44691,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -44856,7 +44727,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> @@ -44884,7 +44755,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -44923,7 +44794,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> @@ -44985,7 +44856,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -45023,7 +44894,7 @@ if (totalCount == null) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45054,7 +44925,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -45082,7 +44953,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45121,7 +44992,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45152,7 +45023,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> @@ -45180,7 +45051,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45219,7 +45090,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45245,7 +45116,7 @@ var number = random.nextInt(cmsPages.length); vars.put("cms_page_id", cmsPages[number].id); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> @@ -45275,7 +45146,7 @@ vars.put("cms_page_id", cmsPages[number].id); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> @@ -45295,7 +45166,7 @@ vars.put("cms_page_id", cmsPages[number].id); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${graphqlCheckoutByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -45311,7 +45182,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -45332,11 +45203,11 @@ if (testLabel <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -45378,7 +45249,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> @@ -45425,7 +45296,7 @@ vars.putObject("randomIntGenerator", random); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45456,7 +45327,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> @@ -45484,7 +45355,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45503,7 +45374,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> @@ -45532,7 +45403,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45564,7 +45435,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> @@ -45592,7 +45463,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45632,7 +45503,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45671,7 +45542,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45710,7 +45581,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45749,7 +45620,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> </HTTPSamplerProxy> <hashTree/> @@ -45778,7 +45649,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45804,7 +45675,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> </JSR223Sampler> <hashTree/> @@ -45833,7 +45704,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45872,7 +45743,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -45903,7 +45774,7 @@ vars.put("coupon_code", coupons[number].code); <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> @@ -45926,7 +45797,7 @@ function doCache(){ } } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Catalog Browsing By Guest" enabled="true"> @@ -45934,7 +45805,7 @@ function doCache(){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cBrowseCatalogByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -45950,7 +45821,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -45982,11 +45853,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -46018,7 +45889,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -46039,7 +45910,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46070,7 +45941,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46107,7 +45978,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -46137,7 +46008,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -46158,7 +46029,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46175,7 +46046,7 @@ vars.put("product_sku", product.get("sku")); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -46205,7 +46076,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> @@ -46226,7 +46097,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46247,7 +46118,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cSiteSearchPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -46263,7 +46134,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -46282,7 +46153,7 @@ if (testLabel <boolProp name="recycle">true</boolProp> <boolProp name="stopThread">false</boolProp> <stringProp name="shareMode">shareMode.thread</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> @@ -46306,7 +46177,7 @@ function doCache(){ } } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> <hashTree/> <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> @@ -46314,7 +46185,7 @@ function doCache(){ <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -46330,7 +46201,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -46362,7 +46233,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -46383,7 +46254,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46422,7 +46293,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46457,7 +46328,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -46485,7 +46356,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> @@ -46513,13 +46384,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -46533,7 +46404,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -46564,7 +46435,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46585,7 +46456,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -46601,7 +46472,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -46633,7 +46504,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -46654,7 +46525,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46693,7 +46564,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -46755,7 +46626,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -46783,7 +46654,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> @@ -46801,7 +46672,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 1 present in layered navigation" enabled="true"> <stringProp name="IfController.condition">${attribute_1_options_count} > 0</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Url 2" enabled="true"> <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_1_filter_url"));</stringProp> @@ -46873,7 +46744,7 @@ if (testLabel <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 2 present in layered navigation" enabled="true"> <stringProp name="IfController.condition">${attribute_2_options_count} > 0</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Ul 3" enabled="true"> <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_2_filter_url"));</stringProp> @@ -46937,13 +46808,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -46957,7 +46828,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -46988,7 +46859,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47009,7 +46880,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -47025,7 +46896,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -47057,7 +46928,7 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -47078,7 +46949,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47110,7 +46981,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47221,7 +47092,7 @@ if (testLabel <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47256,13 +47127,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> <hashTree/> <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -47276,7 +47147,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -47307,7 +47178,7 @@ vars.put("product_url_key", product); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47330,7 +47201,7 @@ vars.put("product_url_key", product); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAddToCartByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -47346,7 +47217,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -47378,11 +47249,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -47400,7 +47271,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -47425,7 +47296,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -47446,7 +47317,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47477,7 +47348,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47514,7 +47385,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -47544,11 +47415,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -47579,7 +47450,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47639,7 +47510,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -47648,7 +47519,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -47692,7 +47563,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47729,7 +47600,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -47737,7 +47608,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -47767,11 +47638,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -47802,7 +47673,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -47818,7 +47689,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -47975,7 +47846,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -48004,7 +47875,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -48014,7 +47885,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -48058,7 +47929,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48095,7 +47966,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -48107,7 +47978,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAddToWishlistPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -48123,7 +47994,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -48155,11 +48026,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -48178,11 +48049,11 @@ vars.putObject("randomIntGenerator", random); <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -48220,7 +48091,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48280,7 +48151,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48358,7 +48229,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Produts to Wishlist" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">5</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -48388,7 +48259,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> @@ -48409,7 +48280,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48463,7 +48334,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48525,7 +48396,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48547,7 +48418,7 @@ vars.put("product_sku", product.get("sku")); <stringProp name="ForeachController.inputVal">wishListItems</stringProp> <stringProp name="ForeachController.returnVal">wishListItem</stringProp> <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -48615,7 +48486,7 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48635,7 +48506,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -48646,7 +48517,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cCompareProductsPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -48662,7 +48533,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -48694,11 +48565,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -48716,7 +48587,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -48741,7 +48612,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> @@ -48762,7 +48633,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48798,7 +48669,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Compare" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -48828,11 +48699,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -48863,7 +48734,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48916,7 +48787,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> @@ -48959,7 +48830,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -48976,7 +48847,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Compare" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -49006,11 +48877,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49041,7 +48912,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49094,7 +48965,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> @@ -49137,7 +49008,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49169,14 +49040,14 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> <hashTree/> <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Product Compare - Pause" enabled="true"> <intProp name="ActionProcessor.action">1</intProp> <intProp name="ActionProcessor.target">0</intProp> <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${productCompareDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products Clear" enabled="true"> @@ -49205,7 +49076,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> <hashTree/> </hashTree> @@ -49215,7 +49086,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cCheckoutByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -49231,7 +49102,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -49263,11 +49134,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -49285,7 +49156,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -49310,7 +49181,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> @@ -49331,7 +49202,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49362,7 +49233,7 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49399,7 +49270,7 @@ vars.putObject("category", categories[number]); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -49429,11 +49300,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49464,7 +49335,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49524,7 +49395,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -49533,7 +49404,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -49577,7 +49448,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49614,7 +49485,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -49622,7 +49493,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -49652,11 +49523,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49687,7 +49558,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49703,7 +49574,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -49860,7 +49731,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -49889,7 +49760,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -49899,7 +49770,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -49943,7 +49814,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -49980,13 +49851,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -49998,7 +49869,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> @@ -50019,7 +49890,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50086,7 +49957,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -50145,7 +50016,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -50204,7 +50075,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -50263,7 +50134,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -50334,7 +50205,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50356,7 +50227,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cCheckoutByCustomerPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -50372,7 +50243,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -50404,11 +50275,11 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.Random; @@ -50426,7 +50297,7 @@ vars.putObject("randomIntGenerator", random); <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> vars.put("totalProductsAdded", "0"); </stringProp> @@ -50451,16 +50322,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -50498,7 +50369,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50529,7 +50400,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50589,7 +50460,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50682,7 +50553,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50719,7 +50590,7 @@ vars.put("customer_email", customerUser); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -50749,11 +50620,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -50784,7 +50655,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50844,7 +50715,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -50853,7 +50724,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -50897,7 +50768,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -50934,7 +50805,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> @@ -50942,7 +50813,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> <stringProp name="CounterConfig.start">1</stringProp> @@ -50972,11 +50843,11 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> <stringProp name="BeanShellSampler.query"> productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -51007,7 +50878,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51023,7 +50894,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -51180,7 +51051,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> <boolProp name="resetInterpreter">false</boolProp> @@ -51209,7 +51080,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> <hashTree/> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -51219,7 +51090,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> @@ -51263,7 +51134,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51300,13 +51171,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -51318,7 +51189,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> @@ -51339,7 +51210,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51446,7 +51317,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -51505,7 +51376,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -51564,7 +51435,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> @@ -51616,7 +51487,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51649,7 +51520,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51671,7 +51542,7 @@ if(curSampler.getName().contains("Checkout success")) { manager.clear(); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> <hashTree/> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> @@ -51682,7 +51553,7 @@ if(curSampler.getName().contains("Checkout success")) { customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -51693,7 +51564,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAccountManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -51709,7 +51580,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -51741,16 +51612,16 @@ if (testLabel </elementProp> </collectionProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -51788,7 +51659,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51819,7 +51690,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51879,7 +51750,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51972,7 +51843,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -51995,7 +51866,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_orders.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_orders.jmx</stringProp> <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -52135,7 +52006,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52167,7 +52038,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Downloadables Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -52190,7 +52061,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52221,7 +52092,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> <hashTree/> </hashTree> @@ -52261,7 +52132,7 @@ vars.put("customer_email", customerUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> </RegexExtractor> <hashTree/> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Verify that there are items in the wishlist" enabled="true"> @@ -52276,7 +52147,7 @@ vars.put("customer_email", customerUser); </hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Wish List Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> <stringProp name="IfController.condition">"${buttonTitle}" === "FOUND"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> </IfController> @@ -52299,7 +52170,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52353,7 +52224,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52385,7 +52256,7 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52405,7 +52276,7 @@ vars.put("customer_email", customerUser); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -52416,7 +52287,7 @@ customerUserList.add(vars.get("customer_email")); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminCMSManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -52432,7 +52303,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -52466,7 +52337,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -52493,21 +52364,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -52522,7 +52394,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -52556,7 +52428,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -52638,7 +52510,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -52648,17 +52520,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin CMS Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -52871,7 +52743,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -52885,7 +52757,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -52896,7 +52768,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseProductGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -52912,7 +52784,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -52946,7 +52818,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -52973,21 +52845,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -53002,7 +52875,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -53036,7 +52909,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -53118,7 +52991,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -53128,7 +53001,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -53151,11 +53024,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -53241,7 +53114,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -53358,7 +53231,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -53400,7 +53273,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -53486,7 +53359,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -53507,11 +53380,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -53648,7 +53521,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -53662,7 +53535,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -53673,7 +53546,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseOrderGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -53689,7 +53562,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -53723,7 +53596,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -53750,21 +53623,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -53779,7 +53653,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -53813,7 +53687,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -53895,7 +53769,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -53905,7 +53779,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -53928,11 +53802,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -54018,7 +53892,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -54135,7 +54009,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -54177,7 +54051,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -54263,7 +54137,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -54284,11 +54158,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -54425,7 +54299,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -54439,7 +54313,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -54450,7 +54324,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminProductCreationPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -54466,7 +54340,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -54500,7 +54374,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -54527,21 +54401,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -54556,7 +54431,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -54590,7 +54465,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -54672,7 +54547,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -54682,17 +54557,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/once_only_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> </OnceOnlyController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); @@ -54708,7 +54583,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> @@ -54722,7 +54597,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> @@ -54750,7 +54625,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> <stringProp name="VAR">admin_token</stringProp> @@ -54780,7 +54655,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> @@ -54830,7 +54705,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> <stringProp name="VAR">product_attributes</stringProp> @@ -54898,7 +54773,7 @@ vars.putObject("product_attributes", attributes); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> @@ -54925,17 +54800,20 @@ vars.put("attribute_set_filter", new String(encodedBytes)); </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); + if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); +number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); + simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); vars.put("simple_product_1_name", simpleList.get("title")); @@ -54968,11 +54846,11 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -56880,7 +56758,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Create Configurable Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -56901,7 +56779,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -56932,7 +56810,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -57462,7 +57340,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -57553,7 +57431,7 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> </hashTree> @@ -58074,7 +57952,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -58183,13 +58061,13 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> </hashTree> </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Downloadable Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -59814,7 +59692,7 @@ function addConfigurableMatrix(attributes) { </hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Simple Product" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> @@ -61347,7 +61225,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -61361,7 +61239,7 @@ function addConfigurableMatrix(attributes) { adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -61372,7 +61250,7 @@ function addConfigurableMatrix(attributes) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminProductEditingPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -61388,7 +61266,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -61422,7 +61300,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -61449,21 +61327,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -61478,7 +61357,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -61512,7 +61391,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -61594,7 +61473,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -61604,23 +61483,24 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Edit Product" enabled="true"/> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> <stringProp name="BeanShellSampler.query">import java.util.ArrayList; import java.util.HashMap; import java.util.Random; + int relatedIndex; try { Random random = new Random(); if (${seedForRandom} > 0) { @@ -61742,6 +61622,7 @@ vars.put("admin_user", adminUser); import java.util.Random; Random randomGenerator = new Random(); + int newCategoryId; if (${seedForRandom} > 0) { randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); } @@ -61752,7 +61633,7 @@ vars.put("admin_user", adminUser); if (categoryList.size() > 1) { do { int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = categoryList.get(index); + newCategoryId = categoryList.get(index).parseInt(); } while (categoryId == newCategoryId); vars.put("category_additional", newCategoryId.toString()); @@ -63842,7 +63723,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -63856,7 +63737,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -63867,7 +63748,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminReturnsManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -63883,7 +63764,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -63917,7 +63798,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -63944,21 +63825,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -63973,7 +63855,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -64007,7 +63889,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64089,7 +63971,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -64099,13 +63981,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> @@ -64126,7 +64008,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64237,7 +64119,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64354,7 +64236,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64388,7 +64270,7 @@ vars.put("admin_user", adminUser); </hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.ArrayList; import java.util.HashMap; @@ -64456,7 +64338,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64482,7 +64364,7 @@ vars.put("admin_user", adminUser); <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -64502,7 +64384,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64573,7 +64455,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64604,7 +64486,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64693,7 +64575,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64710,7 +64592,7 @@ vars.put("admin_user", adminUser); <intProp name="ActionProcessor.action">1</intProp> <intProp name="ActionProcessor.target">0</intProp> <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> <hashTree/> </hashTree> </hashTree> @@ -64733,7 +64615,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -64747,7 +64629,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -64758,7 +64640,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseCustomerGridPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -64774,7 +64656,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -64808,7 +64690,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -64835,21 +64717,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -64864,7 +64747,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -64898,7 +64781,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -64980,7 +64863,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -64990,7 +64873,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> @@ -65013,11 +64896,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> @@ -65103,7 +64986,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -65220,7 +65103,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> <stringProp name="JSON_PATH">$.totalRecords</stringProp> @@ -65262,7 +65145,7 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> @@ -65348,7 +65231,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -65369,11 +65252,11 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="CounterConfig.format"/> <boolProp name="CounterConfig.per_user">true</boolProp> <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> </TestFragmentController> <hashTree> <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> @@ -65510,7 +65393,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -65524,7 +65407,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -65535,7 +65418,7 @@ vars.put("grid_pages_count_filtered", pageCount); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminCreateOrderPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -65551,7 +65434,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -65585,7 +65468,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -65612,21 +65495,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -65641,7 +65525,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -65675,7 +65559,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -65757,7 +65641,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -65767,13 +65651,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> @@ -65785,25 +65669,38 @@ vars.put("admin_user", adminUser); vars.put("alabama_region_id", props.get("alabama_region_id")); vars.put("california_region_id", props.get("california_region_id")); </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); + +int number1 = 1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } + +number = random.nextInt(props.get("configurable_products_list").size()); +configurableList = props.get("configurable_products_list").get(number); +vars.put("configurable_product_1_url_key", configurableList.get("url_key")); +vars.put("configurable_product_1_name", configurableList.get("title")); +vars.put("configurable_product_1_id", configurableList.get("id")); +vars.put("configurable_product_1_sku", configurableList.get("sku")); +vars.put("configurable_attribute_id", configurableList.get("attribute_id")); +vars.put("configurable_option_id", configurableList.get("attribute_option_id")); + number = random.nextInt(props.get("simple_products_list").size()); simpleList = props.get("simple_products_list").get(number); vars.put("simple_product_1_url_key", simpleList.get("url_key")); vars.put("simple_product_1_name", simpleList.get("title")); vars.put("simple_product_1_id", simpleList.get("id")); +number1 = random.nextInt(props.get("configurable_products_list").size()); do { number1 = random.nextInt(props.get("simple_products_list").size()); } while(number == number1); @@ -65812,15 +65709,6 @@ vars.put("simple_product_2_url_key", simpleList.get("url_key")); vars.put("simple_product_2_name", simpleList.get("title")); vars.put("simple_product_2_id", simpleList.get("id")); -number = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_sku", configurableList.get("sku")); -vars.put("configurable_attribute_id", configurableList.get("attribute_id")); -vars.put("configurable_option_id", configurableList.get("attribute_option_id")); - customers_index = 0; if (!props.containsKey("customer_ids_index")) { @@ -66828,7 +66716,7 @@ catch (java.lang.Exception e) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -66842,7 +66730,7 @@ catch (java.lang.Exception e) { adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -66853,7 +66741,7 @@ catch (java.lang.Exception e) { <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminCategoryManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -66869,7 +66757,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -66903,7 +66791,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -66930,21 +66818,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -66959,7 +66848,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -66993,7 +66882,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -67075,7 +66964,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -67085,17 +66974,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> </TestFragmentController> <hashTree> <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> @@ -67872,7 +67761,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -67886,7 +67775,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -67897,7 +67786,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminPromotionRulesPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -67913,7 +67802,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -67947,7 +67836,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -67974,21 +67863,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -68003,7 +67893,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -68037,7 +67927,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -68119,7 +68009,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -68129,17 +68019,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -68556,7 +68446,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -68570,7 +68460,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -68581,7 +68471,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminCustomerManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -68597,7 +68487,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -68631,7 +68521,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -68658,21 +68548,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -68687,7 +68578,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -68721,7 +68612,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -68803,7 +68694,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -68813,17 +68704,17 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> </TestFragmentController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> @@ -70705,7 +70596,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -70719,7 +70610,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -70730,7 +70621,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> <stringProp name="ThroughputController.percentThroughput">${cAdminEditOrderPercentage}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> @@ -70746,7 +70637,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> @@ -70780,7 +70671,7 @@ if (testLabel } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> @@ -70807,21 +70698,22 @@ if (testLabel <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> <collectionProp name="CookieManager.cookies"/> <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> +adminUser = "none"; adminUserList = props.get("adminUserList"); adminUserListIterator = props.get("adminUserListIterator"); adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); @@ -70836,7 +70728,7 @@ if (adminUsersDistribution == 1) { adminUser = adminUserListIterator.next(); } -if (adminUser == null) { +if (adminUser == "none") { SampleResult.setResponseMessage("adminUser list is empty"); SampleResult.setResponseData("adminUser list is empty","UTF-8"); IsSuccess=false; @@ -70870,7 +70762,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -70952,7 +70844,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> @@ -70962,13 +70854,13 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> </hashTree> </hashTree> <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/simple_controller.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> @@ -70989,7 +70881,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71100,7 +70992,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71217,7 +71109,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71251,7 +71143,7 @@ vars.put("admin_user", adminUser); </hashTree> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> import java.util.ArrayList; import java.util.HashMap; @@ -71319,7 +71211,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71345,7 +71237,7 @@ vars.put("admin_user", adminUser); <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> @@ -71389,7 +71281,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71420,7 +71312,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71491,7 +71383,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71522,7 +71414,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71583,7 +71475,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> @@ -71616,7 +71508,7 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> @@ -71630,7 +71522,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } </stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> </hashTree> @@ -71651,7 +71543,7 @@ vars.put("admin_user", adminUser); <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"/> <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/tear_down.jmx</stringProp></PostThreadGroup> + <stringProp name="TestPlan.comments">tool/fragments/ce/tear_down.jmx</stringProp></PostThreadGroup> <hashTree> <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller: Dashboard enabled?" enabled="true"> <stringProp name="IfController.condition">"${dashboard_enabled}" == "1"</stringProp> @@ -71767,7 +71659,7 @@ vars.put("admin_user", adminUser); </value> </objProp> <stringProp name="filename">${response_time_file_name}</stringProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/aggregate_graph.jmx</stringProp></ResultCollector> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/aggregate_graph.jmx</stringProp></ResultCollector> <hashTree/> <DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="false"> @@ -71775,7 +71667,7 @@ vars.put("admin_user", adminUser); <boolProp name="displayJMeterVariables">true</boolProp> <boolProp name="displaySamplerProperties">true</boolProp> <boolProp name="displaySystemProperties">false</boolProp> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/_system/debug.jmx</stringProp></DebugPostProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/debug.jmx</stringProp></DebugPostProcessor> <hashTree/> </hashTree> <WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true"> From 92b8ca6f084f3bae1678ac6e3b839b957dd61199 Mon Sep 17 00:00:00 2001 From: Dan Mooney <dmooney@adobe.com> Date: Tue, 17 Nov 2020 08:08:10 -0600 Subject: [PATCH 170/490] magento/partners-magento2b2b#459: Automate MC-37569 Custom Customer Address Attribute --- ...AddressInCheckoutWithSearchActionGroup.xml | 28 +++++ ...sButtonFromCheckoutShippingActionGroup.xml | 18 +++ ...ntClickSaveOnNewAddressFormActionGroup.xml | 18 +++ ...stomerAddressAttributeValueActionGroup.xml | 22 ++++ .../StorefrontCustomerAddressFormSection.xml | 1 + ...rifyCustomCustomerAddressAttributeTest.xml | 113 ++++++++++++++++++ 6 files changed, 200 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml new file mode 100644 index 0000000000000..9ea1d38e16531 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!-- Check selected Billing address information on Review Section step --> + <actionGroup name="StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup"> + <annotations> + <description value="Verify customer billing address values on storefront checkout."/> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + <waitForElement selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" time="30" stepKey="waitForBillingSectionLoaded"/> + <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.firstname}}" /> + <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.lastname}}" /> + <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.street[0]}}" /> + <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.city}}" /> + <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.postcode}}" /> + <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.telephone}}" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml new file mode 100644 index 0000000000000..8fbec0a0b4851 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.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="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup"> + <annotations> + <description>Clicks the New Address button on the storefront Checkout Shipping page</description> + </annotations> + <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="ClickOnAddNewAddressButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml new file mode 100644 index 0000000000000..e8e0782fbd1e1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.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="StorefrontClickSaveOnNewAddressFormActionGroup"> + <annotations> + <description>Clicks the save button on the storefront new address form</description> + </annotations> + <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="saveNewAddress"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml new file mode 100644 index 0000000000000..5023df8b809a4 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup"> + <annotations> + <description>Selects the provided Option in the provided Customer Address Attribute drop down menu on store front.</description> + </annotations> + <arguments> + <argument name="customerAddressAttribute"/> + <argument name="optionValue" type="string"/> + </arguments> + + <selectOption selector="{{StorefrontCustomerAddressFormSection.dropDownAttribute(customerAddressAttribute.code)}}" userInput="{{optionValue}}" stepKey="selectOptionValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml index 112ced1bc375f..87754709b8466 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml @@ -20,6 +20,7 @@ <element name="country" type="select" selector="//form[@class='form-address-edit']//select[contains(@name, 'country_id')]"/> <element name="useAsDefaultBillingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_billing']"/> <element name="useAsDefaultShippingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_shipping']"/> + <element name="dropDownAttribute" type="select" selector="//select[@name='custom_attributes[{{var1}}]']" parameterized="true"/> <element name="saveAddress" type="button" selector="//button[@title='Save Address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml new file mode 100644 index 0000000000000..3e5bea352280c --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml @@ -0,0 +1,113 @@ +<?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="StorefrontVerifyCustomCustomerAddressAttributeTest"> + <annotations> + <features value="Customer"/> + <stories value="Storefront Custom Customer Address Attribute"/> + <title value="Verify Custom Customer Address Attribute Value Shows On Storefront Customer Checkout"/> + <description value="Verify that custom customer address attribute value shows at checkout on storefront for second address"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-37569"/> + <group value="customer"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"/> + <createData entity="Simple_US_Customer" stepKey="simpleCustomer"/> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="simpleCustomer" stepKey="deleteCustomer"/> + <!--Remove Custom Customer Address Attribute--> + <actionGroup ref="AdminDeleteCustomerAttribute" stepKey="adminDeleteFirstCustomerAttribute"> + <argument name="defaultLabel" value="{{AttributeDropdownData.label}}"/> + </actionGroup> + </after> + + <!--Create new custom customer address attribute--> + <actionGroup ref="AdminNavigateToCustomerAddressAttributesPageActionGroup"/> + <actionGroup ref="AdminAddOptionsCustomerAttribute" stepKey="adminCreateCustomerFirstAttribute"> + <argument name="defaultLabel" value="{{AttributeDropdownData.label}}"/> + <argument name="attributeCode" value="{{AttributeDropdownData.code}}"/> + <argument name="inputType" value="{{AttributeDropdownData.inputType}}"/> + <argument name="sortOrder" value="{{AttributeDropdownData.sortOrder}}"/> + <argument name="firstOption" value="{{AttributeDropdownData.firstOption}}"/> + <argument name="secondOption" value="{{AttributeDropdownData.secondOption}}"/> + </actionGroup> + + <!--Add address to B2C Customer--> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$$simpleCustomer.id$"/> + </actionGroup> + <click selector="{{AdminEditCustomerAddressesSection.addresses}}" stepKey="proceedToAddresses"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminCustomerAddressesGridSection.firstRowEditLink}}" stepKey="editFirstAddress"/> + <waitForPageLoad time="60" stepKey="waitForAddressForm"/> + + <actionGroup ref="SelectDropdownCustomerAddressAttributeValueActionGroup" stepKey="selectOptionValue"> + <argument name="customerAddressAttribute" value="AttributeDropdownData"/> + <argument name="optionValue" value="{{AttributeDropdownData.firstOption}}"/> + </actionGroup> + + <!--Login To Store Front By B2C Customer--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsStoreFront"> + <argument name="Customer" value="$$simpleCustomer$$"/> + </actionGroup> + <!-- Add Product To Cart From Product Detail Page--> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPageOnStorefront"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addToCartFromStorefrontProductPage"/> + + <!--Go To Checkout and Verify Default Address--> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckoutPage"/> + <!-- Ensure that the selected shipping address is similar to first address --> + <actionGroup ref="CheckSelectedShippingAddressInCheckoutWithSearchActionGroup" stepKey="assertShippingAddress"> + <argument name="customerVar" value="$$simpleCustomer$$"/> + <argument name="customerAddressVar" value="CustomerAddressSimple"/> + </actionGroup> + <!--Verify that selected "Test Dropdown" options appears on the page--> + <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute"/> + + <!--Add Second Shipping Address--> + <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton" + + <!--Fill in Shipping Address required fields and Custom Customer Address Attribute and click *Ship Here* button--> + <actionGroup ref="FillNewShippingAddressModalActionGroup" stepKey="changeAddress"> + <argument name="address" value="US_Address_NY"/> + </actionGroup> + <actionGroup ref="StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup" stepKey="selectOptionValue1"> + <argument name="customerAddressAttribute" value="AttributeDropdownData"/> + <argument name="optionValue" value="{{AttributeDropdownData.firstOption}}"/> + </actionGroup> + <actionGroup ref="StorefrontClickSaveOnNewAddressFormActionGroup" stepKey="clickOnSaveNewAddress"/> + + <!-- Ensure that the selected shipping address is similar to second address --> + <actionGroup ref="CheckSelectedShippingAddressInCheckoutWithSearchActionGroup" stepKey="assertShippingAddress1"> + <argument name="customerVar" value="$$simpleCustomer$$"/> + <argument name="customerAddressVar" value="US_Address_NY"/> + </actionGroup> + <!--Verify that selected "Test Dropdown" options appears on the page--> + <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute1"/> + + <!-- Select First Shipping Method and Go To Billing Section --> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + + <!-- Ensure that the Billing address is similar to first address --> + <actionGroup ref="StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup" stepKey="assertBillingAddress"> + <argument name="customerVar" value="$$simpleCustomer$$"/> + <argument name="customerAddressVar" value="CustomerAddressSimple"/> + </actionGroup> + <!--Verify that selected "Test Dropdown" options appears on the page--> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeBillingAddressCustomAttribute"/> + </test> +</tests> From 88272b7f4750a17d2527dc4a77a4c36334154129 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 17 Nov 2020 09:38:42 -0600 Subject: [PATCH 171/490] MC-38900: Mutation setGuestEmailOnCart doesn't update quote address --- app/code/Magento/Quote/Model/Quote/Address.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 5ecae97834eb0..9da6c9b0b61a1 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -1652,7 +1652,13 @@ public function setCustomerId($customerId) */ public function getEmail() { - return $this->getData(self::KEY_EMAIL); + $email = $this->getData(self::KEY_EMAIL); + $q = $this->getQuote(); + if (!$email && $this->getQuote() && $this->getQuote()->dataHasChangedFor('email')) { + $email = $this->getQuote()->getCustomerEmail(); + $this->setEmail($email); + } + return $email; } /** From e0d8149083b51604b82dbcee3d412f5424e7aa60 Mon Sep 17 00:00:00 2001 From: Graham Wharton <graham@gwharton.me.uk> Date: Tue, 17 Nov 2020 17:47:31 +0000 Subject: [PATCH 172/490] Updated method used to determine whether emails are sent on creation of invoices, creditmemos and shipments from the admin page. Now takes into account global "enabled" setting and the checkbox on creation page. Updated Unit and Integration tests to suit. --- .../Adminhtml/Order/Creditmemo/Save.php | 14 +- .../Adminhtml/Order/Invoice/Save.php | 7 +- .../Adminhtml/Order/Creditmemo/SaveTest.php | 124 +++++++++++ .../Adminhtml/Order/Invoice/SaveTest.php | 200 ++++++++++++++++++ .../Adminhtml/Order/Shipment/Save.php | 27 ++- .../Adminhtml/Order/Shipment/SaveTest.php | 62 +++++- .../Invoice/AbstractInvoiceControllerTest.php | 12 +- .../Adminhtml/Order/Invoice/SaveTest.php | 20 ++ 8 files changed, 439 insertions(+), 27 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php index 3d1160c0ca4f2..63558c0290e2c 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php @@ -7,6 +7,7 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Backend\App\Action; +use Magento\Sales\Helper\Data as SalesData; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender; @@ -34,21 +35,30 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac */ protected $resultForwardFactory; + /** + * @var SalesData + */ + private $salesData; + /** * @param Action\Context $context * @param \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader $creditmemoLoader * @param CreditmemoSender $creditmemoSender * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory + * @param SalesData $salesData */ public function __construct( Action\Context $context, \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader $creditmemoLoader, CreditmemoSender $creditmemoSender, - \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory + \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, + SalesData $salesData = null ) { $this->creditmemoLoader = $creditmemoLoader; $this->creditmemoSender = $creditmemoSender; $this->resultForwardFactory = $resultForwardFactory; + $this->salesData = $salesData ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(SalesData::class); parent::__construct($context); } @@ -108,7 +118,7 @@ public function execute() $doOffline = isset($data['do_offline']) ? (bool)$data['do_offline'] : false; $creditmemoManagement->refund($creditmemo, $doOffline); - if (!empty($data['send_email'])) { + if (!empty($data['send_email']) && $this->salesData->canSendNewCreditMemoEmail()) { $this->creditmemoSender->send($creditmemo); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php index f66ca37a47655..ae3c1af1e3195 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php @@ -86,7 +86,8 @@ public function __construct( $this->shipmentFactory = $shipmentFactory; $this->invoiceService = $invoiceService; parent::__construct($context); - $this->salesData = $salesData ?? $this->_objectManager->get(SalesData::class); + $this->salesData = $salesData ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(SalesData::class); } /** @@ -213,7 +214,7 @@ public function execute() // send invoice/shipment emails try { - if (!empty($data['send_email']) || $this->salesData->canSendNewInvoiceEmail()) { + if (!empty($data['send_email']) && $this->salesData->canSendNewInvoiceEmail()) { $this->invoiceSender->send($invoice); } } catch (\Exception $e) { @@ -222,7 +223,7 @@ public function execute() } if ($shipment) { try { - if (!empty($data['send_email']) || $this->salesData->canSendNewShipmentEmail()) { + if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail()) { $this->shipmentSender->send($shipment); } } catch (\Exception $e) { diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/SaveTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/SaveTest.php index 8ccb821f6399f..fef38f981e12d 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/SaveTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/SaveTest.php @@ -21,9 +21,13 @@ use Magento\Framework\Registry; use Magento\Framework\Session\Storage; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\CreditmemoManagementInterface; use Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save; use Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader; +use Magento\Sales\Helper\Data as SalesData; +use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Creditmemo; +use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -87,6 +91,16 @@ class SaveTest extends TestCase */ protected $resultRedirectMock; + /** + * @var CreditmemoSender|MockObject + */ + private $creditmemoSender; + + /** + * @var SalesData|MockObject + */ + private $salesData; + /** * Init model for future tests */ @@ -147,12 +161,32 @@ protected function setUp(): void $context = $helper->getObject(Context::class, $arguments); + $creditmemoManagement = $this->getMockBuilder(CreditmemoManagementInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->_objectManager->expects($this->any()) + ->method('create') + ->with(CreditmemoManagementInterface::class) + ->willReturn($creditmemoManagement); + $this->creditmemoSender = $this->getMockBuilder(CreditMemoSender::class) + ->disableOriginalConstructor() + ->setMethods(['send']) + ->getMock(); + $this->creditmemoSender->expects($this->any()) + ->method('send') + ->willReturn(true); + $this->salesData = $this->getMockBuilder(SalesData::class) + ->disableOriginalConstructor() + ->setMethods(['canSendNewCreditmemoEmail']) + ->getMock(); $this->memoLoaderMock = $this->createMock(CreditmemoLoader::class); $this->_controller = $helper->getObject( Save::class, [ 'context' => $context, 'creditmemoLoader' => $this->memoLoaderMock, + 'creditmemoSender' => $this->creditmemoSender, + 'salesData' => $this->salesData ] ); } @@ -258,4 +292,94 @@ protected function _setSaveActionExpectationForMageCoreException($data, $errorMe $this->_messageManager->expects($this->once())->method('addErrorMessage')->with($errorMessage); $this->_sessionMock->expects($this->once())->method('setFormData')->with($data); } + + /** + * @return array + */ + public function testExecuteEmailsDataProvider() + { + /** + * string $sendEmail + * bool $emailEnabled + * bool $shouldEmailBeSent + */ + return [ + ['', false, false], + ['', true, false], + ['on', false, false], + ['on', true, true] + ]; + } + + /** + * @param string $sendEmail + * @param bool $emailEnabled + * @param bool $shouldEmailBeSent + * @dataProvider testExecuteEmailsDataProvider + */ + public function testExecuteEmails( + $sendEmail, + $emailEnabled, + $shouldEmailBeSent + ) { + $orderId = 1; + $creditmemoId = 2; + $invoiceId = 3; + $creditmemoData = ['items' => [], 'send_email' => $sendEmail]; + + $this->resultRedirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->resultRedirectMock); + $this->resultRedirectMock->expects($this->once()) + ->method('setPath') + ->with('sales/order/view', ['order_id' => $orderId]) + ->willReturnSelf(); + + $order = $this->createPartialMock( + Order::class, + [] + ); + + $creditmemo = $this->createPartialMock( + Creditmemo::class, + ['isValidGrandTotal', 'getOrder', 'getOrderId'] + ); + $creditmemo->expects($this->once()) + ->method('isValidGrandTotal') + ->willReturn(true); + $creditmemo->expects($this->once()) + ->method('getOrder') + ->willReturn($order); + $creditmemo->expects($this->once()) + ->method('getOrderId') + ->willReturn($orderId); + + $this->_requestMock->expects($this->any()) + ->method('getParam') + ->willReturnMap( + [ + ['order_id', null, $orderId], + ['creditmemo_id', null, $creditmemoId], + ['creditmemo', null, $creditmemoData], + ['invoice_id', null, $invoiceId] + ] + ); + + $this->_requestMock->expects($this->any()) + ->method('getPost') + ->willReturn($creditmemoData); + + $this->memoLoaderMock->expects($this->once()) + ->method('load') + ->willReturn($creditmemo); + + $this->salesData->expects($this->any()) + ->method('canSendNewCreditmemoEmail') + ->willReturn($emailEnabled); + if ($shouldEmailBeSent) { + $this->creditmemoSender->expects($this->once()) + ->method('send'); + } + $this->assertEquals($this->resultRedirectMock, $this->_controller->execute()); + } } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php index a84eee24e2e99..4029cd8368343 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php @@ -8,16 +8,27 @@ namespace Magento\Sales\Test\Unit\Controller\Adminhtml\Order\Invoice; use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\Session; use Magento\Backend\Model\View\Result\Redirect; use Magento\Framework\App\Request\Http; use Magento\Framework\Data\Form\FormKey\Validator; +use Magento\Framework\DB\Transaction; use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\ObjectManager\ObjectManager as FrameworkObjectManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Result\PageFactory; use Magento\Sales\Controller\Adminhtml\Order\Invoice\Save; +use Magento\Sales\Helper\Data as SalesData; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\Service\InvoiceService; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class SaveTest extends TestCase { /** @@ -50,6 +61,26 @@ class SaveTest extends TestCase */ protected $controller; + /** + * @var SalesData|MockObject + */ + private $salesData; + + /** + * @var InvoiceSender|MockObject + */ + private $invoiceSender; + + /** + * @var FrameworkObjectManager|MockObject + */ + private $objectManager; + + /** + * @var InvoiceService|MockObject + */ + private $invoiceService; + /** * SetUp method * @@ -98,11 +129,36 @@ protected function setUp(): void $contextMock->expects($this->any()) ->method('getMessageManager') ->willReturn($this->messageManagerMock); + $this->objectManager = $this->createPartialMock( + FrameworkObjectManager::class, + ['create','get'] + ); + $contextMock->expects($this->any()) + ->method('getObjectManager') + ->willReturn($this->objectManager); + $this->invoiceSender = $this->getMockBuilder(InvoiceSender::class) + ->disableOriginalConstructor() + ->setMethods(['send']) + ->getMock(); + $this->invoiceSender->expects($this->any()) + ->method('send') + ->willReturn(true); + $this->salesData = $this->getMockBuilder(SalesData::class) + ->disableOriginalConstructor() + ->setMethods(['canSendNewInvoiceEmail']) + ->getMock(); + $this->invoiceService = $this->getMockBuilder(InvoiceService::class) + ->disableOriginalConstructor() + ->setMethods(['prepareInvoice']) + ->getMock(); $this->controller = $objectManager->getObject( Save::class, [ 'context' => $contextMock, + 'invoiceSender' => $this->invoiceSender, + 'invoiceService' => $this->invoiceService, + 'salesData' => $this->salesData ] ); } @@ -137,4 +193,148 @@ public function testExecuteNotValidPost() $this->assertEquals($redirectMock, $this->controller->execute()); } + + /** + * @return array + */ + public function testExecuteEmailsDataProvider() + { + /** + * string $sendEmail + * bool $emailEnabled + * bool $shouldEmailBeSent + */ + return [ + ['', false, false], + ['', true, false], + ['on', false, false], + ['on', true, true] + ]; + } + + /** + * @param string $sendEmail + * @param bool $emailEnabled + * @param bool $shouldEmailBeSent + * @dataProvider testExecuteEmailsDataProvider + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteEmails( + $sendEmail, + $emailEnabled, + $shouldEmailBeSent + ) { + $redirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->getMock(); + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('sales/order/view') + ->willReturnSelf(); + + $this->resultPageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($redirectMock); + $this->formKeyValidatorMock->expects($this->once()) + ->method('validate') + ->with($this->requestMock) + ->willReturn(true); + $this->requestMock->expects($this->once()) + ->method('isPost') + ->willReturn(true); + + $invoiceData = ['items' => [], 'send_email' => $sendEmail]; + + $orderId = 2; + $order = $this->createPartialMock( + Order::class, + ['load','getId','canInvoice'] + ); + $order->expects($this->once()) + ->method('load') + ->willReturn($order); + $order->expects($this->once()) + ->method('getId') + ->willReturn($orderId); + $order->expects($this->once()) + ->method('canInvoice') + ->willReturn(true); + + $invoice = $this->getMockBuilder(Invoice::class) + ->disableOriginalConstructor() + ->setMethods(['getTotalQty','getOrder','register']) + ->getMock(); + $invoice->expects($this->any()) + ->method('getTotalQty') + ->willReturn(1); + $invoice->expects($this->any()) + ->method('getOrder') + ->willReturn($order); + $invoice->expects($this->once()) + ->method('register') + ->willReturn($order); + + $this->invoiceService->expects($this->any()) + ->method('prepareInvoice') + ->willReturn($invoice); + + $saveTransaction = $this->getMockBuilder(Transaction::class) + ->disableOriginalConstructor() + ->setMethods(['addObject','save']) + ->getMock(); + $saveTransaction->expects($this->at(0)) + ->method('addObject') + ->with($invoice)->willReturnSelf(); + $saveTransaction->expects($this->at(1)) + ->method('addObject') + ->with($order)->willReturnSelf(); + $saveTransaction->expects($this->at(2)) + ->method('save'); + + $session = $this->getMockBuilder(Session::class) + ->disableOriginalConstructor() + ->setMethods(['getCommentText']) + ->getMock(); + $session->expects($this->once()) + ->method('getCommentText') + ->with(true); + + $this->objectManager->expects($this->any()) + ->method('create') + ->will( + $this->returnValueMap( + [ + [Transaction::class, [], $saveTransaction], + [Order::class, [], $order], + [Session::class, [], $session] + ] + ) + ); + $this->objectManager->expects($this->any()) + ->method('get') + ->with(Session::class) + ->willReturn($session); + + $this->requestMock->expects($this->any()) + ->method('getParam') + ->willReturnMap( + [ + ['order_id', null, $orderId], + ['invoice', null, $invoiceData] + ] + ); + $this->requestMock->expects($this->any()) + ->method('getPost') + ->willReturn($invoiceData); + + $this->salesData->expects($this->any()) + ->method('canSendNewInvoiceEmail') + ->willReturn($emailEnabled); + if ($shouldEmailBeSent) { + $this->invoiceSender->expects($this->once()) + ->method('send'); + } + + $this->assertEquals($redirectMock, $this->controller->execute()); + } } diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php index 100ba029beabd..0c9738540322c 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php @@ -8,10 +8,11 @@ use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; +use Magento\Sales\Helper\Data as SalesData; use Magento\Sales\Model\Order\Shipment\Validation\QuantityValidator; /** - * Class Save + * Controller for generation of new Shipments from Backend * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterface @@ -43,19 +44,26 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac */ private $shipmentValidator; + /** + * @var SalesData + */ + private $salesData; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader * @param \Magento\Shipping\Model\Shipping\LabelGenerator $labelGenerator * @param \Magento\Sales\Model\Order\Email\Sender\ShipmentSender $shipmentSender * @param \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface|null $shipmentValidator + * @param SalesData $salesData */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader, \Magento\Shipping\Model\Shipping\LabelGenerator $labelGenerator, \Magento\Sales\Model\Order\Email\Sender\ShipmentSender $shipmentSender, - \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface $shipmentValidator = null + \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface $shipmentValidator = null, + SalesData $salesData = null ) { parent::__construct($context); @@ -64,6 +72,8 @@ public function __construct( $this->shipmentSender = $shipmentSender; $this->shipmentValidator = $shipmentValidator ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface::class); + $this->salesData = $salesData ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(SalesData::class); } /** @@ -109,6 +119,7 @@ public function execute() } $data = $this->getRequest()->getParam('shipment'); + $orderId = $this->getRequest()->getParam('order_id'); if (!empty($data['comment_text'])) { $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setCommentText($data['comment_text']); @@ -118,7 +129,7 @@ public function execute() $responseAjax = new \Magento\Framework\DataObject(); try { - $this->shipmentLoader->setOrderId($this->getRequest()->getParam('order_id')); + $this->shipmentLoader->setOrderId($orderId); $this->shipmentLoader->setShipmentId($this->getRequest()->getParam('shipment_id')); $this->shipmentLoader->setShipment($data); $this->shipmentLoader->setTracking($this->getRequest()->getParam('tracking')); @@ -143,7 +154,7 @@ public function execute() $this->messageManager->addErrorMessage( __("Shipment Document Validation Error(s):\n" . implode("\n", $validationResult->getMessages())) ); - return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); + return $resultRedirect->setPath('*/*/new', ['order_id' => $orderId]); } $shipment->register(); @@ -156,7 +167,7 @@ public function execute() $this->_saveShipment($shipment); - if (!empty($data['send_email'])) { + if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail()) { $this->shipmentSender->send($shipment); } @@ -173,7 +184,7 @@ public function execute() $responseAjax->setMessage($e->getMessage()); } else { $this->messageManager->addErrorMessage($e->getMessage()); - return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); + return $resultRedirect->setPath('*/*/new', ['order_id' => $orderId]); } } catch (\Exception $e) { $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); @@ -182,13 +193,13 @@ public function execute() $responseAjax->setMessage(__('An error occurred while creating shipping label.')); } else { $this->messageManager->addErrorMessage(__('Cannot save shipment.')); - return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); + return $resultRedirect->setPath('*/*/new', ['order_id' => $orderId]); } } if ($isNeedCreateLabel) { return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setJsonData($responseAjax->toJson()); } - return $resultRedirect->setPath('sales/order/view', ['order_id' => $shipment->getOrderId()]); + return $resultRedirect->setPath('sales/order/view', ['order_id' => $orderId]); } } diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php index 1d71f8a0d8e0c..afd5f8819a8e0 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -21,6 +21,7 @@ use Magento\Framework\Message\Manager; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Sales\Helper\Data as SalesData; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Sender\ShipmentSender; use Magento\Sales\Model\Order\Shipment; @@ -119,6 +120,11 @@ class SaveTest extends TestCase */ private $validationResult; + /** + * @var SalesData|MockObject + */ + private $salesData; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ @@ -140,7 +146,14 @@ protected function setUp(): void ->getMock(); $this->shipmentSender = $this->getMockBuilder(ShipmentSender::class) ->disableOriginalConstructor() - ->setMethods([]) + ->setMethods(['send']) + ->getMock(); + $this->shipmentSender->expects($this->any()) + ->method('send') + ->willReturn(true); + $this->salesData = $this->getMockBuilder(SalesData::class) + ->disableOriginalConstructor() + ->setMethods(['canSendNewShipmentEmail']) ->getMock(); $this->objectManager = $this->getMockForAbstractClass(ObjectManagerInterface::class); $this->context = $this->createPartialMock(Context::class, [ @@ -232,7 +245,8 @@ protected function setUp(): void 'shipmentLoader' => $this->shipmentLoader, 'request' => $this->request, 'response' => $this->response, - 'shipmentValidator' => $this->shipmentValidatorMock + 'shipmentValidator' => $this->shipmentValidatorMock, + 'salesData' => $this->salesData ] ); } @@ -240,11 +254,19 @@ protected function setUp(): void /** * @param bool $formKeyIsValid * @param bool $isPost + * @param string $sendEmail + * @param bool $emailEnabled + * @param bool $shouldEmailBeSent * @dataProvider executeDataProvider * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function testExecute($formKeyIsValid, $isPost) - { + public function testExecute( + $formKeyIsValid, + $isPost, + $sendEmail, + $emailEnabled, + $shouldEmailBeSent + ) { $this->formKeyValidator->expects($this->any()) ->method('validate') ->willReturn($formKeyIsValid); @@ -269,7 +291,7 @@ public function testExecute($formKeyIsValid, $isPost) $shipmentId = 1000012; $orderId = 10003; $tracking = []; - $shipmentData = ['items' => [], 'send_email' => '']; + $shipmentData = ['items' => [], 'send_email' => $sendEmail]; $shipment = $this->createPartialMock( Shipment::class, ['load', 'save', 'register', 'getOrder', 'getOrderId', '__wakeup'] @@ -287,6 +309,13 @@ public function testExecute($formKeyIsValid, $isPost) ] ); + $this->salesData->expects($this->any()) + ->method('canSendNewShipmentEmail') + ->willReturn($emailEnabled); + if ($shouldEmailBeSent) { + $this->shipmentSender->expects($this->once()) + ->method('send'); + } $this->shipmentLoader->expects($this->any()) ->method('setShipmentId') ->with($shipmentId); @@ -309,7 +338,7 @@ public function testExecute($formKeyIsValid, $isPost) ->willReturn($order); $order->expects($this->once()) ->method('setCustomerNoteNotify') - ->with(false); + ->with(!empty($sendEmail)); $this->labelGenerator->expects($this->any()) ->method('create') ->with($shipment, $this->request) @@ -340,7 +369,7 @@ public function testExecute($formKeyIsValid, $isPost) ->with(Session::class) ->willReturn($this->session); $arguments = ['order_id' => $orderId]; - $shipment->expects($this->once()) + $shipment->expects($this->any()) ->method('getOrderId') ->willReturn($orderId); $this->prepareRedirect($arguments); @@ -364,11 +393,22 @@ public function testExecute($formKeyIsValid, $isPost) */ public function executeDataProvider() { + /** + * bool $formKeyIsValid + * bool $isPost + * string $sendEmail + * bool $emailEnabled + * bool $shouldEmailBeSent + */ return [ - [false, false], - [true, false], - [false, true], - [true, true] + [false, false, '', false, false], + [true, false, '', false, false], + [false, true, '', false, false], + [true, true, '', false, false], + [true, true, '', true, false], + [true, true, 'on', false, false], + [true, true, 'on', true, true], + ]; } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php index 3c26a53424d81..a96eac375e9f1 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php @@ -97,15 +97,21 @@ protected function prepareRequest(array $postParams = [], array $params = []): v * @param array $items * @param string $commentText * @param bool $doShipment + * @param bool $sendEmail * @return array */ - protected function hydratePost(array $items, string $commentText = '', $doShipment = false): array - { + protected function hydratePost( + array $items, + string $commentText = '', + $doShipment = false, + $sendEmail = false + ): array { return [ 'invoice' => [ 'items' => $items, 'comment_text' => $commentText, - 'do_shipment' => $doShipment + 'do_shipment' => $doShipment, + 'send_email' => $sendEmail ], ]; } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php index d00b4c784110c..027fc3d88ee49 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php @@ -58,6 +58,26 @@ public function testSendEmailOnInvoiceSave(): void $this->dispatch('backend/sales/order_invoice/save'); $invoice = $this->getInvoiceByOrder($order); $this->checkSuccess($invoice, 2); + $this->assertNull($this->transportBuilder->getSentMessage()); + } + + /** + * @magentoDataFixture Magento/Sales/_files/order.php + * + * @return void + */ + public function testSendEmailOnInvoiceSaveEmailCopyOfInvoice(): void + { + $order = $this->getOrder('100000001'); + $itemId = $order->getItemsCollection()->getFirstItem()->getId(); + $post = $this->hydratePost([$itemId => 2], "", false, "1"); + $this->prepareRequest( + $post, + ['order_id' => $order->getEntityId()] + ); + $this->dispatch('backend/sales/order_invoice/save'); + $invoice = $this->getInvoiceByOrder($order); + $this->checkSuccess($invoice, 2); $message = $this->transportBuilder->getSentMessage(); $this->assertNotNull($message); $subject = __('Invoice for your %1 order', $order->getStore()->getFrontendName())->render(); From 00f41145d0f498fddf22dc74e89249a32ade4f6c Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar_dahiwala@outlook.com> Date: Tue, 17 Nov 2020 14:02:10 -0500 Subject: [PATCH 173/490] magento/partners-magento2b2b#459: verify custom customer address attribute shows at checkout - Fix missing closing brackets --- .../Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml index 3e5bea352280c..9f56a3a77667f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml @@ -78,7 +78,7 @@ <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute"/> <!--Add Second Shipping Address--> - <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton" + <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton" /> <!--Fill in Shipping Address required fields and Custom Customer Address Attribute and click *Ship Here* button--> <actionGroup ref="FillNewShippingAddressModalActionGroup" stepKey="changeAddress"> From 20493c4c848692a6fb8ee57979e90d6d94446859 Mon Sep 17 00:00:00 2001 From: Max Lesechko <mlesechko@magento.com> Date: Tue, 17 Nov 2020 13:06:27 -0600 Subject: [PATCH 174/490] MC-38775: Send attributes into Launch Extension for Gainsight --- .../Test/AdminCheckAnalyticsTrackingTest.xml | 41 +++++++++ .../AdminAnalytics/ViewModel/Metadata.php | 87 ++++++++++++++++++- .../view/adminhtml/templates/tracking.phtml | 17 +++- 3 files changed, 139 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml index 4f0e9bb000a27..9b135a0bcfb96 100644 --- a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml +++ b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml @@ -31,5 +31,46 @@ <waitForPageLoad stepKey="waitForPageReloaded"/> <seeInPageSource html="var adminAnalyticsMetadata =" stepKey="seeInPageSource"/> + <grabPageSource stepKey="pageSource"/> + <assertRegExp message="adminAnalyticsMetadata object is invalid" stepKey="validateadminAnalyticsMetadata"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*("[\w_]+":\s+".+?"\s+)};#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect user ID" stepKey="validateUserId"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"user":\s+"[\w\d]{64}"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect secure base URL" stepKey="validateSecureBaseURL"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"secure_base_url":\s+"http(s)?\\\\u003A\\\\u002F\\\\u002F.+?\\\\u002F"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect product version" stepKey="validateProductVersion"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"version":\s+"[^\s]+"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect product edition" stepKey="validateProductEdition"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"product_edition":\s+"(Community|Enterprise|B2B)"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect application mode" stepKey="validateApplicationMode"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"mode":\s+"default|developer|production"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect store name" stepKey="validateStoreName"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"store_name_default":\s+".*?"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user created date" stepKey="validateAdminUserCreatedDate"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"admin_user_created":\s+".+?"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user log date" stepKey="validateAdminUserLogDate"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"admin_user_logdate":\s+".+?"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> + <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user role name" stepKey="validateAdminUserRoleName"> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+",\s+)*"admin_user_role_name":\s+".+?"#m</expectedResult> + <actualResult type="variable">$pageSource</actualResult> + </assertRegExp> </test> </tests> diff --git a/app/code/Magento/AdminAnalytics/ViewModel/Metadata.php b/app/code/Magento/AdminAnalytics/ViewModel/Metadata.php index 9b1accbe0c823..15d4afef086cd 100644 --- a/app/code/Magento/AdminAnalytics/ViewModel/Metadata.php +++ b/app/code/Magento/AdminAnalytics/ViewModel/Metadata.php @@ -3,12 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\AdminAnalytics\ViewModel; +use Magento\Config\Model\Config\Backend\Admin\Custom; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ProductMetadataInterface; use Magento\Backend\Model\Auth\Session; use Magento\Framework\App\State; use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Store\Model\Information; /** * Gets user version and mode @@ -30,19 +36,27 @@ class Metadata implements ArgumentInterface */ private $productMetadata; + /** + * @var ScopeConfigInterface + */ + private $config; + /** * @param ProductMetadataInterface $productMetadata * @param Session $authSession * @param State $appState + * @param ScopeConfigInterface $config */ public function __construct( ProductMetadataInterface $productMetadata, Session $authSession, - State $appState + State $appState, + ScopeConfigInterface $config ) { $this->productMetadata = $productMetadata; $this->authSession = $authSession; $this->appState = $appState; + $this->config = $config; } /** @@ -55,6 +69,16 @@ public function getMagentoVersion() :string return $this->productMetadata->getVersion(); } + /** + * Get product edition + * + * @return string + */ + public function getProductEdition(): string + { + return $this->productMetadata->getEdition(); + } + /** * Get current user id (hash generated from email) * @@ -62,8 +86,9 @@ public function getMagentoVersion() :string */ public function getCurrentUser() :string { - return hash('sha512', 'ADMIN_USER' . $this->authSession->getUser()->getEmail()); + return hash('sha256', 'ADMIN_USER' . $this->authSession->getUser()->getEmail()); } + /** * Get Magento mode that the user is using * @@ -73,4 +98,62 @@ public function getMode() :string { return $this->appState->getMode(); } + + /** + * Get created date for current user + * + * @return string + */ + public function getCurrentUserCreatedDate(): string + { + return $this->authSession->getUser()->getCreated(); + } + + /** + * Get log date for current user + * + * @return string|null + */ + public function getCurrentUserLogDate(): ?string + { + return $this->authSession->getUser()->getLogdate(); + } + + /** + * Get secure base URL + * + * @param string $scope + * @param string|null $scopeCode + * @return string|null + */ + public function getSecureBaseUrlForScope( + string $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + ?string $scopeCode = null + ): ?string { + return $this->config->getValue(Custom::XML_PATH_SECURE_BASE_URL, $scope, $scopeCode); + } + + /** + * Get store name + * + * @param string $scope + * @param string|null $scopeCode + * @return string|null + */ + public function getStoreNameForScope( + string $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + ?string $scopeCode = null + ): ?string { + return $this->config->getValue(Information::XML_PATH_STORE_INFO_NAME, $scope, $scopeCode); + } + + /** + * Get current user role name + * + * @return string + */ + public function getCurrentUserRoleName(): string + { + return $this->authSession->getUser()->getRole()->getRoleName(); + } } diff --git a/app/code/Magento/AdminAnalytics/view/adminhtml/templates/tracking.phtml b/app/code/Magento/AdminAnalytics/view/adminhtml/templates/tracking.phtml index bfe58de1eac5f..4b155e1a5ae5b 100644 --- a/app/code/Magento/AdminAnalytics/view/adminhtml/templates/tracking.phtml +++ b/app/code/Magento/AdminAnalytics/view/adminhtml/templates/tracking.phtml @@ -19,11 +19,20 @@ false ) ?> -<?php $scriptString = ' +<?php +/** @var \Magento\AdminAnalytics\ViewModel\Metadata $metadata */ +$metadata = $block->getMetadata(); +$scriptString = ' var adminAnalyticsMetadata = { - "version": "' . $block->escapeJs($block->getMetadata()->getMagentoVersion()) . '", - "user": "' . $block->escapeJs($block->getMetadata()->getCurrentUser()) . '", - "mode": "' . $block->escapeJs($block->getMetadata()->getMode()) . '" + "secure_base_url": "' . $block->escapeJs($metadata->getSecureBaseUrlForScope()) . '", + "version": "' . $block->escapeJs($metadata->getMagentoVersion()) . '", + "product_edition": "' . $block->escapeJs($metadata->getProductEdition()) . '", + "user": "' . $block->escapeJs($metadata->getCurrentUser()) . '", + "mode": "' . $block->escapeJs($metadata->getMode()) . '", + "store_name_default": "' . $block->escapeJs($metadata->getStoreNameForScope()) . '", + "admin_user_created": "' . $block->escapeJs($metadata->getCurrentUserCreatedDate()) . '", + "admin_user_logdate": "' . $block->escapeJs($metadata->getCurrentUserLogDate()) . '", + "admin_user_role_name": "' . $block->escapeJs($metadata->getCurrentUserRoleName()) . '" }; '; ?> From 51d15584615191e48e69be792e196e8ec4849a8e Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Tue, 17 Nov 2020 13:06:29 -0600 Subject: [PATCH 175/490] MC-38340: GraphQL code changes for a consistent object uid - fix custom queries to not depend on core and graphql schema features testing --- .../etc/schema.graphqls | 20 +++++++++++--- .../Framework/RequiredInputArgumentTest.php | 26 +++++++++---------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQuery/etc/schema.graphqls b/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQuery/etc/schema.graphqls index 1a5796e07b08b..85684ead2532e 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQuery/etc/schema.graphqls +++ b/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQuery/etc/schema.graphqls @@ -2,20 +2,22 @@ # See COPYING.txt for license details. type Query { - testItem(id: Int!) : Item @resolver(class: "Magento\\TestModuleGraphQlQuery\\Model\\Resolver\\Item") + testItem(id: Int!) : TestItemOutput @resolver(class: "Magento\\TestModuleGraphQlQuery\\Model\\Resolver\\Item") testUnion: TestUnion @resolver(class: "Magento\\TestModuleGraphQlQuery\\Model\\Resolver\\TestUnion") + testQueryWithNestedMandatoryInputArguments(input: TestInputQueryWithMandatoryArgumentsInput): TestItemOutput + testQueryWithTopLevelMandatoryInputArguments(topLevelArgument: String!): TestItemOutput } type Mutation { - testItem(id: Int!) : MutationItem @resolver(class: "Magento\\TestModuleGraphQlQuery\\Model\\Resolver\\Item") + testItem(id: Int!) : MutationItemOutput @resolver(class: "Magento\\TestModuleGraphQlQuery\\Model\\Resolver\\Item") } -type Item { +type TestItemOutput { item_id: Int name: String } -type MutationItem { +type MutationItemOutput { item_id: Int name: String } @@ -30,3 +32,13 @@ type TypeCustom1 { type TypeCustom2 { custom_name2: String } + +input TestInputQueryWithMandatoryArgumentsInput { + query_id: String! + query_items: [QueryWithMandatoryArgumentsInput!]! +} + +input QueryWithMandatoryArgumentsInput { + query_item_id: Int! + quantity: Float +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php index 9fecc954d1182..f2189ad020e3f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php @@ -26,15 +26,16 @@ public function testSimpleInputArgumentRequired() { $query = <<<QUERY { - urlResolver{ - id - type + testQueryWithTopLevelMandatoryInputArguments{ + item_id + name } } QUERY; $expectedExceptionsMessage = 'GraphQL response contains errors:' - . ' Field "urlResolver" argument "url" of type "String!" is required but not provided.'; + . ' Field "testQueryWithTopLevelMandatoryInputArguments" argument "topLevelArgument"' + . ' of type "String!" is required but not provided.'; $this->expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage($expectedExceptionsMessage); @@ -44,31 +45,30 @@ public function testSimpleInputArgumentRequired() /** * Test that a more complex required argument is handled properly * - * updateCartItems mutation has required parameter input.cart_items.cart_item_id + * testInputQueryWithMandatoryArguments mutation has required parameter input.query_items.query_item_id */ public function testInputObjectArgumentRequired() { $query = <<<QUERY - mutation { - updateCartItems( + query { + testQueryWithNestedMandatoryInputArguments( input: { - cart_id: "foobar" - cart_items: [ + query_id: "foobar" + query_items: [ { quantity: 2 } ] } ) { - cart { - total_quantity - } + item_id + name } } QUERY; $expectedExceptionsMessage = 'GraphQL response contains errors:' - . ' Field CartItemUpdateInput.cart_item_id of required type Int! was not provided.'; + . ' Field QueryWithMandatoryArgumentsInput.query_item_id of required type Int! was not provided.'; $this->expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage($expectedExceptionsMessage); From 6a6cf623836ec20c013bf80551d1ce0599599d0e Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar_dahiwala@outlook.com> Date: Tue, 17 Nov 2020 14:22:12 -0500 Subject: [PATCH 176/490] magento/partners-magento2b2b#459: verify custom customer address attribute shows at checkout - Fix typos --- .../Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml index 9f56a3a77667f..aaad76e4ff2cb 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml @@ -78,7 +78,7 @@ <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute"/> <!--Add Second Shipping Address--> - <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton" /> + <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton"/> <!--Fill in Shipping Address required fields and Custom Customer Address Attribute and click *Ship Here* button--> <actionGroup ref="FillNewShippingAddressModalActionGroup" stepKey="changeAddress"> From cb5b1b86ed5aa6918639868f4622de3d284e4079 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 17 Nov 2020 13:35:19 -0600 Subject: [PATCH 177/490] MC-38900: Mutation setGuestEmailOnCart doesn't update quote address --- app/code/Magento/Quote/Model/Quote/Address.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 9da6c9b0b61a1..0edf603d131f8 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -1653,8 +1653,7 @@ public function setCustomerId($customerId) public function getEmail() { $email = $this->getData(self::KEY_EMAIL); - $q = $this->getQuote(); - if (!$email && $this->getQuote() && $this->getQuote()->dataHasChangedFor('email')) { + if (!$email && $this->getQuote() && $this->getQuote()->dataHasChangedFor('customer_email')) { $email = $this->getQuote()->getCustomerEmail(); $this->setEmail($email); } From 17b76e616ef353802acbb7b0b17101879e21b4f7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 17 Nov 2020 13:42:25 -0600 Subject: [PATCH 178/490] MC-38900: Mutation setGuestEmailOnCart doesn't update quote address --- app/code/Magento/Quote/Model/Quote/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 0edf603d131f8..f918d480dd4e0 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -1653,7 +1653,7 @@ public function setCustomerId($customerId) public function getEmail() { $email = $this->getData(self::KEY_EMAIL); - if (!$email && $this->getQuote() && $this->getQuote()->dataHasChangedFor('customer_email')) { + if ($this->getQuote() && (!$email || $this->getQuote()->dataHasChangedFor('customer_email'))) { $email = $this->getQuote()->getCustomerEmail(); $this->setEmail($email); } From 920514dc954be80f085a79eca9846f21bfed8c33 Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar_dahiwala@outlook.com> Date: Tue, 17 Nov 2020 14:45:18 -0500 Subject: [PATCH 179/490] magento/partners-magento2b2b#459: verify custom customer address attribute shows at checkout - Added Missing Step key --- .../Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml index aaad76e4ff2cb..02a94f99f0e53 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml @@ -33,7 +33,7 @@ </after> <!--Create new custom customer address attribute--> - <actionGroup ref="AdminNavigateToCustomerAddressAttributesPageActionGroup"/> + <actionGroup ref="AdminNavigateToCustomerAddressAttributesPageActionGroup" stepKey="adminNavigateToCustomerAddressAttributesPage"/> <actionGroup ref="AdminAddOptionsCustomerAttribute" stepKey="adminCreateCustomerFirstAttribute"> <argument name="defaultLabel" value="{{AttributeDropdownData.label}}"/> <argument name="attributeCode" value="{{AttributeDropdownData.code}}"/> From 20ce0894bd18e9b1375831ad9f8e2387f7e1f319 Mon Sep 17 00:00:00 2001 From: Victor Rad <vrad@magento.com> Date: Tue, 17 Nov 2020 14:26:06 -0600 Subject: [PATCH 180/490] MC-39024: Rest api PUT /V1/products/:sku/links calls does not update indexer by cron:run --- app/code/Magento/Catalog/etc/mview.xml | 2 + .../Magento/CatalogInventory/etc/mview.xml | 1 + app/code/Magento/CatalogRule/etc/mview.xml | 1 + .../Api/ProductLinkRepositoryTest.php | 122 +++++++++++++++++- 4 files changed, 124 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/etc/mview.xml b/app/code/Magento/Catalog/etc/mview.xml index 7ae38a7f2d0e1..2c9d7d448afd2 100644 --- a/app/code/Magento/Catalog/etc/mview.xml +++ b/app/code/Magento/Catalog/etc/mview.xml @@ -49,6 +49,7 @@ <table name="catalog_product_entity_decimal" entity_column="entity_id" /> <table name="catalog_product_entity_int" entity_column="entity_id" /> <table name="catalog_product_entity_tier_price" entity_column="entity_id" /> + <table name="catalog_product_link" entity_column="product_id" /> </subscriptions> </view> <view id="catalog_product_attribute" class="Magento\Catalog\Model\Indexer\Product\Eav" group="indexer"> @@ -56,6 +57,7 @@ <table name="catalog_product_entity_decimal" entity_column="entity_id" /> <table name="catalog_product_entity_int" entity_column="entity_id" /> <table name="catalog_product_entity_varchar" entity_column="entity_id" /> + <table name="catalog_product_link" entity_column="product_id" /> </subscriptions> </view> </config> diff --git a/app/code/Magento/CatalogInventory/etc/mview.xml b/app/code/Magento/CatalogInventory/etc/mview.xml index 338f1fe0610a1..9733fa32583f1 100644 --- a/app/code/Magento/CatalogInventory/etc/mview.xml +++ b/app/code/Magento/CatalogInventory/etc/mview.xml @@ -11,6 +11,7 @@ <table name="cataloginventory_stock_item" entity_column="product_id" /> <!--Track product status to trigger stock indexer--> <table name="catalog_product_entity_int" entity_column="entity_id" /> + <table name="catalog_product_link" entity_column="product_id" /> </subscriptions> </view> <view id="catalog_product_price" class="Magento\Catalog\Model\Indexer\Product\Price" group="indexer"> diff --git a/app/code/Magento/CatalogRule/etc/mview.xml b/app/code/Magento/CatalogRule/etc/mview.xml index 9f793d5c8c393..106e0ffabb2b2 100644 --- a/app/code/Magento/CatalogRule/etc/mview.xml +++ b/app/code/Magento/CatalogRule/etc/mview.xml @@ -21,6 +21,7 @@ <table name="catalog_product_entity_tier_price" entity_column="entity_id" /> <table name="catalog_product_entity_varchar" entity_column="entity_id" /> <table name="catalog_category_product" entity_column="product_id" /> + <table name="catalog_product_link" entity_column="product_id" /> </subscriptions> </view> <view id="catalog_product_price" class="Magento\Catalog\Model\Indexer\Product\Price" group="indexer"> diff --git a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php index 11e07d081636e..efa7341c36a40 100644 --- a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php @@ -7,28 +7,44 @@ namespace Magento\GroupedProduct\Api; use Magento\TestFramework\Helper\Bootstrap; +use Magento\Indexer\Model\Config; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Framework\Webapi\Rest\Request; class ProductLinkRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstract { const SERVICE_NAME = 'catalogProductLinkRepositoryV1'; const SERVICE_VERSION = 'V1'; const RESOURCE_PATH = '/V1/products/'; + const SERVICE_NAME_SEARCH = 'searchV1'; + const RESOURCE_PATH_SEARCH = '/V1/search/'; /** * @var \Magento\Framework\ObjectManagerInterface */ protected $objectManager; + /** + * @var array + */ + private $indexersState; + + /** + * @var mixed + */ + private $indexerRegistry; + protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); + $this->indexerRegistry = $this->objectManager->get(IndexerRegistry::class); } /** * @magentoApiDataFixture Magento/Catalog/_files/product_simple_duplicated.php * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped.php */ - public function testSave() + public function testSave(): void { $productSku = 'grouped-product'; $linkType = 'associated'; @@ -46,7 +62,7 @@ public function testSave() $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . $productSku . '/links', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + 'httpMethod' => Request::HTTP_METHOD_PUT, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -64,4 +80,106 @@ public function testSave() }); $this->assertEquals($productData, $actual[2]); } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple_duplicated.php + * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped.php + */ + public function testLinkWithScheduledIndex(): void + { + $this->setIndexScheduled(); + $productSkuGrouped = 'grouped-product'; + $productSimple = 'simple-1'; + $linkType = 'associated'; + $productData = [ + 'sku' => $productSkuGrouped, + 'link_type' => $linkType, + 'linked_product_type' => 'simple', + 'linked_product_sku' => $productSimple, + 'position' => 3, + 'extension_attributes' => [ + 'qty' => (float) 300.0000, + ], + ]; + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $productSkuGrouped . '/links', + 'httpMethod' => Request::HTTP_METHOD_PUT, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + $this->_webApiCall($serviceInfo, ['entity' => $productData]); + + $searchCriteria = $this->buildSearchCriteria($productSimple); + $serviceInfo = $this->buildSearchServiceInfo($searchCriteria); + $response = $this->_webApiCall($serviceInfo, $searchCriteria); + $this->assertArrayHasKey('search_criteria', $response); + $this->assertArrayHasKey('items', $response); + $this->assertGreaterThan(1, count($response['items'])); + $this->assertGreaterThan(0, $response['items'][0]['id']); + $this->restoreIndexMode(); + } + + /** + * @param string $productSku + * @return array + */ + private function buildSearchCriteria(string $productSku): array + { + return [ + 'searchCriteria' => [ + 'request_name' => 'quick_search_container', + 'filter_groups' => [ + [ + 'filters' => [ + [ + 'field' => 'search_term', + 'value' => $productSku, + ] + ] + ] + ] + ] + ]; + } + + /** + * @param array $searchCriteria + * @return array + */ + private function buildSearchServiceInfo(array $searchCriteria): array + { + return [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH_SEARCH . '?' . http_build_query($searchCriteria), + 'httpMethod' => Request::HTTP_METHOD_GET + ], + 'soap' => [ + 'service' => self::SERVICE_NAME_SEARCH, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME_SEARCH . 'Search' + ] + ]; + } + + private function setIndexScheduled(): void + { + $indexerListIds = $this->objectManager->get(Config::class)->getIndexers(); + foreach ($indexerListIds as $indexerId) { + $indexer = $this->indexerRegistry->get($indexerId['indexer_id']); + $this->indexersState[$indexerId['indexer_id']] = $indexer->isScheduled(); + $indexer->setScheduled(true); + } + } + + private function restoreIndexMode(): void + { + foreach ($this->indexersState as $indexerId => $state) { + $this->indexerRegistry->get($indexerId)->setScheduled($state); + } + } } From 37a9adaa66221499078ab335a76826946efba0a9 Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Tue, 17 Nov 2020 17:37:41 -0600 Subject: [PATCH 181/490] MC-39071: Implement Multiple Wishlist additions and patch back minor updates - Added impl for ce schema changes --- .../Mapper/WishlistDataMapper.php | 34 +++++++++++++++++++ .../Model/Resolver/WishlistItems.php | 30 +++++++++++++--- .../WishlistGraphQl/etc/schema.graphqls | 10 +++++- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php b/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php index 9cc1404613e41..96e39b6566d5d 100644 --- a/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php +++ b/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php @@ -7,6 +7,7 @@ namespace Magento\WishlistGraphQl\Mapper; +use Magento\Framework\GraphQl\Schema\Type\Enum\DataMapperInterface; use Magento\Wishlist\Model\Wishlist; /** @@ -14,6 +15,20 @@ */ class WishlistDataMapper { + /** + * @var DataMapperInterface + */ + private $enumDataMapper; + + /** + * @param DataMapperInterface $enumDataMapper + */ + public function __construct( + DataMapperInterface $enumDataMapper + ) { + $this->enumDataMapper = $enumDataMapper; + } + /** * Mapping the review data * @@ -29,7 +44,26 @@ public function map(Wishlist $wishlist): array 'updated_at' => $wishlist->getUpdatedAt(), 'items_count' => $wishlist->getItemsCount(), 'name' => $wishlist->getName(), + 'visibility' => $this->getMappedVisibility((int) $wishlist->getVisibility()), 'model' => $wishlist, ]; } + + /** + * Get wishlist mapped visibility + * + * @param int $visibility + * + * @return string|null + */ + private function getMappedVisibility(int $visibility): ?string + { + if ($visibility === null) { + return null; + } + + $visibilityEnums = $this->enumDataMapper->getMappedEnums('WishlistVisibilityEnum'); + + return isset($visibilityEnums[$visibility]) ? strtoupper($visibilityEnums[$visibility]) : null; + } } diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php index 77ff483a60bd2..bf9fe1875c228 100644 --- a/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php @@ -61,7 +61,9 @@ public function resolve( /** @var Wishlist $wishlist */ $wishlist = $value['model']; - $wishlistItems = $this->getWishListItems($wishlist); + /** @var WishlistItemCollection $wishlistItemCollection */ + $wishlistItemsCollection = $this->getWishListItems($wishlist, $args); + $wishlistItems = $wishlistItemsCollection->getItems(); $data = []; foreach ($wishlistItems as $wishlistItem) { @@ -74,17 +76,28 @@ public function resolve( 'itemModel' => $wishlistItem, ]; } - return $data; + return [ + 'items' => $data, + 'page_info' => [ + 'current_page' => $wishlistItemsCollection->getCurPage(), + 'page_size' => $wishlistItemsCollection->getPageSize(), + 'total_pages' => $wishlistItemsCollection->getLastPageNumber() + ] + ]; } /** * Get wishlist items * * @param Wishlist $wishlist - * @return Item[] + * @param array $args + * @return WishlistItemCollection */ - private function getWishListItems(Wishlist $wishlist): array + private function getWishListItems(Wishlist $wishlist, array $args): WishlistItemCollection { + $currentPage = $args['currentPage'] ?? 1; + $pageSize = $args['pageSize'] ?? 20; + /** @var WishlistItemCollection $wishlistItemCollection */ $wishlistItemCollection = $this->wishlistItemCollectionFactory->create(); $wishlistItemCollection @@ -93,6 +106,13 @@ private function getWishListItems(Wishlist $wishlist): array return $store->getId(); }, $this->storeManager->getStores())) ->setVisibilityFilter(); - return $wishlistItemCollection->getItems(); + if ($currentPage > 0) { + $wishlistItemCollection->setCurPage($currentPage); + } + + if ($pageSize > 0) { + $wishlistItemCollection->setPageSize($pageSize); + } + return $wishlistItemCollection; } } diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index 7812176db60d0..1a8730bba5fcc 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -25,7 +25,10 @@ type WishlistOutput @doc(description: "Deprecated: `Wishlist` type should be use type Wishlist { id: ID @doc(description: "Wishlist unique identifier") items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") - items_v2: [WishlistItemInterface] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItems") @doc(description: "An array of items in the customer's wish list") + items_v2( + currentPage: Int = 1, + pageSize: Int = 20 + ): WishlistItems @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItems") @doc(description: "An array of items in the customer's wish list") items_count: Int @doc(description: "The number of items in the wish list") sharing_code: String @doc(description: "An encrypted code that Magento uses to link to the wish list") updated_at: String @doc(description: "The time of the last modification to the wish list") @@ -40,6 +43,11 @@ interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\ customizable_options: [SelectedCustomizableOption] @doc(description: "Custom options selected for the wish list item") } +type WishlistItems { + items: [WishlistItemInterface]! @doc(description: "Wishlist items list") + page_info: SearchResultPageInfo +} + type WishlistItem { id: Int @doc(description: "The wish list item ID") qty: Float @doc(description: "The quantity of this wish list item"), From cd3ed62dafa32b6a683d462d4fc12103f29f490f Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Tue, 17 Nov 2020 19:14:13 -0600 Subject: [PATCH 182/490] MC-38340: GraphQL code changes for a consistent object uid - add test support for uids on catalog configurable product and cart --- .../Model/Options/Collection.php | 2 +- .../Resolver/ConfigurableCartItemOptions.php | 26 +++++++---- .../etc/schema.graphqls | 11 +++-- ...gurableProductToCartSingleMutationTest.php | 43 +++++++++++++++++-- 4 files changed, 64 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php index 7801e4375f789..19706e114d1d4 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/Collection.php @@ -136,7 +136,7 @@ private function fetch(): array $this->attributeMap[$productId][$attribute->getId()] = $attribute->getData(); $this->attributeMap[$productId][$attribute->getId()]['id'] = $attribute->getId(); $this->attributeMap[$productId][$attribute->getId()]['uid'] = $this->uidEncoder->encode( - self::OPTION_TYPE . '/' . $attribute->getId() + self::OPTION_TYPE . '/' . $productId . '/' . $attribute->getAttributeId() ); $this->attributeMap[$productId][$attribute->getId()]['attribute_id_v2'] = $attribute->getProductAttribute()->getAttributeId(); diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php index e9458e21aff9e..3af45cdcdcea1 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -7,8 +7,10 @@ namespace Magento\ConfigurableProductGraphQl\Model\Resolver; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Helper\Product\Configuration; use Magento\Framework\App\ObjectManager; +use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Uid; @@ -34,17 +36,24 @@ class ConfigurableCartItemOptions implements ResolverInterface /** @var Uid */ private $uidEncoder; + /** + * @var MetadataPool + */ + private $metadataPool; + /** * @param Configuration $configurationHelper - * @param Uid|null $uidEncoder + * @param MetadataPool $metadataPool + * @param Uid $uidEncoder */ public function __construct( Configuration $configurationHelper, - Uid $uidEncoder = null + MetadataPool $metadataPool, + Uid $uidEncoder ) { $this->configurationHelper = $configurationHelper; - $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() - ->get(Uid::class); + $this->metadataPool = $metadataPool; + $this->uidEncoder = $uidEncoder; } /** @@ -66,7 +75,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } /** @var Item $cartItem */ $cartItem = $value['model']; - + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + $productLinkId = $cartItem->getProduct()->getData($linkField); $result = []; foreach ($this->configurationHelper->getOptions($cartItem) as $option) { if (isset($option['option_type'])) { @@ -75,12 +85,12 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } $result[] = [ 'id' => $option['option_id'], - 'configurable_product_options_uid' => $this->uidEncoder->encode( - self::OPTION_TYPE . '/' . $option['option_id'] + 'configurable_product_option_uid' => $this->uidEncoder->encode( + self::OPTION_TYPE . '/' . $productLinkId . '/' . $option['option_id'] ), 'option_label' => $option['label'], 'value_id' => $option['option_value'], - 'configurable_product_options_values_uid' => $this->uidEncoder->encode( + 'configurable_product_option_value_uid' => $this->uidEncoder->encode( self::OPTION_TYPE . '/' . $option['option_id'] . '/' . $option['option_value'] ), 'value_label' => $option['value'], diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 366088fcb4751..3d28eae9b41d7 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -33,8 +33,7 @@ type ConfigurableProductOptions @doc(description: "ConfigurableProductOptions de position: Int @doc(description: "A number that indicates the order in which the attribute is displayed") use_default: Boolean @doc(description: "Indicates whether the option is the default") values: [ConfigurableProductOptionsValues] @doc(description: "An array that defines the value_index codes assigned to the configurable product") - product_id: Int @deprecated(reason: "User `product_uid` instead") @doc(description: "This is the same as a product's id field") - product_uid: ID! @doc(description: "This is the same as a product's id field") + product_id: Int @deprecated(reason: "`product_id` is not needed and can be obtained from it's parent") @doc(description: "This is the same as a product's id field") } type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOptionsValues contains the index number assigned to a configurable product option") { @@ -68,11 +67,11 @@ type ConfigurableCartItem implements CartItemInterface { } type SelectedConfigurableOption { - id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_options_uid instead") - configurable_product_options_uid: ID! @doc(description: "Unique identifier for the selected configurable option object") + id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_uid instead") + configurable_product_option_uid: ID! @doc(description: "Unique identifier for the selected configurable option object") option_label: String! - value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_options_values_uid instead") - configurable_product_options_values_uid: ID! @doc(description: "Unique identifier for the option value of the `SelectedConfigurableOption` object") + value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_value_uid instead") + configurable_product_option_value_uid: ID! @doc(description: "Unique identifier for the option value of the `SelectedConfigurableOption` object") value_label: String! } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php index fb6b36b883e77..5a08692d5dcdd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php @@ -64,8 +64,9 @@ public function testAddConfigurableProductToCart() $parentSku = $product['sku']; $attributeId = (int) $product['configurable_options'][0]['attribute_id']; $valueIndex = $product['configurable_options'][0]['values'][1]['value_index']; - + $productRowId = (string) $product['configurable_options'][0]['product_id']; $selectedConfigurableOptionsQuery = $this->generateSuperAttributesUIDQuery($attributeId, $valueIndex); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); $query = $this->getQuery( @@ -76,19 +77,35 @@ public function testAddConfigurableProductToCart() ); $response = $this->graphQlMutation($query); - + $expectedProductOptionsValueUid = $this->generateConfigurableSelectionUID($attributeId, $valueIndex); + $expectedProductOptionsUid = base64_encode("configurable/$productRowId/$attributeId"); $cartItem = current($response['addProductsToCart']['cart']['items']); self::assertEquals($quantity, $cartItem['quantity']); self::assertEquals($parentSku, $cartItem['product']['sku']); + self::assertEquals(base64_encode((string)$cartItem['product']['id']), $cartItem['product']['uid']); self::assertArrayHasKey('configurable_options', $cartItem); $option = current($cartItem['configurable_options']); self::assertEquals($attributeId, $option['id']); self::assertEquals($valueIndex, $option['value_id']); + self::assertEquals($expectedProductOptionsValueUid, $option['configurable_product_option_value_uid']); + self::assertEquals($expectedProductOptionsUid, $option['configurable_product_option_uid']); self::assertArrayHasKey('option_label', $option); self::assertArrayHasKey('value_label', $option); } + /** + * Generates UID configurable product + * + * @param int $attributeId + * @param int $valueIndex + * @return string + */ + private function generateConfigurableSelectionUID(int $attributeId, int $valueIndex): string + { + return base64_encode("configurable/$attributeId/$valueIndex"); + } + /** * Generates UID for super configurable product super attributes * @@ -98,7 +115,7 @@ public function testAddConfigurableProductToCart() */ private function generateSuperAttributesUIDQuery(int $attributeId, int $valueIndex): string { - return 'selected_options: ["' . base64_encode("configurable/$attributeId/$valueIndex") . '"]'; + return 'selected_options: ["' . $this->generateConfigurableSelectionUID($attributeId, $valueIndex) . '"]'; } /** @@ -256,15 +273,20 @@ private function getQuery( cart { items { id + uid quantity product { sku + uid + id } ... on ConfigurableCartItem { configurable_options { id + configurable_product_option_uid option_label value_id + configurable_product_option_value_uid value_label } } @@ -306,16 +328,20 @@ private function getFetchProductQuery(string $term): string ) { items { sku + uid ... on ConfigurableProduct { configurable_options { attribute_id + attribute_uid attribute_code id + uid label position product_id use_default values { + uid default_label label store_label @@ -323,6 +349,17 @@ private function getFetchProductQuery(string $term): string value_index } } + configurable_options_selection_metadata { + options_available_for_selection { + attribute_code + option_value_uids + } + variant { + uid + name + attribute_set_id + } + } } } } From 3739a34e53e1ed4f44e5e86f4cee26591103e175 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Tue, 17 Nov 2020 21:06:27 -0600 Subject: [PATCH 183/490] MC-38340: GraphQL code changes for a consistent object uid - add test support for uids on catalog on cart --- .../Model/Resolver/CategoriesQuery.php | 8 ++-- .../Model/Resolver/CategoryList.php | 8 ++-- .../Resolver/Product/MediaGalleryEntries.php | 8 ++-- .../QuoteGraphQl/Model/Resolver/CartItems.php | 8 ++-- .../GraphQl/Catalog/StoreConfigTest.php | 4 ++ .../RemoveConfigurableProductFromCartTest.php | 43 +++++++++++++++---- .../UpdateConfigurableCartItemsTest.php | 39 +++++++++++++---- 7 files changed, 81 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php index 0d7e61c023d8a..0e653995ebcab 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php @@ -10,7 +10,6 @@ use Magento\CatalogGraphQl\Model\Category\CategoryFilter; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -47,19 +46,18 @@ class CategoriesQuery implements ResolverInterface * @param CategoryTree $categoryTree * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree * @param CategoryFilter $categoryFilter - * @param ArgumentsProcessorInterface|null $argsSelection + * @param ArgumentsProcessorInterface $argsSelection */ public function __construct( CategoryTree $categoryTree, ExtractDataFromCategoryTree $extractDataFromCategoryTree, CategoryFilter $categoryFilter, - ArgumentsProcessorInterface $argsSelection = null + ArgumentsProcessorInterface $argsSelection ) { $this->categoryTree = $categoryTree; $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; $this->categoryFilter = $categoryFilter; - $this->argsSelection = $argsSelection ?: ObjectManager::getInstance() - ->get(ArgumentsProcessorInterface::class); + $this->argsSelection = $argsSelection; } /** diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php index e210c1152360e..747e05806a821 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php @@ -10,7 +10,6 @@ use Magento\CatalogGraphQl\Model\Category\CategoryFilter; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -47,19 +46,18 @@ class CategoryList implements ResolverInterface * @param CategoryTree $categoryTree * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree * @param CategoryFilter $categoryFilter - * @param ArgumentsProcessorInterface|null $argsSelection + * @param ArgumentsProcessorInterface $argsSelection */ public function __construct( CategoryTree $categoryTree, ExtractDataFromCategoryTree $extractDataFromCategoryTree, CategoryFilter $categoryFilter, - ArgumentsProcessorInterface $argsSelection = null + ArgumentsProcessorInterface $argsSelection ) { $this->categoryTree = $categoryTree; $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; $this->categoryFilter = $categoryFilter; - $this->argsSelection = $argsSelection ?: ObjectManager::getInstance() - ->get(ArgumentsProcessorInterface::class); + $this->argsSelection = $argsSelection; } /** diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php index d18386eddbe0a..3bcc69f94cda0 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGalleryEntries.php @@ -7,7 +7,6 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\Uid; @@ -28,12 +27,11 @@ class MediaGalleryEntries implements ResolverInterface private $uidEncoder; /** - * Uid|null $uidEncoder + * Uid $uidEncoder */ - public function __construct(Uid $uidEncoder = null) + public function __construct(Uid $uidEncoder) { - $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() - ->get(Uid::class); + $this->uidEncoder = $uidEncoder; } /** diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php index 76788440f2f82..533e697c05123 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php @@ -7,7 +7,6 @@ namespace Magento\QuoteGraphQl\Model\Resolver; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -34,15 +33,14 @@ class CartItems implements ResolverInterface /** * @param GetCartProducts $getCartProducts - * @param Uid|null $uidEncoder + * @param Uid $uidEncoder */ public function __construct( GetCartProducts $getCartProducts, - Uid $uidEncoder = null + Uid $uidEncoder ) { $this->getCartProducts = $getCartProducts; - $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() - ->get(Uid::class); + $this->uidEncoder = $uidEncoder; } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php index 0982007daaa44..69c432f4cc82a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -42,6 +42,7 @@ public function testGetStoreConfig() list_per_page, catalog_default_sort_by, root_category_id + root_category_uid } } QUERY; @@ -58,6 +59,7 @@ public function testGetStoreConfig() $this->assertEquals(8, $response['storeConfig']['list_per_page']); $this->assertEquals('asc', $response['storeConfig']['catalog_default_sort_by']); $this->assertEquals(2, $response['storeConfig']['root_category_id']); + $this->assertEquals(base64_encode('2'), $response['storeConfig']['root_category_uid']); } /** @@ -88,6 +90,7 @@ public function testGetStoreConfigGlobal() list_per_page, catalog_default_sort_by, root_category_id + root_category_uid } } QUERY; @@ -104,5 +107,6 @@ public function testGetStoreConfigGlobal() $this->assertEquals(8, $response['storeConfig']['list_per_page']); $this->assertEquals('asc', $response['storeConfig']['catalog_default_sort_by']); $this->assertEquals(2, $response['storeConfig']['root_category_id']); + $this->assertEquals(base64_encode('2'), $response['storeConfig']['root_category_uid']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php index f1b08d8858ba0..8be20653070e1 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php @@ -53,14 +53,20 @@ protected function setUp(): void } /** + * @param string $itemArgName + * @param string $reservedOrderId + * @dataProvider removeConfigurableProductFromCartDataProvider * @magentoApiDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php */ - public function testRemoveConfigurableProductFromCart() + public function testRemoveConfigurableProductFromCart(string $itemArgName, string $reservedOrderId) { $configurableOptionSku = 'simple_10'; - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_cart_with_configurable'); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); $quoteItemId = $this->getQuoteItemIdBySku($configurableOptionSku); - $query = $this->getQuery($maskedQuoteId, $quoteItemId); + if ($itemArgName === 'cart_item_uid') { + $quoteItemId = base64_encode($quoteItemId); + } + $query = $this->getQuery($itemArgName, $maskedQuoteId, $quoteItemId); $response = $this->graphQlMutation($query); $this->assertArrayHasKey('cart', $response['removeItemFromCart']); @@ -69,18 +75,37 @@ public function testRemoveConfigurableProductFromCart() } /** + * Data provider for testUpdateConfigurableCartItemQuantity + * + * @return array + */ + public function removeConfigurableProductFromCartDataProvider(): array + { + return [ + ['cart_item_id', 'test_cart_with_configurable'], + ['cart_item_uid', 'test_cart_with_configurable'], + ]; + } + + /** + * @param string $itemArgName * @param string $maskedQuoteId - * @param int $itemId + * @param string $itemId * @return string */ - private function getQuery(string $maskedQuoteId, int $itemId): string + private function getQuery(string $itemArgName, string $maskedQuoteId, string $itemId): string { + if (is_numeric($itemId)) { + $itemId = (int) $itemId; + } else { + $itemId = '"' . $itemId . '"'; + } return <<<QUERY mutation { removeItemFromCart( input: { cart_id: "{$maskedQuoteId}" - cart_item_id: {$itemId} + {$itemArgName}: {$itemId} } ) { cart { @@ -97,9 +122,9 @@ private function getQuery(string $maskedQuoteId, int $itemId): string * Returns quote item ID by product's SKU * * @param string $sku - * @return int + * @return string */ - private function getQuoteItemIdBySku(string $sku): int + private function getQuoteItemIdBySku(string $sku): string { $quote = $this->quoteFactory->create(); $this->quoteResource->load($quote, 'test_cart_with_configurable', 'reserved_order_id'); @@ -107,7 +132,7 @@ private function getQuoteItemIdBySku(string $sku): int $quoteItemsCollection = $quote->getItemsCollection(); foreach ($quoteItemsCollection->getItems() as $item) { if ($item->getSku() == $sku) { - return (int)$item->getId(); + return $item->getId(); } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php index d3bc0204efe23..c7800ec327e90 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php @@ -44,18 +44,22 @@ class UpdateConfigurableCartItemsTest extends GraphQlAbstract private $quoteResource; /** + * @param string $itemArgName + * @param string $reservedOrderId + * @dataProvider updateConfigurableCartItemQuantityDataProvider * @magentoApiDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php */ - public function testUpdateConfigurableCartItemQuantity() + public function testUpdateConfigurableCartItemQuantity(string $itemArgName, string $reservedOrderId) { - $reservedOrderId = 'test_cart_with_configurable'; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); $productSku = 'simple_10'; $newQuantity = 123; - $quoteItem = $this->getQuoteItemBySku($productSku, $reservedOrderId); - - $query = $this->getQuery($maskedQuoteId, (int)$quoteItem->getId(), $newQuantity); + $quoteItemId = $this->getQuoteItemBySku($productSku, $reservedOrderId)->getId(); + if ($itemArgName === 'cart_item_uid') { + $quoteItemId = base64_encode($quoteItemId); + } + $query = $this->getQuery($itemArgName, $maskedQuoteId, $quoteItemId, $newQuantity); $response = $this->graphQlMutation($query); self::assertArrayHasKey('updateCartItems', $response); @@ -63,6 +67,19 @@ public function testUpdateConfigurableCartItemQuantity() self::assertEquals($newQuantity, $response['updateCartItems']['cart']['items']['0']['quantity']); } + /** + * Data provider for testUpdateConfigurableCartItemQuantity + * + * @return array + */ + public function updateConfigurableCartItemQuantityDataProvider(): array + { + return [ + ['cart_item_id', 'test_cart_with_configurable'], + ['cart_item_uid', 'test_cart_with_configurable'], + ]; + } + /** * @inheritdoc */ @@ -76,20 +93,26 @@ protected function setUp(): void } /** + * @param string $itemArgName * @param string $maskedQuoteId - * @param int $quoteItemId + * @param string $quoteItemId * @param int $newQuantity * @return string */ - private function getQuery(string $maskedQuoteId, int $quoteItemId, int $newQuantity): string + private function getQuery(string $itemArgName, string $maskedQuoteId, string $quoteItemId, int $newQuantity): string { + if (is_numeric($quoteItemId)) { + $quoteItemId = (int) $quoteItemId; + } else { + $quoteItemId = '"' . $quoteItemId . '"'; + } return <<<QUERY mutation { updateCartItems(input: { cart_id:"$maskedQuoteId" cart_items: [ { - cart_item_id: $quoteItemId + $itemArgName: $quoteItemId quantity: $newQuantity } ] From 87f1812d08c1601d2a73d1dd3ee1048b4881548d Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Wed, 18 Nov 2020 10:50:52 +0530 Subject: [PATCH 184/490] Review Changes - 18thNov2020 --- .../LoginAsCustomer/CreateCustomerToken.php | 3 -- .../Model/Resolver/RequestCustomerToken.php | 1 - .../Magento/LoginAsCustomerGraphQl/README.md | 52 +------------------ .../LoginAsCustomerGraphQl/composer.json | 1 - .../LoginAsCustomerGraphQl/etc/module.xml | 6 +-- .../etc/schema.graphqls | 12 ++--- 6 files changed, 11 insertions(+), 64 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php index 220ffdf4114e8..a10bc10ffb825 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/LoginAsCustomer/CreateCustomerToken.php @@ -16,8 +16,6 @@ /** * Create customer token from customer email - * - * Class CreateCustomerToken */ class CreateCustomerToken { @@ -32,7 +30,6 @@ class CreateCustomerToken private $tokenModelFactory; /** - * CreateCustomerToken constructor. * @param TokenFactory $tokenModelFactory * @param CustomerFactory $customerFactory */ diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index a2fb5571c4f3d..d3e0aab3d4b02 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -42,7 +42,6 @@ class RequestCustomerToken implements ResolverInterface private $createCustomerToken; /** - * RequestCustomerToken constructor. * @param AuthorizationInterface $authorization * @param LoginAsCustomerConfig $config * @param CreateCustomerToken $createCustomerToken diff --git a/app/code/Magento/LoginAsCustomerGraphQl/README.md b/app/code/Magento/LoginAsCustomerGraphQl/README.md index dc5e03c96feca..4bedf92dfc238 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/README.md +++ b/app/code/Magento/LoginAsCustomerGraphQl/README.md @@ -1,51 +1,3 @@ -# Module Magento LoginAsCustomerGraphQl - - ``magento/module-loginascustomergraphql`` - - - [Main Functionalities](#markdown-header-main-functionalities) - - [Installation](#markdown-header-installation) - - [Configuration](#markdown-header-configuration) - - [Specifications](#markdown-header-specifications) - - [Attributes](#markdown-header-attributes) - - -## Main Functionalities -Flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account. - -## Installation -\* = in production please use the `--keep-generated` option - -### Type 1: Zip file - - - Unzip the zip file in `app/code/Magento` - - Enable the module by running `php bin/magento module:enable Magento_LoginAsCustomerGraphQl` - - Apply database updates by running `php bin/magento setup:upgrade`\* - - Flush the cache by running `php bin/magento cache:flush` - -### Type 2: Composer - - - Make the module available in a composer repository for example: - - private repository `repo.magento.com` - - public repository `packagist.org` - - public github repository as vcs - - Add the composer repository to the configuration by running `composer config repositories.repo.magento.com composer https://repo.magento.com/` - - Install the module composer by running `composer require magento/module-loginascustomergraphql` - - enable the module by running `php bin/magento module:enable Magento_LoginAsCustomerGraphQl` - - apply database updates by running `php bin/magento setup:upgrade`\* - - Flush the cache by running `php bin/magento cache:flush` - - -## Configuration - - - - -## Specifications - - - - -## Attributes - - +# LoginAsCustomerGraphQl +**LoginAsCustomerGraphQl** provides flexible login as a customer so a merchant or merchant admin can log into an end customer's account to assist them with their account. diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 291d2746d47a6..bb9cc1d25d5d5 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -5,7 +5,6 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-login-as-customer-api": "*", - "magento/module-integration": "*", "magento/module-store": "*", "magento/module-customer": "*", "magento/module-catalog-graph-ql": "*" diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index ac54899fbbadb..1d0d92eb3cbbd 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -8,10 +8,10 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_LoginAsCustomerGraphQl"> <sequence> - <module name="Magento_LoginAsCustomer"/> + <module name="Magento_LoginAsCustomerApi"/> <module name="Magento_Customer"/> - <module name="Magento_Authorization"/> - <module name="Magento_GraphQl"/> + <module name="Magento_Store"/> + <module name="Magento_CatalogGraphQl"/> </sequence> </module> </config> diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls index da41db5210fd6..11157af0ca602 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls @@ -6,25 +6,25 @@ type Mutation { input: GenerateCustomerTokenAsAdminInput! ): GenerateCustomerTokenAsAdminOutput @resolver(class: "Magento\\LoginAsCustomerGraphQl\\Model\\Resolver\\RequestCustomerToken") - @doc(description: "Request a token using Customer email") + @doc(description: "Request a customer token so that an administrator can perform remote shopping assistance") } input GenerateCustomerTokenAsAdminInput { - customer_email: String! + customer_email: String! @doc(description: "The email address of the customer requesting remote shopping assistance") } type GenerateCustomerTokenAsAdminOutput { - customer_token: String! + customer_token: String! @doc(description: "The generated customer token") } type Customer { - allow_remote_shopping_assistance: Boolean! + allow_remote_shopping_assistance: Boolean! @doc(description: "Indicates whether the customer has enabled remote shopping assistance") } input CustomerCreateInput { - allow_remote_shopping_assistance: Boolean + allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance") } input CustomerUpdateInput { - allow_remote_shopping_assistance: Boolean + allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance") } From b835c0d9d32fe913d8c1b3157ee91181bcc3b4fd Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Tue, 17 Nov 2020 23:28:03 -0600 Subject: [PATCH 185/490] MC-38340: GraphQL code changes for a consistent object uid - add test support for customizable attributes --- .../CustomizableOptionValue/Text.php | 9 +++++- ...dSimpleProductToCartSingleMutationTest.php | 31 ++++++++++++++++++- .../EditQuoteItemWithCustomOptionsTest.php | 5 ++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php index 63877ee4b97d8..47e616d6094b9 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Text.php @@ -20,6 +20,11 @@ */ class Text implements CustomizableOptionValueInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'custom-option'; + /** * @var PriceUnitLabel */ @@ -56,7 +61,9 @@ public function getData( $selectedOptionValueData = [ 'id' => $selectedOption->getId(), - 'customizable_option_value_uid' => $this->uidEncoder->encode((string) $selectedOption->getId()), + 'customizable_option_value_uid' => $this->uidEncoder->encode( + self::OPTION_TYPE . '/' . $option->getOptionId() + ), 'label' => '', 'value' => $optionTypeRenderer->getFormattedOptionValue($selectedOption->getValue()), 'price' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartSingleMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartSingleMutationTest.php index 4e50f6ff3a2ca..418258478d4d7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartSingleMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartSingleMutationTest.php @@ -81,10 +81,31 @@ public function testAddSimpleProductWithOptions() $customizableOptionsOutput = $response['addProductsToCart']['cart']['items'][0]['customizable_options']; - foreach ($customizableOptionsOutput as $customizableOptionOutput) { + foreach ($customizableOptionsOutput as $key => $customizableOptionOutput) { $customizableOptionOutputValues = []; foreach ($customizableOptionOutput['values'] as $customizableOptionOutputValue) { $customizableOptionOutputValues[] = $customizableOptionOutputValue['value']; + + $decodedOptionValue = base64_decode($customizableOptionOutputValue['customizable_option_value_uid']); + $decodedArray = explode('/', $decodedOptionValue); + if (count($decodedArray) === 2) { + self::assertEquals( + base64_encode('custom-option/' . $customizableOptionOutput['id']), + $customizableOptionOutputValue['customizable_option_value_uid'] + ); + } elseif (count($decodedArray) === 3) { + self::assertEquals( + base64_encode( + 'custom-option/' + . $customizableOptionOutput['id'] + . '/' + . $customizableOptionOutputValue['value'] + ), + $customizableOptionOutputValue['customizable_option_value_uid'] + ); + } else { + self::fail('customizable_option_value_uid '); + } } if (count($customizableOptionOutputValues) === 1) { $customizableOptionOutputValues = $customizableOptionOutputValues[0]; @@ -94,6 +115,11 @@ public function testAddSimpleProductWithOptions() $decodedItemOptions[$customizableOptionOutput['id']], $customizableOptionOutputValues ); + + self::assertEquals( + base64_encode((string) 'custom-option/' . $customizableOptionOutput['id']), + $customizableOptionOutput['customizable_option_uid'] + ); } } @@ -242,8 +268,11 @@ private function getAddToCartMutation( customizable_options { label id + customizable_option_uid values { value + customizable_option_value_uid + id } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php index d51e632035dfc..f31b396a18ba6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php @@ -188,13 +188,14 @@ public function testOptionSetPersistsOnExtraOptionWithIncorrectId() */ private function getQuery(string $maskedQuoteId, int $quoteItemId, $customizableOptionsQuery): string { + $base64EncodedItemId = base64_encode((string) $quoteItemId); return <<<QUERY mutation { updateCartItems(input: { cart_id:"$maskedQuoteId" cart_items: [ { - cart_item_id: $quoteItemId + cart_item_uid: "$base64EncodedItemId" quantity: 1 customizable_options: $customizableOptionsQuery } @@ -209,9 +210,11 @@ private function getQuery(string $maskedQuoteId, int $quoteItemId, $customizable ... on SimpleCartItem { customizable_options { label + customizable_option_uid values { label value + customizable_option_value_uid } } } From bde63767c48015991ca8ab3588cd2d52e3733374 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Wed, 18 Nov 2020 13:55:23 +0530 Subject: [PATCH 186/490] static tests changes - 18thNov2020 --- app/code/Magento/LoginAsCustomerGraphQl/composer.json | 1 + app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index bb9cc1d25d5d5..291d2746d47a6 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -5,6 +5,7 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-login-as-customer-api": "*", + "magento/module-integration": "*", "magento/module-store": "*", "magento/module-customer": "*", "magento/module-catalog-graph-ql": "*" diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index 1d0d92eb3cbbd..764e74872ab08 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_LoginAsCustomerGraphQl"> <sequence> + <module name="Magento_LoginAsCustomer"/> <module name="Magento_LoginAsCustomerApi"/> <module name="Magento_Customer"/> <module name="Magento_Store"/> From da7bb72de5b630bc42ee59313f2f2dc953f9ecdd Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 18 Nov 2020 11:41:11 +0200 Subject: [PATCH 187/490] fix review sorting via rewrite addOrder, fix tests --- .../Product/ReviewDataProviderTest.php | 6 +-- .../Product/ReviewDataProvider.php | 48 ++++++++++--------- .../Product/ReviewDataProviderTest.php | 18 +++---- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php index 62766dc966a32..bdbf5fe75a498 100644 --- a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php +++ b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/ReviewDataProviderTest.php @@ -81,10 +81,10 @@ public function testGetData() $this->collectionMock->expects($this->once()) ->method('addStoreData') ->willReturnSelf(); - $this->requestMock->expects($this->exactly(2)) + $this->requestMock->expects($this->once()) ->method('getParam') - ->withConsecutive(['current_product_id', 0], ['sorting']) - ->willReturnOnConsecutiveCalls(1, null); + ->with('current_product_id', 0) + ->willReturn(1); $this->assertSame($expected, $this->model->getData()); } diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index c41bee58863db..afedf98b50d90 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -7,9 +7,9 @@ use Magento\Framework\Api\Filter; use Magento\Framework\App\RequestInterface; -use Magento\Ui\DataProvider\AbstractDataProvider; -use Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory; use Magento\Review\Model\ResourceModel\Review\Product\Collection; +use Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory; +use Magento\Ui\DataProvider\AbstractDataProvider; /** * DataProvider for product reviews @@ -66,8 +66,6 @@ public function getData() $this->getCollection()->addEntityFilter($this->request->getParam('current_product_id', 0)) ->addStoreData(); - $this->applySorting(); - $arrItems = [ 'totalRecords' => $this->getCollection()->getSize(), 'items' => [], @@ -81,17 +79,32 @@ public function getData() } /** - * Apply sorting if it set + * Returns prepared field name * - * @return void + * @param string $name + * @return string */ - private function applySorting(): void + private function getPreparedField(string $name): string { - $sorting = $this->request->getParam('sorting'); - if (is_array($sorting)) { - $select = $this->getCollection()->getSelect(); - $select->order($sorting['field'] . ' ' . $sorting['direction']); + $preparedName = ''; + + if (in_array($name, ['review_id', 'created_at', 'status_id'])) { + $preparedName = 'rt.' . $name; + } elseif (in_array($name, ['title', 'nickname', 'detail'])) { + $preparedName = 'rdt.' . $name; + } elseif ($name === 'review_created_at') { + $preparedName = 'rt.created_at'; } + + return $preparedName ?: $name; + } + + /** + * @inheritDoc + */ + public function addOrder($field, $direction): void + { + $this->getCollection()->setOrder($this->getPreparedField($field), $direction); } /** @@ -102,18 +115,7 @@ private function applySorting(): void public function addFilter(Filter $filter): void { $field = $filter->getField(); - - if (in_array($field, ['review_id', 'created_at', 'status_id'])) { - $filter->setField('rt.' . $field); - } - - if (in_array($field, ['title', 'nickname', 'detail'])) { - $filter->setField('rdt.' . $field); - } - - if ($field === 'review_created_at') { - $filter->setField('rt.created_at'); - } + $filter->setField($this->getPreparedField($field)); parent::addFilter($filter); } diff --git a/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php index f23a0261fe629..a5147ee7d004e 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php @@ -46,21 +46,21 @@ protected function setUp(): void * @magentoDataFixture Magento/Review/_files/different_reviews.php * @dataProvider sortingDataProvider * - * @param array $sorting + * @param string $field + * @param string $direction * @param array $expectedSortedTitles * @return void */ - public function testSorting(array $sorting, array $expectedSortedTitles): void + public function testSorting(string $field, string $direction, array $expectedSortedTitles): void { $request = $this->objectManager->create(RequestInterface::class); - $request->setParam('sorting', $sorting); $request->setParam('current_product_id', 1); $dataProvider = $this->objectManager->create( ReviewDataProvider::class, array_merge($this->modelParams, ['request' => $request]) ); - + $dataProvider->addOrder($field, $direction); $result = $dataProvider->getData(); $this->assertEquals($this->getItemsField($result, 'title'), $expectedSortedTitles); @@ -91,12 +91,14 @@ private function getItemsField(array $arrItems, string $field): array public function sortingDataProvider(): array { return [ - [ - ['field' => 'title', 'direction' => 'asc'], + 'sort by title field ascending' => [ + 'title', + 'asc', ['1 filter second review', '2 filter first review', 'Review Summary'], ], - [ - ['field' => 'title', 'direction' => 'desc'], + 'sort by title field descending' => [ + 'title', + 'desc', ['Review Summary', '2 filter first review', '1 filter second review'], ], ]; From 36cd8b70d4076c8d740f156fdcf7eb001faeeb98 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Wed, 18 Nov 2020 15:22:04 +0530 Subject: [PATCH 188/490] static tests changes --- app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml index 764e74872ab08..1d0d92eb3cbbd 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/module.xml @@ -8,7 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_LoginAsCustomerGraphQl"> <sequence> - <module name="Magento_LoginAsCustomer"/> <module name="Magento_LoginAsCustomerApi"/> <module name="Magento_Customer"/> <module name="Magento_Store"/> From 379027f80007472cee9419684871ac157ff9c8db Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 18 Nov 2020 11:54:10 +0200 Subject: [PATCH 189/490] added test for filter review dataProvider --- .../Product/ReviewDataProviderTest.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php index a5147ee7d004e..5cd594a37d0e0 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Ui/DataProvider/Product/ReviewDataProviderTest.php @@ -12,6 +12,7 @@ use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; +use Magento\Framework\Api\Filter; /** * Test for \Magento\Review\Ui\DataProvider\Product\ReviewDataProvider. @@ -103,4 +104,35 @@ public function sortingDataProvider(): array ], ]; } + + /** + * Filter dataProvider test + * + * @magentoDataFixture Magento/Review/_files/different_reviews.php + * + * @return void + */ + public function testFilter(): void + { + $searchTitle = '2 filter first review'; + + $request = $this->objectManager->create(RequestInterface::class); + $request->setParam('current_product_id', 1); + + /** @var ReviewDataProvider $dataProvider */ + $dataProvider = $this->objectManager->create( + ReviewDataProvider::class, + array_merge($this->modelParams, ['request' => $request]) + ); + + /** @var Filter $filter */ + $filter = $this->objectManager->create(Filter::class); + $filter->setField('title') + ->setValue($searchTitle); + + $dataProvider->addFilter($filter); + $result = $dataProvider->getData(); + + $this->assertEquals($this->getItemsField($result, 'title'), [$searchTitle]); + } } From 4240a6b0e1f92b6f3b90acfa4ccf684f13405430 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 18 Nov 2020 12:38:05 +0200 Subject: [PATCH 190/490] change fix --- .../Model/Product/Type/Grouped.php | 9 +------ .../Model/Quote/Item/CartItemProcessor.php | 26 +++++++++---------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 769e3afc1158f..b56e8657df722 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -393,9 +393,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p if (is_string($_result)) { return $_result; - } - - if (!isset($_result[0])) { + } elseif (!isset($_result[0])) { return __('Cannot process the item.')->render(); } @@ -413,11 +411,6 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p ] ) ); - if ($buyRequest->getSuperGroup()) { - $serializedValue = $this->serializer->serialize($buyRequest->getSuperGroup()); - $_result[0]->addCustomOption('grouped_options', $serializedValue); - } - $products[] = $_result[0]; } else { $associatedProductsInfo[] = [$subProduct->getId() => $qty]; diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 924630d6987ed..574805c5c12c8 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -49,6 +49,11 @@ class CartItemProcessor implements CartItemProcessorInterface */ private $productOptionFactory; + /** + * @var array|null + */ + private $groupedOptions; + /** * @param ObjectFactory $objectFactory * @param GroupedOptionsInterfaceFactory $groupedOptionFactory @@ -84,6 +89,7 @@ public function convertToBuyRequest(CartItemInterface $cartItem): ?DataObject if ($extensionAttributes) { $groupedOptions = $extensionAttributes->getGroupedOptions(); if ($groupedOptions) { + $this->groupedOptions = $groupedOptions; $requestData = []; foreach ($groupedOptions as $item) { @@ -105,24 +111,16 @@ public function convertToBuyRequest(CartItemInterface $cartItem): ?DataObject */ public function processOptions(CartItemInterface $cartItem): CartItemInterface { - if ($cartItem->getProductType() !== Grouped::TYPE_CODE) { + if (empty($this->groupedOptions) || $cartItem->getProductType() !== Grouped::TYPE_CODE) { return $cartItem; } - $groupedOptions = $cartItem->getOptionByCode('grouped_options'); - $groupedOptionsData = $groupedOptions ? $this->jsonSerializer->unserialize($groupedOptions->getValue()) : null; - if ($groupedOptionsData) { - $productOptions = []; - foreach ($groupedOptionsData as $id => $qty) { - $productOptions[] = $this->groupedOptionFactory->create(['id' => $id, 'qty' => $qty]); - } - - $extension = $this->productOptionExtensionFactory->create()->setGroupedOptions($productOptions); - if (!$cartItem->getProductOption()) { - $cartItem->setProductOption($this->productOptionFactory->create()); - } - $cartItem->getProductOption()->setExtensionAttributes($extension); + $extension = $this->productOptionExtensionFactory->create() + ->setGroupedOptions($this->groupedOptions); + if (!$cartItem->getProductOption()) { + $cartItem->setProductOption($this->productOptionFactory->create()); } + $cartItem->getProductOption()->setExtensionAttributes($extension); return $cartItem; } From 5aac129b18a8d53fb5a4907029d4fc8fb1ce54f5 Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Wed, 18 Nov 2020 09:03:06 -0600 Subject: [PATCH 191/490] MC-38787: Admin Product Grid Page indicator issue --- app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 534d292809ed1..761fcb6864fe1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -36,7 +36,8 @@ define([ imports: { totalSelected: '${ $.selectProvider }:totalSelected', totalRecords: '${ $.provider }:data.totalRecords', - filters: '${ $.provider }:params.filters' + filters: '${ $.provider }:params.filters', + search: '${ $.provider }:params.search' }, exports: { @@ -58,7 +59,8 @@ define([ 'pages': 'onPagesChange', 'pageSize': 'onPageSizeChange', 'totalRecords': 'updateCounter', - '${ $.provider }:params.filters': 'goFirst' + '${ $.provider }:params.filters': 'goFirst', + 'search': 'goFirst' }, modules: { From e90810a0012a4a1ad6bd6de27f5ffa9a46776bc2 Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Wed, 18 Nov 2020 12:02:07 -0600 Subject: [PATCH 192/490] compare-products - Fixed errors on creating comparelist and adding products. --- .../CompareListGraphQl/Model/Service/AddToCompareList.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php index 1a0aace67b6c5..6f976bdd07d4d 100644 --- a/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php +++ b/app/code/Magento/CompareListGraphQl/Model/Service/AddToCompareList.php @@ -62,6 +62,10 @@ public function execute(int $listId, array $products, ContextInterface $context) { $storeId = (int)$context->getExtensionAttributes()->getStore()->getStoreId(); $customerId = $context->getUserId(); + if ($customerId) { + $this->itemCollection->setListIdToCustomerCompareItems($listId, $customerId); + } + if (count($products)) { $existedProducts = $this->itemCollection->getProductsByListId($listId); foreach ($products as $productId) { @@ -80,10 +84,6 @@ public function execute(int $listId, array $products, ContextInterface $context) } } - if ($customerId) { - $this->itemCollection->setListIdToCustomerCompareItems($listId, $customerId); - } - return (int)$listId; } From 54788a81bbe47a963d68d4de0e2ed3732d5fda51 Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Wed, 18 Nov 2020 13:27:16 -0600 Subject: [PATCH 193/490] ISSUE-30286 - Change layout update removal button rendering from a block to directly in the template to prevent inaccurate js element selection in SecureHtmlRenderer event listener generation. --- .../Widget/Instance/Edit/Tab/Main/Layout.php | 19 ------------------- .../templates/instance/edit/layout.phtml | 3 ++- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index c48bf9e7e4c7a..a704a5676f632 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -315,25 +315,6 @@ public function getAddLayoutButtonHtml() return $button->toHtml(); } - /** - * Retrieve remove layout button html - * - * @return string - */ - public function getRemoveLayoutButtonHtml() - { - $button = $this->getLayout()->createBlock( - \Magento\Backend\Block\Widget\Button::class - )->setData( - [ - 'label' => $this->escapeHtmlAttr(__('Remove Layout Update')), - 'onclick' => 'WidgetInstance.removePageGroup(this)', - 'class' => 'action-delete', - ] - ); - return $button->toHtml(); - } - /** * Prepare and retrieve page groups data of widget instance * diff --git a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml index 93c5cac33f947..2d4f88709fd91 100644 --- a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml @@ -38,7 +38,8 @@ var pageGroupTemplate = '<div class="fieldset-wrapper page_group_container" id=" '<label for="widget_instance[<%- data.id %>][page_group]">Display on <span class="required">*</span></label>'+ '{$block->getDisplayOnSelectHtml()}'+ '<div class="actions">'+ - {$jsonHelper->jsonEncode($block->getRemoveLayoutButtonHtml())} + + '<button title="{$escaper->escapeHtmlAttr(__('Remove Layout Update'))}" type="button"'+ + ' class="action-default scalable action-delete" onclick="WidgetInstance.removePageGroup(this)" />'+ '</div>'+ '</div>'+ '<div class="fieldset-wrapper-content">'+ From 174d8b5eaf74ba71c9b043b0c616b592bd1accfc Mon Sep 17 00:00:00 2001 From: Max Lesechko <mlesechko@magento.com> Date: Wed, 18 Nov 2020 13:31:50 -0600 Subject: [PATCH 194/490] MC-38775: Send attributes into Launch Extension for Gainsight --- .../Test/AdminCheckAnalyticsTrackingTest.xml | 20 +++++++++---------- app/code/Magento/AdminAnalytics/composer.json | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml index 9b135a0bcfb96..2ac03bc3da675 100644 --- a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml +++ b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml @@ -33,43 +33,43 @@ <seeInPageSource html="var adminAnalyticsMetadata =" stepKey="seeInPageSource"/> <grabPageSource stepKey="pageSource"/> <assertRegExp message="adminAnalyticsMetadata object is invalid" stepKey="validateadminAnalyticsMetadata"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*("[\w_]+":\s+".+?"\s+)};#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?("[\w_]+":\s+"[^"]*?"\s+)};#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect user ID" stepKey="validateUserId"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"user":\s+"[\w\d]{64}"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"user":\s+"[\w\d]{64}"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect secure base URL" stepKey="validateSecureBaseURL"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"secure_base_url":\s+"http(s)?\\\\u003A\\\\u002F\\\\u002F.+?\\\\u002F"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"secure_base_url":\s+"http(s)?\\\\u003A\\\\u002F\\\\u002F.+?\\\\u002F"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect product version" stepKey="validateProductVersion"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"version":\s+"[^\s]+"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"version":\s+"[^\s]+"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect product edition" stepKey="validateProductEdition"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"product_edition":\s+"(Community|Enterprise|B2B)"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"product_edition":\s+"(Community|Enterprise|B2B)"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect application mode" stepKey="validateApplicationMode"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"mode":\s+"default|developer|production"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"mode":\s+"default|developer|production"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect store name" stepKey="validateStoreName"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"store_name_default":\s+".*?"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"store_name_default":\s+".*?"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user created date" stepKey="validateAdminUserCreatedDate"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"admin_user_created":\s+".+?"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"admin_user_created":\s+".+?"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user log date" stepKey="validateAdminUserLogDate"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+?",\s+)*"admin_user_logdate":\s+".+?"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"admin_user_logdate":\s+".+?"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> <assertRegExp message="adminAnalyticsMetadata object contains incorrect admin user role name" stepKey="validateAdminUserRoleName"> - <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+".+",\s+)*"admin_user_role_name":\s+".+?"#m</expectedResult> + <expectedResult type="string">#var\s+adminAnalyticsMetadata\s+=\s+{\s+("[\w_]+":\s+"[^"]*?",\s+)*?"admin_user_role_name":\s+".+?"#s</expectedResult> <actualResult type="variable">$pageSource</actualResult> </assertRegExp> </test> diff --git a/app/code/Magento/AdminAnalytics/composer.json b/app/code/Magento/AdminAnalytics/composer.json index cf60b1d88ae55..f97d33c26f35f 100644 --- a/app/code/Magento/AdminAnalytics/composer.json +++ b/app/code/Magento/AdminAnalytics/composer.json @@ -9,6 +9,7 @@ "magento/framework": "*", "magento/module-backend": "*", "magento/module-config": "*", + "magento/module-store": "*", "magento/module-ui": "*", "magento/module-release-notification": "*" }, From 6b0b463ab46ca785e69802d0b27799a14077b13b Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Wed, 18 Nov 2020 13:44:43 -0600 Subject: [PATCH 195/490] PWA-1107: GraphQL returns null for empty Category URL Suffix value --- .../Model/Resolver/CategoryUrlSuffix.php | 2 +- .../Model/Resolver/ProductUrlSuffix.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php index 59708d90c23b7..684dc0fa716b1 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php @@ -77,6 +77,6 @@ private function getCategoryUrlSuffix(int $storeId): string $storeId ); } - return $this->categoryUrlSuffix[$storeId]; + return (string) $this->categoryUrlSuffix[$storeId]; } } diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php index 9a0193ba36367..71993b4bb9137 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php @@ -77,6 +77,6 @@ private function getProductUrlSuffix(int $storeId): string $storeId ); } - return $this->productUrlSuffix[$storeId]; + return (string) $this->productUrlSuffix[$storeId]; } } From 9d6eb3c3167df12f56bd791c2429ed04eba6f9b4 Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Wed, 18 Nov 2020 14:15:29 -0600 Subject: [PATCH 196/490] MC-38787: Admin Product Grid Page indicator issue --- app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 761fcb6864fe1..0f5a9289b71ff 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -186,7 +186,7 @@ define([ * @returns {Paging} Chainable. */ goFirst: function () { - if (!_.isUndefined(this.filters)) { + if (!_.isUndefined(this.filters) || !_.isEmpty(this.search)) { this.current = 1; } From d5b5a34b9b77a3f216a7af898fdf3d31e8e81140 Mon Sep 17 00:00:00 2001 From: Max Lesechko <mlesechko@magento.com> Date: Wed, 18 Nov 2020 15:32:42 -0600 Subject: [PATCH 197/490] MC-38782: Modify Magento Admin CSP for Gainsight enablement --- .../etc/adminhtml/csp_whitelist.xml | 39 +++++++++++++ .../Collector/CspWhitelistXml/Converter.php | 3 +- .../Csp/Model/Collector/FetchPolicyMerger.php | 6 +- .../Collector/PluginTypesPolicyMerger.php | 2 +- .../Magento/Csp/Model/Policy/FetchPolicy.php | 6 +- .../Csp/Model/Policy/PluginTypesPolicy.php | 2 +- .../CspWhitelistXmlCollectorTest.php | 58 +++++++++++++++++++ 7 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 app/code/Magento/AdminAnalytics/etc/adminhtml/csp_whitelist.xml diff --git a/app/code/Magento/AdminAnalytics/etc/adminhtml/csp_whitelist.xml b/app/code/Magento/AdminAnalytics/etc/adminhtml/csp_whitelist.xml new file mode 100644 index 0000000000000..adc65acd3b040 --- /dev/null +++ b/app/code/Magento/AdminAnalytics/etc/adminhtml/csp_whitelist.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd"> + <policies> + <policy id="script-src"> + <values> + <value id="aptrinsic" type="host">*.aptrinsic.com</value> + </values> + </policy> + <policy id="style-src"> + <values> + <value id="aptrinsic" type="host">*.aptrinsic.com</value> + <value id="fonts_googleapis" type="host">fonts.googleapis.com</value> + </values> + </policy> + <policy id="img-src"> + <values> + <value id="aptrinsic" type="host">*.aptrinsic.com</value> + <value id="storage_googleapis" type="host">storage.googleapis.com</value> + </values> + </policy> + <policy id="connect-src"> + <values> + <value id="aptrinsic" type="host">*.aptrinsic.com</value> + </values> + </policy> + <policy id="font-src"> + <values> + <value id="fonts_gstatic" type="host">fonts.gstatic.com</value> + </values> + </policy> + </policies> +</csp_whitelist> diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php index e0b3af9f9ed81..37590ab364832 100644 --- a/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php @@ -36,13 +36,12 @@ public function convert($source) /** @var \DOMElement $value */ foreach ($policy->getElementsByTagName('value') as $value) { if ($value->attributes->getNamedItem('type')->nodeValue === 'host') { - $policyConfig[$id]['hosts'][] = $value->nodeValue; + $policyConfig[$id]['hosts'][$value->attributes->getNamedItem('id')->nodeValue] = $value->nodeValue; } else { $policyConfig[$id]['hashes'][$value->nodeValue] = $value->attributes->getNamedItem('algorithm')->nodeValue; } } - $policyConfig[$id]['hosts'] = array_unique($policyConfig[$id]['hosts']); } return $policyConfig; diff --git a/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php index 2a8f6c278b078..827e1aee6d0b9 100644 --- a/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php +++ b/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php @@ -25,12 +25,12 @@ public function merge(PolicyInterface $policy1, PolicyInterface $policy2): Polic return new FetchPolicy( $policy1->getId(), $policy1->isNoneAllowed() || $policy2->isNoneAllowed(), - array_unique(array_merge($policy1->getHostSources(), $policy2->getHostSources())), - array_unique(array_merge($policy1->getSchemeSources(), $policy2->getSchemeSources())), + array_merge($policy1->getHostSources(), $policy2->getHostSources()), + array_merge($policy1->getSchemeSources(), $policy2->getSchemeSources()), $policy1->isSelfAllowed() || $policy2->isSelfAllowed(), $policy1->isInlineAllowed() || $policy2->isInlineAllowed(), $policy1->isEvalAllowed() || $policy2->isEvalAllowed(), - array_unique(array_merge($policy1->getNonceValues(), $policy2->getNonceValues())), + array_merge($policy1->getNonceValues(), $policy2->getNonceValues()), array_merge($policy1->getHashes(), $policy2->getHashes()), $policy1->isDynamicAllowed() || $policy2->isDynamicAllowed(), $policy1->areEventHandlersAllowed() || $policy2->areEventHandlersAllowed() diff --git a/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php index 58f2128657788..8e70d1f851479 100644 --- a/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php +++ b/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php @@ -22,7 +22,7 @@ public function merge(PolicyInterface $policy1, PolicyInterface $policy2): Polic { /** @var PluginTypesPolicy $policy1 */ /** @var PluginTypesPolicy $policy2 */ - return new PluginTypesPolicy(array_unique(array_merge($policy1->getTypes(), $policy2->getTypes()))); + return new PluginTypesPolicy(array_merge($policy1->getTypes(), $policy2->getTypes())); } /** diff --git a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php index d045ee48b0ba2..2ed69a070d73f 100644 --- a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php @@ -116,12 +116,12 @@ public function __construct( ) { $this->id = $id; $this->noneAllowed = $noneAllowed; - $this->hostSources = array_unique($hostSources); - $this->schemeSources = array_unique($schemeSources); + $this->hostSources = array_values(array_unique($hostSources)); + $this->schemeSources = array_values(array_unique($schemeSources)); $this->selfAllowed = $selfAllowed; $this->inlineAllowed = $inlineAllowed; $this->evalAllowed = $evalAllowed; - $this->nonceValues = array_unique($nonceValues); + $this->nonceValues = array_values(array_unique($nonceValues)); $this->hashes = $hashValues; $this->dynamicAllowed = $dynamicAllowed; $this->eventHandlersAllowed = $eventHandlersAllowed; diff --git a/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php b/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php index 4f34f49bfffe7..d30f4e5afef22 100644 --- a/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php @@ -25,7 +25,7 @@ public function __construct(array $types) if (!$types) { throw new \RuntimeException('PluginTypePolicy must be given at least 1 type.'); } - $this->types = array_unique($types); + $this->types = array_values(array_unique($types)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php index 67a15c24ea410..253eaea3f0686 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php @@ -71,4 +71,62 @@ public function testCollecting(): void $this->assertTrue($objectSrcChecked); $this->assertTrue($mediaSrcChecked); } + + /** + * Test collecting configurations from multiple XML files for adminhtml area. + * + * @magentoAppArea adminhtml + * @return void + */ + public function testCollectingForAdminhtmlArea(): void + { + $policies = $this->collector->collect([]); + + $mediaSrcChecked = false; + $objectSrcChecked = false; + $this->assertNotEmpty($policies); + /** @var FetchPolicy $policy */ + foreach ($policies as $policy) { + $this->assertFalse($policy->isNoneAllowed()); + $this->assertFalse($policy->isSelfAllowed()); + $this->assertFalse($policy->isInlineAllowed()); + $this->assertFalse($policy->isEvalAllowed()); + $this->assertFalse($policy->isDynamicAllowed()); + $this->assertEmpty($policy->getSchemeSources()); + $this->assertEmpty($policy->getNonceValues()); + if ($policy->getId() === 'object-src') { + $this->assertInstanceOf(FetchPolicy::class, $policy); + $this->assertEquals( + [ + 'https://admin.magento.com', + 'https://devdocs.magento.com', + 'example.magento.com' + ], + $policy->getHostSources() + ); + $this->assertEquals( + [ + 'B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256', + 'B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF9=' => 'sha256' + ], + $policy->getHashes() + ); + $objectSrcChecked = true; + } elseif ($policy->getId() === 'media-src') { + $this->assertInstanceOf(FetchPolicy::class, $policy); + $this->assertEquals( + [ + 'https://admin.magento.com', + 'https://devdocs.magento.com', + 'example.magento.com' + ], + $policy->getHostSources() + ); + $this->assertEmpty($policy->getHashes()); + $mediaSrcChecked = true; + } + } + $this->assertTrue($objectSrcChecked); + $this->assertTrue($mediaSrcChecked); + } } From 5b1867dd7be914e1fb229c5749195aa5c7378e96 Mon Sep 17 00:00:00 2001 From: Max Lesechko <mlesechko@magento.com> Date: Wed, 18 Nov 2020 15:42:01 -0600 Subject: [PATCH 198/490] MC-38782: Modify Magento Admin CSP for Gainsight enablement --- .../etc/adminhtml/csp_whitelist.xml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/adminhtml/csp_whitelist.xml diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/adminhtml/csp_whitelist.xml b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/adminhtml/csp_whitelist.xml new file mode 100644 index 0000000000000..53e8775761596 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/adminhtml/csp_whitelist.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd"> + <policies> + <policy id="object-src"> + <values> + <value id="example-base" type="host">example.magento.com</value> + <value id="mage-base" type="host">https://admin.magento.com</value> + </values> + </policy> + <policy id="media-src"> + <values> + <value id="example-base" type="host">example.magento.com</value> + <value id="mage-base" type="host">https://admin.magento.com</value> + </values> + </policy> + </policies> +</csp_whitelist> From e08fb2e0c72dc421a973765714ea583b40cf65aa Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 18 Nov 2020 15:47:50 -0600 Subject: [PATCH 199/490] MC-38340: GraphQL code changes for a consistent object uid - add test support for url resolver - remove customer uid --- .../Model/Customer/ExtractCustomerData.php | 14 ++------------ .../Magento/CustomerGraphQl/etc/schema.graphqls | 3 +-- .../Magento/UrlRewriteGraphQl/etc/schema.graphqls | 2 +- .../etc/schema.graphqls | 4 ++-- .../GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 3 +++ .../GraphQl/TestModule/GraphQlMutationTest.php | 8 ++++---- .../Magento/GraphQl/UrlRewrite/UrlResolverTest.php | 1 + 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php index 571e4aab4b51c..c62a931809644 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php @@ -8,9 +8,7 @@ namespace Magento\CustomerGraphQl\Model\Customer; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\Serialize\SerializerInterface; use Magento\Framework\Webapi\ServiceOutputProcessor; use Magento\Customer\Api\Data\CustomerInterface; @@ -30,23 +28,16 @@ class ExtractCustomerData */ private $serializer; - /** @var Uid */ - private $uidEncoder; - /** * @param ServiceOutputProcessor $serviceOutputProcessor - * @param SerializerInterface $serializer, - * @param Uid|null $uidEncoder + * @param SerializerInterface $serializer */ public function __construct( ServiceOutputProcessor $serviceOutputProcessor, - SerializerInterface $serializer, - Uid $uidEncoder = null + SerializerInterface $serializer ) { $this->serviceOutputProcessor = $serviceOutputProcessor; $this->serializer = $serializer; - $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() - ->get(Uid::class); } /** @@ -113,7 +104,6 @@ public function execute(CustomerInterface $customer): array //Fields are deprecated and should not be exposed on storefront. $customerData['group_id'] = null; $customerData['id'] = null; - $customerData['uid'] = $this->uidEncoder->encode((string) $customer->getId()); $customerData['model'] = $customer; diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index e13f94be0ffd6..5eed9a38a0350 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -131,8 +131,7 @@ type Customer @doc(description: "Customer defines the customer name and address dob: String @doc(description: "The customer's date of birth") @deprecated(reason: "Use `date_of_birth` instead") date_of_birth: String @doc(description: "The customer's date of birth") taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") - id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "Use `uid` instead.") - uid: ID! @doc(description: "Unique identifier for the Customer object") + id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") diff --git a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls index cb6279c9d71f9..11f5129a50736 100644 --- a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls @@ -6,7 +6,7 @@ type Query { } type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") { - id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") + id: Int @deprecated(reason: "Use `entity_uid` instead.") @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") entity_uid: ID @doc(description: "The unique identifier assigned to the object associated with the specified url. This could be a product UID, category UID, or cms page UID.") canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.") relative_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.") diff --git a/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQueryExtension/etc/schema.graphqls b/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQueryExtension/etc/schema.graphqls index b970ad8376349..acf1f20e3c006 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQueryExtension/etc/schema.graphqls +++ b/dev/tests/api-functional/_files/Magento/TestModuleGraphQlQueryExtension/etc/schema.graphqls @@ -1,10 +1,10 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type Item { +type TestItemOutput { integer_list: [Int] @resolver(class: "Magento\\TestModuleGraphQlQueryExtension\\Model\\Resolver\\IntegerList") } -type MutationItem { +type MutationItemOutput { integer_list: [Int] @resolver(class: "Magento\\TestModuleGraphQlQueryExtension\\Model\\Resolver\\IntegerList") } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index b12630d70713a..a6629b00c11c2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -363,6 +363,7 @@ public function testInvalidUrlResolverInput() urlResolver(url:"{$urlPath}") { id + entity_uid relative_url type redirectCode @@ -483,6 +484,7 @@ private function queryUrlAndAssertResponse( urlResolver(url:"{$urlKey}") { id + entity_uid relative_url type redirectCode @@ -492,6 +494,7 @@ private function queryUrlAndAssertResponse( $response = $this->graphQlQuery($query); $this->assertArrayHasKey('urlResolver', $response); $this->assertEquals($productId, $response['urlResolver']['id']); + $this->assertEquals(base64_encode($productId), $response['urlResolver']['entity_uid']); $this->assertEquals($relativePath, $response['urlResolver']['relative_url']); $this->assertEquals(strtoupper($expectedType), $response['urlResolver']['type']); $this->assertEquals($redirectCode, $response['urlResolver']['redirectCode']); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php index ab3fed044ea97..594863f319b2b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php @@ -21,8 +21,8 @@ public function testMutation() $query = <<<MUTATION mutation { testItem(id: {$id}) { - item_id, - name, + item_id + name integer_list } } @@ -47,8 +47,8 @@ public function testMutationIsNotAllowedViaGetRequest() $query = <<<MUTATION mutation { testItem(id: {$id}) { - item_id, - name, + item_id + name integer_list } } 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 12aa4444ef728..7aed048f1c4ce 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php @@ -37,6 +37,7 @@ public function testNonExistentEntityUrlRewrite() urlResolver(url:"{$urlPath}") { id + entity_uid relative_url type redirectCode From b76488fa64f5d8ef0fe4aefd0bae87c1506e418e Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Wed, 18 Nov 2020 16:29:08 -0600 Subject: [PATCH 200/490] PWA-1107: GraphQL returns null for empty Category URL Suffix value --- .../Model/Resolver/CategoryUrlSuffix.php | 8 ++++---- .../Model/Resolver/ProductUrlSuffix.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php index 684dc0fa716b1..9429a24199b47 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php @@ -55,7 +55,7 @@ public function resolve( ResolveInfo $info, array $value = null, array $args = null - ): string { + ): ?string { /** @var StoreInterface $store */ $store = $context->getExtensionAttributes()->getStore(); $storeId = (int)$store->getId(); @@ -66,9 +66,9 @@ public function resolve( * Retrieve category url suffix by store * * @param int $storeId - * @return string + * @return string|null */ - private function getCategoryUrlSuffix(int $storeId): string + private function getCategoryUrlSuffix(int $storeId): ?string { if (!isset($this->categoryUrlSuffix[$storeId])) { $this->categoryUrlSuffix[$storeId] = $this->scopeConfig->getValue( @@ -77,6 +77,6 @@ private function getCategoryUrlSuffix(int $storeId): string $storeId ); } - return (string) $this->categoryUrlSuffix[$storeId]; + return $this->categoryUrlSuffix[$storeId]; } } diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php index 71993b4bb9137..97795db73fcf8 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php @@ -55,7 +55,7 @@ public function resolve( ResolveInfo $info, array $value = null, array $args = null - ): string { + ): ?string { /** @var StoreInterface $store */ $store = $context->getExtensionAttributes()->getStore(); $storeId = (int)$store->getId(); @@ -66,9 +66,9 @@ public function resolve( * Retrieve product url suffix by store * * @param int $storeId - * @return string + * @return string|null */ - private function getProductUrlSuffix(int $storeId): string + private function getProductUrlSuffix(int $storeId): ?string { if (!isset($this->productUrlSuffix[$storeId])) { $this->productUrlSuffix[$storeId] = $this->scopeConfig->getValue( @@ -77,6 +77,6 @@ private function getProductUrlSuffix(int $storeId): string $storeId ); } - return (string) $this->productUrlSuffix[$storeId]; + return $this->productUrlSuffix[$storeId]; } } From f756a57f02788a2d25cd6e653c8ec3c27b826904 Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Wed, 18 Nov 2020 16:59:57 -0600 Subject: [PATCH 201/490] MC-38787: Admin Product Grid Page indicator issue --- app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 0f5a9289b71ff..761fcb6864fe1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -186,7 +186,7 @@ define([ * @returns {Paging} Chainable. */ goFirst: function () { - if (!_.isUndefined(this.filters) || !_.isEmpty(this.search)) { + if (!_.isUndefined(this.filters)) { this.current = 1; } From 5f94bd6f666bc91f921769191aa75595932d6741 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 18 Nov 2020 17:19:44 -0600 Subject: [PATCH 202/490] MCP-87: Category product and cataloginventory indexers improvements --- .../Indexer/Category/Product/AbstractAction.php | 2 +- .../Model/Indexer/Stock/Action/Full.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 38f606b8abefe..020c19578f75d 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -430,7 +430,7 @@ protected function prepareSelectsByRange( $field, $select, $range, - \Magento\Framework\DB\Query\BatchIteratorInterface::NON_UNIQUE_FIELD_ITERATOR + \Magento\Framework\DB\Query\BatchIteratorInterface::UNIQUE_FIELD_ITERATOR ); $queries = []; diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php index 43a5aabee9779..f85f3f3576279 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php @@ -149,13 +149,21 @@ public function execute($ids = null): void $select = $connection->select(); $select->distinct(true); - $select->from(['e' => $entityMetadata->getEntityTable()], $entityMetadata->getIdentifierField()); + $select->from( + [ + 'e' => $entityMetadata->getEntityTable() + ], + $entityMetadata->getIdentifierField() + )->where( + 'type_id = ?', + $indexer->getTypeId() + ); $batchQueries = $this->batchQueryGenerator->generate( $entityMetadata->getIdentifierField(), $select, $batchRowCount, - BatchIteratorInterface::NON_UNIQUE_FIELD_ITERATOR + BatchIteratorInterface::UNIQUE_FIELD_ITERATOR ); foreach ($batchQueries as $query) { From 517f5a5055eef488daf6aeefd2829b2ee1013bcd Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Wed, 18 Nov 2020 17:30:36 -0600 Subject: [PATCH 203/490] MCP-85: Optimize order creation scenario [admin area] --- .../Product/ProductCollection.php | 54 +++++++++++++++++++ app/code/Magento/Sales/etc/adminhtml/di.xml | 5 ++ 2 files changed, 59 insertions(+) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php index f4334bc25efd8..298595b3d0f62 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php @@ -25,4 +25,58 @@ protected function _productLimitationJoinPrice() $this->_productLimitationFilters->setUsePriceIndex(false); return $this->_productLimitationPrice(true); } + + /** + * Return approximately amount if too much entities. + * + * @return int|mixed + */ + public function getSize() + { + $sql = $this->getSelectCountSql(); + $possibleCount = $this->analyzeCount($sql); + + if ($possibleCount > 20000) { + return $possibleCount; + } + + return parent::getSize(); + } + + /** + * Analyze amount of entities in DB. + * + * @param $sql + * @return int|mixed + * @throws \Zend_Db_Statement_Exception + */ + private function analyzeCount($sql) + { + $results = $this->getConnection()->query('EXPLAIN ' . $sql)->fetchAll(); + $alias = $this->getMainTableAlias(); + + foreach ($results as $result) { + if ($result['table'] == $alias) { + return $result['rows']; + } + } + + return 0; + } + + /** + * Identify main table alias or its name if alias is not defined. + * + * @return string + * @throws \LogicException + */ + private function getMainTableAlias() + { + foreach ($this->getSelect()->getPart(\Magento\Framework\DB\Select::FROM) as $tableAlias => $tableMetadata) { + if ($tableMetadata['joinType'] == 'from') { + return $tableAlias; + } + } + throw new \LogicException("Main table cannot be identified."); + } } diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index 35ef510d277bf..e221467dbcf90 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -48,4 +48,9 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection"> + <arguments> + <argument name="collectionFactory" xsi:type="object">\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory</argument> + </arguments> + </type> </config> From a283e2ca3aad5650a72e19206c4fc6a1fc93ad58 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 18 Nov 2020 20:00:24 -0600 Subject: [PATCH 204/490] MC-38340: GraphQL code changes for a consistent object uid - fix url resolver test --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index a6629b00c11c2..bef9f228d44d8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -494,7 +494,7 @@ private function queryUrlAndAssertResponse( $response = $this->graphQlQuery($query); $this->assertArrayHasKey('urlResolver', $response); $this->assertEquals($productId, $response['urlResolver']['id']); - $this->assertEquals(base64_encode($productId), $response['urlResolver']['entity_uid']); + $this->assertEquals(base64_encode((string)$productId), $response['urlResolver']['entity_uid']); $this->assertEquals($relativePath, $response['urlResolver']['relative_url']); $this->assertEquals(strtoupper($expectedType), $response['urlResolver']['type']); $this->assertEquals($redirectCode, $response['urlResolver']['redirectCode']); From 8aadac8f5cd47d23721b3e86efa3d8603bf6e7a3 Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Wed, 18 Nov 2020 21:25:35 -0600 Subject: [PATCH 205/490] MC-37399: Product Compare :: Atwix PR review and delivery - add test coverage --- .../GraphQl/CompareList/CompareListTest.php | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php index 3f522199974cd..645012030f439 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CompareList/CompareListTest.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQl\ResponseContainsErrorsException; use Magento\TestFramework\TestCase\GraphQlAbstract; /** @@ -83,11 +84,30 @@ public function testAddProductToCompareList() { $compareList = $this->createCompareList(); $uid = $compareList['createCompareList']['uid']; + $this->assertEquals(0, $compareList['createCompareList']['item_count'],'Incorrect count'); $this->uidAssertion($uid); $response = $this->addProductsToCompareList($uid); $resultUid = $response['addProductsToCompareList']['uid']; $this->uidAssertion($resultUid); $this->itemsAssertion($response['addProductsToCompareList']['items']); + $this->assertEquals(2, $response['addProductsToCompareList']['item_count'],'Incorrect count'); + $this->assertResponseFields( + $response['addProductsToCompareList']['attributes'], + [ + [ + 'code'=> 'sku', + 'label'=> 'SKU' + ], + [ + 'code'=> 'description', + 'label'=> 'Description' + ], + [ + 'code'=> 'short_description', + 'label'=> 'Short Description' + ] + ] + ); } /** @@ -246,6 +266,61 @@ public function testAssignCompareListToCustomer() $this->itemsAssertion($customerAssignedResponse['customer']['compare_list']['items']); } + /** + * Assign compare list of one customer to another customer + * + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoApiDataFixture Magento/Customer/_files/two_customers.php + */ + public function testCompareListsNotAccessibleBetweenCustomers() + { + $uidCustomer1 = $this->createCompareListForCustomer('customer@example.com', 'password'); + $uidcustomer2 = $this->createCompareListForCustomer('customer_two@example.com', 'password'); + $assignCompareListToCustomer = <<<MUTATION +mutation { + assignCompareListToCustomer(uid: "{$uidCustomer1}"){ + result + compare_list { + uid + items { + uid + } + } + } +} +MUTATION; + + $expectedExceptionsMessage = 'GraphQL response contains errors: This customer is not authorized to access this list'; + $this->expectException(ResponseContainsErrorsException::class); + $this->expectExceptionMessage($expectedExceptionsMessage); + //customer2 not allowed to assign compareList belonging to customer1 + $this->graphQlMutation( + $assignCompareListToCustomer, + [], + '', + $this->getCustomerAuthHeaders('customer_two@example.com', 'password') + ); + + $deleteCompareList = <<<MUTATION +mutation{ + deleteCompareList(uid:"{$uidcustomer2}") { + result + } +} +MUTATION; + $expectedExceptionsMessage = 'GraphQL response contains errors: This customer is not authorized to access this list'; + $this->expectException(ResponseContainsErrorsException::class); + $this->expectExceptionMessage($expectedExceptionsMessage); + //customer1 not allowed to delete compareList belonging to customer2 + $this->graphQlMutation( + $assignCompareListToCustomer, + [], + '', + $this->getCustomerAuthHeaders('customer@example.com', 'password') + ); + + } + /** * Get customer Header * @@ -271,12 +346,33 @@ private function createCompareList(): array mutation{ createCompareList { uid + item_count + attributes{code label} } } MUTATION; return $this->graphQlMutation($mutation); } + private function createCompareListForCustomer(string $username, string $password): string + { + $compareListCustomer = <<<MUTATION +mutation{ + createCompareList { + uid + } +} +MUTATION; + $response = $this->graphQlMutation( + $compareListCustomer, + [], + '', + $this->getCustomerAuthHeaders($username, $password) + ); + + return $response['createCompareList']['uid']; + } + /** * Add products to compare list * @@ -292,6 +388,8 @@ private function addProductsToCompareList($uid): array mutation{ addProductsToCompareList(input: { uid: "{$uid}", products: [{$product1->getId()}, {$product2->getId()}]}) { uid + item_count + attributes{code label} items { product { sku From 89cc0d98220adcf7bfede3aa6496be179de2e703 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Thu, 19 Nov 2020 13:30:21 +0530 Subject: [PATCH 206/490] static tests changes --- app/code/Magento/LoginAsCustomerGraphQl/composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index 291d2746d47a6..e18b763fbe5de 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -10,6 +10,9 @@ "magento/module-customer": "*", "magento/module-catalog-graph-ql": "*" }, + "suggest": { + "magento/module-login-as-customer": "*" + }, "type": "magento2-module", "license": [ "OSL-3.0", From 2fbfb1fc1e99da956a1ac579e63eb1af1adce90e Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Thu, 19 Nov 2020 10:07:47 +0200 Subject: [PATCH 207/490] added "changelog" to whitelist --- .../static/testsuite/Magento/Test/Legacy/_files/words_ce.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml index 92e7b15efed29..ccad52fae453e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml @@ -73,5 +73,9 @@ <path>app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less</path> <word>rma</word> </item> + <item> + <path>app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php</path> + <word>changelog</word> + </item> </whitelist> </config> From 1c50d724dba54900cd95d088b5787b67faa2caa9 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Thu, 19 Nov 2020 15:12:44 +0530 Subject: [PATCH 208/490] static tests changes --- app/code/Magento/LoginAsCustomerGraphQl/composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index e18b763fbe5de..e96f22a3ac649 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -7,8 +7,7 @@ "magento/module-login-as-customer-api": "*", "magento/module-integration": "*", "magento/module-store": "*", - "magento/module-customer": "*", - "magento/module-catalog-graph-ql": "*" + "magento/module-customer": "*" }, "suggest": { "magento/module-login-as-customer": "*" From 17afad594c06cdbbf1ec9c6e8cf072775956426c Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Thu, 19 Nov 2020 12:04:47 +0200 Subject: [PATCH 209/490] MC-37502: Create automated test for "Move Order to Archive" --- ...order_with_invoice_shipment_creditmemo.php | 143 ++++++++++++++++++ ...h_invoice_shipment_creditmemo_rollback.php | 43 ++++++ 2 files changed, 186 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php new file mode 100644 index 0000000000000..4a2c28b3d0fd3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -0,0 +1,143 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\DB\Transaction; +use Magento\Sales\Api\CreditmemoItemRepositoryInterface; +use Magento\Sales\Api\CreditmemoRepositoryInterface; +use Magento\Sales\Api\Data\CreditmemoItemInterfaceFactory; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\Data\OrderPaymentInterfaceFactory; +use Magento\Sales\Api\InvoiceManagementInterface; +use Magento\Sales\Api\Data\OrderItemInterfaceFactory; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Address; +use Magento\Sales\Model\Order\AddressFactory; +use Magento\Sales\Api\Data\OrderAddressInterfaceFactory; +use Magento\Sales\Model\Order\Creditmemo; +use Magento\Sales\Model\Order\CreditmemoFactory; +use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/default_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +/** @var CreditmemoItemInterfaceFactory $creditmemoItemFactory */ +$creditmemoItemFactory = $objectManager->get(CreditmemoItemInterfaceFactory::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var CreditmemoItemRepositoryInterface $creditmemoItemRepository */ +$creditmemoItemRepository = $objectManager->get(CreditmemoItemRepositoryInterface::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US' +]; +$product = $productRepository->get('simple'); +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod('checkmo') + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100000001') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +$creditmemo = $creditmemoFactory->createByOrder($order, $order->getData()); +$creditmemo->setOrder($order); +$creditmemo->setState(Creditmemo::STATE_OPEN); +$creditmemo->setIncrementId($order->getIncrementId()); +$creditmemoRepository->save($creditmemo); + +$orderItem->setName('Test item') + ->setQtyRefunded(2) + ->setQtyInvoiced(2) + ->setOriginalPrice($product->getPrice()); +$creditItem = $creditmemoItemFactory->create(); +$creditItem->setCreditmemo($creditmemo) + ->setName('Creditmemo item') + ->setOrderItemId($orderItem->getId()) + ->setQty(2) + ->setPrice($product->getPrice()); +$creditmemoItemRepository->save($creditItem); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php new file mode 100644 index 0000000000000..56670ecc2a470 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Registry; +use Magento\Sales\Api\CreditmemoRepositoryInterface; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\InvoiceRepositoryInterface; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Api\ShipmentRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From 6d56b4d3609243147be73a89bdf3e74ccfede7fb Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Thu, 19 Nov 2020 13:19:33 +0200 Subject: [PATCH 210/490] MC-37500: Create automated test for "Shipment Sales Archive" --- .../Section/AdminShipmentsGridFiltersSection.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml diff --git a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml b/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml new file mode 100644 index 0000000000000..6e5b197286bf3 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.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="AdminShipmentsGridFiltersSection"> + <element name="orderNum" type="input" selector="input[name='order_increment_id']"/> + </section> +</sections> From e6357812c2dc27d9c47dab42c422cf876a374b0a Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Thu, 19 Nov 2020 14:59:51 +0200 Subject: [PATCH 211/490] MC-37502: Create automated test for "Move Order to Archive" --- .../Sales/_files/order_with_invoice_shipment_creditmemo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php index 4a2c28b3d0fd3..f84a8b65e13fd 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -9,6 +9,7 @@ use Magento\Customer\Api\Data\AddressInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\DB\Transaction; +use Magento\OfflinePayments\Model\Checkmo; use Magento\Sales\Api\CreditmemoItemRepositoryInterface; use Magento\Sales\Api\CreditmemoRepositoryInterface; use Magento\Sales\Api\Data\CreditmemoItemInterfaceFactory; @@ -60,9 +61,10 @@ AddressInterface::CITY => 'Los Angeles', CustomerInterface::EMAIL => 'admin@example.com', AddressInterface::TELEPHONE => '11111111', - AddressInterface::COUNTRY_ID => 'US' + AddressInterface::COUNTRY_ID => 'US', ]; $product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ $addressFactory = $objectManager->get(AddressFactory::class); $billingAddress = $addressFactory->create(['data' => $addressData]); $billingAddress->setAddressType(Address::TYPE_BILLING); @@ -71,7 +73,7 @@ /** @var OrderPaymentInterfaceFactory $paymentFactory */ $paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); $payment = $paymentFactory->create(); -$payment->setMethod('checkmo') +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) ->setAdditionalInformation('last_trans_id', '11122') ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); /** @var OrderItemInterface $orderItem */ From 8cfc5393e16b818ef0ade5fc6a8c32b225bdbffd Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 19 Nov 2020 16:19:27 +0200 Subject: [PATCH 212/490] adding AdminFillAccountInformationOnCreateOrderPageActionGroup --- ...nformationOnCreateOrderPageActionGroup.xml | 19 +++++++++++++++++++ ...vailabilityCreditMemoWithNoPaymentTest.xml | 6 ++++-- ...reateOrderWithMinimumAmountEnabledTest.xml | 8 +++++--- ...ubmitsOrderPaymentMethodValidationTest.xml | 8 +++++--- ...minSubmitsOrderWithAndWithoutEmailTest.xml | 6 ++++-- ...rderWithAndWithoutFieldsValidationTest.xml | 6 ++++-- .../Test/AdminCheckingTaxReportGridTest.xml | 6 ++++-- 7 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml new file mode 100644 index 0000000000000..acf4ff8b43eca --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.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="AdminFillAccountInformationOnCreateOrderPageActionGroup"> + <arguments> + <argument name="group" defaultValue="{{GeneralCustomerGroup.code}}" type="string"/> + <argument name="email" type="string"/> + </arguments> + <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{group}}" stepKey="selectCustomerGroup"/> + <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{email}}" stepKey="fillCustomerEmail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 182549a6fe301..4379fc283510d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -61,8 +61,10 @@ <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index b5c9e9443d1f9..2d8b8e9b8fb46 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -45,9 +45,11 @@ </actionGroup> <!--Fill customer group information--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail"/> - + <comment userInput="Fill Account Information" stepKey="selectGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> + <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index bd6a21e3112ca..5956a1a619fab 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,9 +48,11 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> - + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> + <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 727aef99352ec..215c888833885 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -46,8 +46,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 2bedb16f3d1dc..48ce356a43174 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -45,8 +45,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill wrong customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml index 84278468a0590..61482d7f5a567 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml @@ -154,8 +154,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> From b2a767dcd923431b6f624b13c840556cb2d29196 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 19 Nov 2020 16:31:12 +0200 Subject: [PATCH 213/490] updating before/after attributes in AdminSubmitsOrderPaymentMethodValidationTest --- .../Test/AdminSubmitsOrderPaymentMethodValidationTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 5956a1a619fab..1e09f308018d2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,8 +48,8 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> - <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> From cb09209fd6fe5f18c7d9aff50c00ff2a338c1fef Mon Sep 17 00:00:00 2001 From: Oleh Posyniak <oposyniak@magento.com> Date: Thu, 19 Nov 2020 11:49:39 -0600 Subject: [PATCH 214/490] MC-39033: Rename AWS S3 module --- app/code/Magento/AwsS3/composer.json | 2 +- .../Driver/Cache/CacheFactory.php | 25 +++++++++++++++++++ app/code/Magento/RemoteStorage/etc/di.xml | 6 +++++ composer.json | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/AwsS3/composer.json b/app/code/Magento/AwsS3/composer.json index 6e72ac37f8ba6..77ed75862d192 100644 --- a/app/code/Magento/AwsS3/composer.json +++ b/app/code/Magento/AwsS3/composer.json @@ -1,5 +1,5 @@ { - "name": "magento/module-aws-s-3", + "name": "magento/module-aws-s3", "description": "N/A", "config": { "sort-packages": true diff --git a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php b/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php index 394b36f6871de..703393b69ec6a 100644 --- a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php +++ b/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php @@ -7,10 +7,15 @@ namespace Magento\RemoteStorage\Driver\Cache; +use League\Flysystem\Adapter\Local; use League\Flysystem\Cached\CacheInterface; use League\Flysystem\Cached\Storage\Memory; use League\Flysystem\Cached\Storage\Predis; +use League\Flysystem\Cached\Storage\Adapter; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; use Magento\RemoteStorage\Driver\DriverException; +use Magento\RemoteStorage\Driver\DriverPool; use Predis\Client; /** @@ -20,14 +25,32 @@ class CacheFactory { public const ADAPTER_PREDIS = 'predis'; public const ADAPTER_MEMORY = 'memory'; + public const ADAPTER_LOCAL = 'local'; private const CACHE_KEY = 'storage'; + private const CACHE_FILE = 'storage_cache.json'; /** * Cache for 30 days. */ private const CACHE_EXPIRATION = 30 * 86400; + /** + * @var string + */ + private $localCacheRoot; + + /** + * @param Filesystem $filesystem + */ + public function __construct(Filesystem $filesystem) + { + $this->localCacheRoot = $filesystem->getDirectoryRead( + DirectoryList::VAR_DIR, + DriverPool::FILE + )->getAbsolutePath(); + } + /** * Create cache adapter. * @@ -47,6 +70,8 @@ public function create(string $adapter, array $config = []): CacheInterface return new Predis(new Client($config), self::CACHE_KEY, self::CACHE_EXPIRATION); case self::ADAPTER_MEMORY: return new Memory(); + case self::ADAPTER_LOCAL: + return new Adapter(new Local($this->localCacheRoot), self::CACHE_FILE, self::CACHE_EXPIRATION); } throw new DriverException(__('Cache adapter %1 is not supported', $adapter)); diff --git a/app/code/Magento/RemoteStorage/etc/di.xml b/app/code/Magento/RemoteStorage/etc/di.xml index 04dcc5955ac41..04c6975ef76d2 100644 --- a/app/code/Magento/RemoteStorage/etc/di.xml +++ b/app/code/Magento/RemoteStorage/etc/di.xml @@ -31,7 +31,13 @@ </arguments> </virtualType> <virtualType name="fullRemoteFilesystem" type="Magento\RemoteStorage\Filesystem" /> + <virtualType name="stdFilesystem" type="Magento\Framework\Filesystem" /> <preference for="Magento\Framework\Filesystem" type="customRemoteFilesystem"/> + <type name="Magento\RemoteStorage\Driver\Cache\CacheFactory"> + <arguments> + <argument name="filesystem" xsi:type="object">stdFilesystem</argument> + </arguments> + </type> <type name="Magento\Framework\Filesystem\Directory\TargetDirectory"> <arguments> <argument name="filesystem" xsi:type="object">fullRemoteFilesystem</argument> diff --git a/composer.json b/composer.json index b5a484d3828b8..e4ed67b727912 100644 --- a/composer.json +++ b/composer.json @@ -327,7 +327,7 @@ "tinymce/tinymce": "3.4.7", "magento/module-tinymce-3": "*", "magento/module-csp": "*", - "magento/module-aws-s-3": "*", + "magento/module-aws-s3": "*", "magento/module-remote-storage": "*" }, "conflict": { From cf10c5876d54e978042cd02f3c446cee8c72d46f Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Thu, 19 Nov 2020 13:04:42 -0600 Subject: [PATCH 215/490] PWA-1107: GraphQL returns null for empty Category URL Suffix value - Allow to set empty config setting --- .../Annotation/ApiConfigFixture.php | 6 ++-- .../Bootstrap/WebapiDocBlock.php | 2 +- .../CatalogUrlRewrite/UrlResolverTest.php | 31 ++++++++++++++----- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php index 3ef6e6618c6c5..9e34027db6aea 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php @@ -35,7 +35,8 @@ class ApiConfigFixture extends ConfigFixture protected function setStoreConfigValue(array $matches, $configPathAndValue): void { $storeCode = $matches[0]; - [$configScope, $configPath, $requiredValue] = preg_split('/\s+/', $configPathAndValue, 3); + $parts = preg_split('/\s+/', $configPathAndValue, 3); + [$configScope, $configPath, $requiredValue] = $parts + ['', '', '']; /** @var ConfigStorage $configStorage */ $configStorage = Bootstrap::getObjectManager()->get(ConfigStorage::class); if (!$configStorage->checkIsRecordExist($configPath, ScopeInterface::SCOPE_STORES, $storeCode)) { @@ -69,7 +70,8 @@ protected function setGlobalConfigValue($configPathAndValue): void protected function setWebsiteConfigValue(array $matches, $configPathAndValue): void { $websiteCode = $matches[0]; - [$configScope, $configPath, $requiredValue] = preg_split('/\s+/', $configPathAndValue, 3); + $parts = preg_split('/\s+/', $configPathAndValue, 3); + [$configScope, $configPath, $requiredValue] = $parts + ['', '', '']; /** @var ConfigStorage $configStorage */ $configStorage = Bootstrap::getObjectManager()->get(ConfigStorage::class); if (!$configStorage->checkIsRecordExist($configPath, ScopeInterface::SCOPE_WEBSITES, $websiteCode)) { diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php index 7b7047d1aceba..6bc242c194ba0 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php @@ -32,8 +32,8 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati unset($subscribers[$key]); } } - $subscribers[] = new \Magento\TestFramework\Annotation\ApiDataFixture(); $subscribers[] = new ApiConfigFixture(); + $subscribers[] = new \Magento\TestFramework\Annotation\ApiDataFixture(); return $subscribers; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index b12630d70713a..d8e9f02990a94 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -179,7 +179,6 @@ public function testRedirectsAndCustomInput() $actualUrls->getEntityType(), 0 ); - // querying a url that's a redirect the active redirected final url $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), @@ -188,7 +187,6 @@ public function testRedirectsAndCustomInput() $actualUrls->getEntityType(), 301 ); - // create custom url that doesn't redirect /** @var UrlRewrite $urlRewriteModel */ $urlRewriteModel = $this->objectManager->create(UrlRewrite::class); @@ -209,7 +207,6 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setData($key, $value); } $urlRewriteModel->save(); - // querying a custom url that should return the target entity but relative should be the custom url $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), @@ -218,14 +215,12 @@ public function testRedirectsAndCustomInput() $actualUrls->getEntityType(), 0 ); - // change custom url that does redirect $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->cleanAll(); - //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), @@ -242,10 +237,10 @@ public function testRedirectsAndCustomInput() * * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php */ - public function testCategoryUrlResolver() + public function testCategoryUrlResolver($categoryUrlPath = null) { $productSku = 'p002'; - $categoryUrlPath = 'cat-1.html'; + $categoryUrlPath = $categoryUrlPath ? $categoryUrlPath : 'cat-1.html'; /** @var ProductRepositoryInterface $productRepository */ $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); $product = $productRepository->get($productSku, false, null, true); @@ -461,6 +456,28 @@ public function testGetNonExistentUrlRewrite() $this->assertEquals(0, $response['urlResolver']['redirectCode']); } + /** + * Test for category entity with empty url suffix + * + * @magentoConfigFixture default_store catalog/seo/category_url_suffix + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testCategoryUrlResolverWithEmptyUrlSuffix() + { + $this->testCategoryUrlResolver('cat-1'); + } + + /** + * Tests if target_path(relative_url) is resolved for Product entity with empty url suffix + * + * @magentoConfigFixture default_store catalog/seo/product_url_suffix + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlResolverWithEmptyUrlSuffix() + { + $this->testProductUrlResolver(); + } + /** * Assert response from GraphQl * From cb3327f727f9ad45bf2f4790d47819f3240fcad5 Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Thu, 19 Nov 2020 13:46:05 -0600 Subject: [PATCH 216/490] PWA-1120: GQL: Return Configured Product Image setting --- .../Magento/ConfigurableProductGraphQl/etc/graphql/di.xml | 8 ++++++++ .../ConfigurableProductGraphQl/etc/schema.graphqls | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml index dc672b02e2f96..227817b3887ba 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml @@ -51,4 +51,12 @@ <type name="Magento\ConfigurableProduct\Model\ResourceModel\Attribute\OptionSelectBuilderInterface"> <plugin name="Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder_GraphQl" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\InStockOptionSelectBuilder"/> </type> + + <type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider"> + <arguments> + <argument name="extendedConfigData" xsi:type="array"> + <item name="configurable_thumbnail_source" xsi:type="string">checkout/cart/configurable_product_image</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 6fd3132aa6645..9b3c82d0aca38 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -85,3 +85,7 @@ type ConfigurableOptionAvailableForSelection @doc(description: "Configurable opt option_value_uids: [ID!]! @doc(description: "Configurable option values available for further selection.") attribute_code: String! @doc(description: "Attribute code that uniquely identifies configurable option.") } + +type StoreConfig @doc(description: "The type contains information about a store config") { + configurable_thumbnail_source : String @doc(description: "The configuration setting determines which thumbnail should be used in the cart for configurable products.") +} From 04714375218668f423350475a431d8ba7c84d764 Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Thu, 19 Nov 2020 13:59:20 -0600 Subject: [PATCH 217/490] PWA-1120: GQL: Return Configured Product Image setting --- .../ConfigurableProduct/StoreConfigTest.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/StoreConfigTest.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/StoreConfigTest.php new file mode 100644 index 0000000000000..0c4dca9a642d2 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/StoreConfigTest.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\ConfigurableProduct; + +use Exception; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Class for Store Config Configurable Product Image settings + */ +class StoreConfigTest extends GraphQlAbstract +{ + /** + * Check type of configurable_thumbnail_source storeConfig configurable_thumbnail_source + * + * @magentoConfigFixture default_store checkout/cart/configurable_product_image itself + * + * @throws Exception + */ + public function testReturnTypeAutocompleteOnStorefrontConfig() + { + $query = <<<QUERY +{ + storeConfig { + configurable_thumbnail_source + } +} +QUERY; + $response = $this->graphQlQuery($query); + self::assertArrayHasKey('configurable_thumbnail_source', $response['storeConfig']); + self::assertEquals('itself', $response['storeConfig']['configurable_thumbnail_source']); + } +} From ea1a63ccf6583064fca74daf98a14378cd3439ba Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar.dahiwala@briteskies.com> Date: Thu, 19 Nov 2020 15:51:23 -0500 Subject: [PATCH 218/490] magento/partners-magento2b2b#459: verify custom customer address attribute shows at checkout - Moving actionGroup is EE - Using actionGroup rather than asserting into test --- ...stomerAddressAttributeValueActionGroup.xml | 22 ---- ...rifyCustomCustomerAddressAttributeTest.xml | 113 ------------------ 2 files changed, 135 deletions(-) delete mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml delete mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml deleted file mode 100644 index 5023df8b809a4..0000000000000 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup.xml +++ /dev/null @@ -1,22 +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="StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup"> - <annotations> - <description>Selects the provided Option in the provided Customer Address Attribute drop down menu on store front.</description> - </annotations> - <arguments> - <argument name="customerAddressAttribute"/> - <argument name="optionValue" type="string"/> - </arguments> - - <selectOption selector="{{StorefrontCustomerAddressFormSection.dropDownAttribute(customerAddressAttribute.code)}}" userInput="{{optionValue}}" stepKey="selectOptionValue"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml deleted file mode 100644 index 02a94f99f0e53..0000000000000 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyCustomCustomerAddressAttributeTest.xml +++ /dev/null @@ -1,113 +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="StorefrontVerifyCustomCustomerAddressAttributeTest"> - <annotations> - <features value="Customer"/> - <stories value="Storefront Custom Customer Address Attribute"/> - <title value="Verify Custom Customer Address Attribute Value Shows On Storefront Customer Checkout"/> - <description value="Verify that custom customer address attribute value shows at checkout on storefront for second address"/> - <severity value="CRITICAL"/> - <testCaseId value="MC-37569"/> - <group value="customer"/> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <createData entity="SimpleProduct2" stepKey="simpleProduct"/> - <createData entity="Simple_US_Customer" stepKey="simpleCustomer"/> - </before> - <after> - <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> - <deleteData createDataKey="simpleCustomer" stepKey="deleteCustomer"/> - <!--Remove Custom Customer Address Attribute--> - <actionGroup ref="AdminDeleteCustomerAttribute" stepKey="adminDeleteFirstCustomerAttribute"> - <argument name="defaultLabel" value="{{AttributeDropdownData.label}}"/> - </actionGroup> - </after> - - <!--Create new custom customer address attribute--> - <actionGroup ref="AdminNavigateToCustomerAddressAttributesPageActionGroup" stepKey="adminNavigateToCustomerAddressAttributesPage"/> - <actionGroup ref="AdminAddOptionsCustomerAttribute" stepKey="adminCreateCustomerFirstAttribute"> - <argument name="defaultLabel" value="{{AttributeDropdownData.label}}"/> - <argument name="attributeCode" value="{{AttributeDropdownData.code}}"/> - <argument name="inputType" value="{{AttributeDropdownData.inputType}}"/> - <argument name="sortOrder" value="{{AttributeDropdownData.sortOrder}}"/> - <argument name="firstOption" value="{{AttributeDropdownData.firstOption}}"/> - <argument name="secondOption" value="{{AttributeDropdownData.secondOption}}"/> - </actionGroup> - - <!--Add address to B2C Customer--> - <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> - <argument name="customerId" value="$$simpleCustomer.id$"/> - </actionGroup> - <click selector="{{AdminEditCustomerAddressesSection.addresses}}" stepKey="proceedToAddresses"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminCustomerAddressesGridSection.firstRowEditLink}}" stepKey="editFirstAddress"/> - <waitForPageLoad time="60" stepKey="waitForAddressForm"/> - - <actionGroup ref="SelectDropdownCustomerAddressAttributeValueActionGroup" stepKey="selectOptionValue"> - <argument name="customerAddressAttribute" value="AttributeDropdownData"/> - <argument name="optionValue" value="{{AttributeDropdownData.firstOption}}"/> - </actionGroup> - - <!--Login To Store Front By B2C Customer--> - <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsStoreFront"> - <argument name="Customer" value="$$simpleCustomer$$"/> - </actionGroup> - <!-- Add Product To Cart From Product Detail Page--> - <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPageOnStorefront"> - <argument name="product" value="$$simpleProduct$$"/> - </actionGroup> - <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addToCartFromStorefrontProductPage"/> - - <!--Go To Checkout and Verify Default Address--> - <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckoutPage"/> - <!-- Ensure that the selected shipping address is similar to first address --> - <actionGroup ref="CheckSelectedShippingAddressInCheckoutWithSearchActionGroup" stepKey="assertShippingAddress"> - <argument name="customerVar" value="$$simpleCustomer$$"/> - <argument name="customerAddressVar" value="CustomerAddressSimple"/> - </actionGroup> - <!--Verify that selected "Test Dropdown" options appears on the page--> - <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute"/> - - <!--Add Second Shipping Address--> - <actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickAddNewAddressButton"/> - - <!--Fill in Shipping Address required fields and Custom Customer Address Attribute and click *Ship Here* button--> - <actionGroup ref="FillNewShippingAddressModalActionGroup" stepKey="changeAddress"> - <argument name="address" value="US_Address_NY"/> - </actionGroup> - <actionGroup ref="StorefrontSelectDropdownCustomerAddressAttributeValueActionGroup" stepKey="selectOptionValue1"> - <argument name="customerAddressAttribute" value="AttributeDropdownData"/> - <argument name="optionValue" value="{{AttributeDropdownData.firstOption}}"/> - </actionGroup> - <actionGroup ref="StorefrontClickSaveOnNewAddressFormActionGroup" stepKey="clickOnSaveNewAddress"/> - - <!-- Ensure that the selected shipping address is similar to second address --> - <actionGroup ref="CheckSelectedShippingAddressInCheckoutWithSearchActionGroup" stepKey="assertShippingAddress1"> - <argument name="customerVar" value="$$simpleCustomer$$"/> - <argument name="customerAddressVar" value="US_Address_NY"/> - </actionGroup> - <!--Verify that selected "Test Dropdown" options appears on the page--> - <see selector="{{CheckoutShippingAddressSection.selectedShippingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeShippingAddressCustomAttribute1"/> - - <!-- Select First Shipping Method and Go To Billing Section --> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> - - <!-- Ensure that the Billing address is similar to first address --> - <actionGroup ref="StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup" stepKey="assertBillingAddress"> - <argument name="customerVar" value="$$simpleCustomer$$"/> - <argument name="customerAddressVar" value="CustomerAddressSimple"/> - </actionGroup> - <!--Verify that selected "Test Dropdown" options appears on the page--> - <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{AttributeDropdownData.firstOption}}" stepKey="seeBillingAddressCustomAttribute"/> - </test> -</tests> From 1921d68f1d57924e089d794ae72e4724107383b0 Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Thu, 19 Nov 2020 14:51:43 -0600 Subject: [PATCH 219/490] ISSU-30286 - Update MFTF widget test to confirm add layout / remove layout buttons work as expected. --- .../Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml | 4 ++++ .../Widget/Test/Mftf/Section/AdminNewWidgetSection.xml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml index e657b3eb73b53..5cf135f158130 100644 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml @@ -23,6 +23,10 @@ <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.layoutUpdate}}" stepKey="seeTwoLayoutUpdates"/> + <click selector="{{AdminNewWidgetSection.removeLastLayoutUpdate}}" stepKey="clickRemoveLastLayoutUpdate"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.layoutUpdate}}" stepKey="seeOneLayoutUpdate"/> <selectOption selector="{{AdminNewWidgetSection.selectDisplayOn}}" userInput="{{widget.display_on}}" stepKey="setDisplayOn"/> <waitForAjaxLoad stepKey="waitForLoad"/> <selectOption selector="{{AdminNewWidgetSection.selectContainer}}" userInput="{{widget.container}}" stepKey="setContainer"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 8a17b589d7ab2..217375fb85a19 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -17,6 +17,8 @@ <element name="widgetStoreIds" type="select" selector="#store_ids"/> <element name="widgetSortOrder" type="input" selector="#sort_order"/> <element name="addLayoutUpdate" type="button" selector=".action-default.scalable.action-add"/> + <element name="layoutUpdate" type="block" selector=".page_group_container"/> + <element name="removeLastLayoutUpdate" type="button" selector=".page_group_container:last-child .action-default.scalable.action-delete"/> <element name="selectDisplayOn" type="select" selector="#widget_instance[0][page_group]"/> <element name="selectContainer" type="select" selector="#all_pages_0>table>tbody>tr>td:nth-child(1)>div>div>select"/> <element name="displayOnByIndex" type="select" selector="select[name='widget_instance[{{index}}][page_group]']" parameterized="true"/> From b02cc2ba14c3b26c764052a4b76a01f35fc635e8 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Wed, 18 Nov 2020 16:40:23 -0600 Subject: [PATCH 220/490] MC-39134: Custom options date is not populated when editing reorder items - Fix custom date option is not populated when editing quote item after enabling javascript calendar --- .../Block/Product/View/Options/Type/Date.php | 90 ++++- .../Product/View/Options/Type/DateTest.php | 324 ++++++++++++++++++ 2 files changed, 406 insertions(+), 8 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index 3a9d81eed4221..af921959f8e27 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -5,6 +5,11 @@ */ namespace Magento\Catalog\Block\Product\View\Options\Type; +use DateTimeZone; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Form\FilterFactory; +use Magento\Framework\Stdlib\DateTime; + /** * Product options text type block * @@ -27,22 +32,30 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions */ protected $_catalogProductOptionTypeDate; + /** + * @var FilterFactory + */ + private $filterFactory; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate * @param array $data + * @param FilterFactory|null $filterFactory */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Pricing\Helper\Data $pricingHelper, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate, - array $data = [] + array $data = [], + ?FilterFactory $filterFactory = null ) { $this->_catalogProductOptionTypeDate = $catalogProductOptionTypeDate; parent::__construct($context, $pricingHelper, $catalogData, $data); + $this->filterFactory = $filterFactory ?? ObjectManager::getInstance()->get(FilterFactory::class); } /** @@ -77,14 +90,24 @@ public function getDateHtml() public function getCalendarDateHtml() { $option = $this->getOption(); - $value = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId() . '/date'); + $values = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId()); $yearStart = $this->_catalogProductOptionTypeDate->getYearStart(); $yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd(); - $dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT); + $dateFormat = $this->_localeDate->getDateFormatWithLongYear(); /** Escape RTL characters which are present in some locales and corrupt formatting */ $escapedDateFormat = preg_replace('/[^MmDdYy\/\.\-]/', '', $dateFormat); + $value = null; + if (is_array($values)) { + $date = $this->getInternalDateString($values); + if ($date !== null) { + $dateFilter = $this->filterFactory->create('date', ['format' => $escapedDateFormat]); + $value = $dateFilter->outputFilter($date); + } elseif (isset($values['date'])) { + $value = $values['date']; + } + } $calendar = $this->getLayout()->createBlock( \Magento\Framework\View\Element\Html\Date::class )->setId( @@ -158,8 +181,8 @@ public function getTimeHtml() * Return drop-down html with range of values * * @param string $name Id/name of html select element - * @param int $from Start position - * @param int $to End position + * @param int $from Start position + * @param int $to End position * @param int|null $value Value selected * @return string Formatted Html */ @@ -209,9 +232,8 @@ protected function _getHtmlSelect($name, $value = null) $select->setExtraParams($extraParams); if ($value === null) { - $value = $this->getProduct()->getPreconfiguredValues()->getData( - 'options/' . $option->getId() . '/' . $name - ); + $values = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId()); + $value = is_array($values) ? $this->parseDate($values, $name) : null; } if ($value !== null) { $select->setValue($value); @@ -233,4 +255,56 @@ protected function _getValueWithLeadingZeros($value) } return $value < 10 ? '0' . $value : $value; } + + /** + * Get internal date format of provided value + * + * @param array $value + * @return string|null + */ + private function getInternalDateString(array $value): ?string + { + $result = null; + if (!empty($value['date']) && !empty($value['date_internal'])) { + $dateTimeZone = new DateTimeZone($this->_localeDate->getConfigTimezone()); + $dateTimeObject = date_create_from_format( + DateTime::DATETIME_PHP_FORMAT, + $value['date_internal'], + $dateTimeZone + ); + if ($dateTimeObject !== false) { + $result = $dateTimeObject->format(DateTime::DATE_PHP_FORMAT); + } + } elseif (!empty($value['day']) && !empty($value['month']) && !empty($value['year'])) { + $dateTimeObject = $this->_localeDate->date(); + $dateTimeObject->setDate((int) $value['year'], (int) $value['month'], (int) $value['day']); + $result = $dateTimeObject->format(DateTime::DATE_PHP_FORMAT); + } + return $result; + } + + /** + * Parse option value and return the requested part + * + * @param array $value + * @param string $part [year, month, day, hour, minute, day_part] + * @return string|null + */ + private function parseDate(array $value, string $part): ?string + { + $result = null; + if (!empty($value['date']) && !empty($value['date_internal'])) { + $formatDate = explode(' ', $value['date_internal']); + $date = explode('-', $formatDate[0]); + $value['year'] = $date[0]; + $value['month'] = $date[1]; + $value['day'] = $date[2]; + } + + if (isset($value[$part])) { + $result = (string) $value[$part]; + } + + return $result; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php new file mode 100644 index 0000000000000..91a54d8fc13fa --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php @@ -0,0 +1,324 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Block\Product\View\Options\Type; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Helper\Product as ProductHelper; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Option; +use Magento\Framework\DataObjectFactory; +use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Pricing\Render; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ +class DateTest extends TestCase +{ + /** + * @var Date + */ + private $block; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var DataObjectFactory + */ + private $dataObjectFactory; + + /** + * @var ProductHelper + */ + private $productHelper; + + /** + * @var ResolverInterface + */ + private $localeResolver; + + /** + * @var string + */ + private $defaultLocale; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $objectManager->get(ProductRepositoryInterface::class); + $this->productHelper = $objectManager->get(ProductHelper::class); + $this->dataObjectFactory = $objectManager->get(DataObjectFactory::class); + $layout = $objectManager->get(LayoutInterface::class); + $this->localeResolver = $objectManager->get(ResolverInterface::class); + $this->defaultLocale = $this->localeResolver->getLocale(); + $this->block = $layout->createBlock( + Date::class, + 'product.info.options.date', + [ + 'data' => [ + 'template' => 'Magento_Catalog::product/view/options/type/date.phtml' + ] + ] + ); + $layout->createBlock( + Render::class, + 'product.price.render.default', + [ + 'data' => [ + 'price_render_handle' => 'catalog_product_prices', + 'use_link_for_as_low_as' => true, + ], + ] + ); + } + + /** + * @inheritDoc + */ + protected function tearDown(): void + { + $this->localeResolver->setLocale($this->defaultLocale); + parent::tearDown(); + } + + /** + * @magentoAppArea frontend + * @param array $data + * @param array $expected + * @dataProvider toHtmlWithDropDownDataProvider + */ + public function testToHtmlWithDropDown(array $data, array $expected): void + { + $this->prepareBlock($data); + $this->assertXPaths($expected); + } + + /** + * @magentoAppArea frontend + * @magentoConfigFixture current_store catalog/custom_options/use_calendar 1 + * @param array $data + * @param array $expected + * @param string|null $locale + * @dataProvider toHtmlWithCalendarDataProvider + */ + public function testToHtmlWithCalendar(array $data, array $expected, ?string $locale = null): void + { + if ($locale) { + $this->localeResolver->setLocale($locale); + } + $this->prepareBlock($data); + $this->assertXPaths($expected); + } + + /** + * @param array $expected + */ + private function assertXPaths(array $expected): void + { + $html = $this->block->toHtml(); + $domXpath = new \DOMXPath($this->getHtmlDocument($html)); + foreach ($expected as $xpath => $value) { + $xpath = strtr($xpath, ['{id}' => $this->block->getOption()->getId()]); + $nodes = $domXpath->query(strtr($xpath, ['{id}' => $this->block->getOption()->getId()])); + $this->assertEquals(1, $nodes->count(), 'Cannot find element \'' . $xpath . '"\' in the HTML'); + $this->assertEquals($value, $nodes->item(0)->getAttribute('value')); + } + } + + /** + * @param array $data + */ + private function prepareBlock(array $data): void + { + /** @var Product $product */ + $product = $this->productRepository->get('simple'); + $this->block->setProduct($product); + $option = $this->getDateTimeOption($product); + $this->block->setOption($option); + $buyRequest = $this->dataObjectFactory->create(); + $buyRequest->setData( + [ + 'qty' => 1, + 'options' => [ + $option->getId() => $data + ], + ] + ); + $this->productHelper->prepareProductOptions($product, $buyRequest); + } + + /** + * @param Product $product + * @return Option|null + */ + private function getDateTimeOption(Product $product): ?Option + { + $option = null; + foreach ($product->getOptions() as $customOption) { + if ($customOption->getType() === Option::OPTION_TYPE_DATE_TIME) { + $option = $customOption; + break; + } + } + return $option; + } + + /** + * @param string $source + * @return \DOMDocument + */ + private function getHtmlDocument(string $source): \DOMDocument + { + $page =<<<HTML +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Title + + +$source + + +HTML; + $domDocument = new \DOMDocument('1.0', 'UTF-8'); + libxml_use_internal_errors(true); + $domDocument->loadHTML($page); + libxml_use_internal_errors(false); + return $domDocument; + } + + /** + * @return array + */ + public function toHtmlWithDropDownDataProvider(): array + { + return [ + [ + [ + 'month' => '3', + 'day' => '5', + 'year' => '2020', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//select[@id="options_{id}_year"]/option[@selected]' => '2020', + '//select[@id="options_{id}_month"]/option[@selected]' => '3', + '//select[@id="options_{id}_day"]/option[@selected]' => '5', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ] + ], + [ + [ + 'date' => '09/30/2022', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//select[@id="options_{id}_year"]/option[@selected]' => '2020', + '//select[@id="options_{id}_month"]/option[@selected]' => '9', + '//select[@id="options_{id}_day"]/option[@selected]' => '30', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ] + ] + ]; + } + + /** + * @return array + */ + public function toHtmlWithCalendarDataProvider(): array + { + return [ + [ + [ + 'month' => '3', + 'day' => '5', + 'year' => '2020', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//input[@id="options_{id}_date"]' => '3/5/2020', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ] + ], + [ + [ + 'date' => '09/30/2022', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//input[@id="options_{id}_date"]' => '9/30/2020', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ] + ], + [ + [ + 'month' => '3', + 'day' => '5', + 'year' => '2020', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//input[@id="options_{id}_date"]' => '05/03/2020', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ], + 'fr_FR' + ], + [ + [ + 'date' => '09/30/2022', + 'hour' => '2', + 'minute' => '15', + 'day_part' => 'am', + 'date_internal' => '2020-09-30 02:15:00' + ], + [ + '//input[@id="options_{id}_date"]' => '30/09/2020', + '//select[@id="options_{id}_hour"]/option[@selected]' => '2', + '//select[@id="options_{id}_minute"]/option[@selected]' => '15', + '//select[@id="options_{id}_day_part"]/option[@selected]' => 'am', + ], + 'fr_FR' + ] + ]; + } +} From efba5a33b89cf0921fc269f98503d9172f815ede Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala Date: Thu, 19 Nov 2020 16:22:47 -0500 Subject: [PATCH 221/490] magento/partners-magento2b2b#459: verify custom customer address attribute shows at checkout - removed additional element from section --- .../Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml index 87754709b8466..112ced1bc375f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml @@ -20,7 +20,6 @@ - From 0c3561cfb197b80982a8cbf80bfbd268a704fe98 Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Thu, 19 Nov 2020 15:38:52 -0600 Subject: [PATCH 222/490] MC-38787: Admin Product Grid Page indicator issue --- .../Magento/Ui/view/base/web/js/grid/paging/paging.js | 6 +++--- .../Magento/Ui/view/base/web/js/grid/search/search.js | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 761fcb6864fe1..6b6636fac5668 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -37,7 +37,7 @@ define([ totalSelected: '${ $.selectProvider }:totalSelected', totalRecords: '${ $.provider }:data.totalRecords', filters: '${ $.provider }:params.filters', - search: '${ $.provider }:params.search' + keywordUpdated: '${ $.provider }:params.keywordUpdated' }, exports: { @@ -60,7 +60,7 @@ define([ 'pageSize': 'onPageSizeChange', 'totalRecords': 'updateCounter', '${ $.provider }:params.filters': 'goFirst', - 'search': 'goFirst' + 'keywordUpdated': 'goFirst' }, modules: { @@ -186,7 +186,7 @@ define([ * @returns {Paging} Chainable. */ goFirst: function () { - if (!_.isUndefined(this.filters)) { + if ((!_.isUndefined(this.filters) && _.keys(this.filters) > 1) || this.keywordUpdated) { this.current = 1; } diff --git a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js index 3f5434761ba18..307f3606a2e3f 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js @@ -22,6 +22,7 @@ define([ placeholder: $t('Search by keyword'), label: $t('Keyword'), value: '', + keywordUpdated: false, previews: [], chipsProvider: 'componentType = filtersChips, ns = ${ $.ns }', statefull: { @@ -31,7 +32,8 @@ define([ value: true, previews: true, inputValue: true, - focused: true + focused: true, + keywordUpdated: true }, imports: { inputValue: 'value', @@ -39,7 +41,8 @@ define([ focused: false }, exports: { - value: '${ $.provider }:params.search' + value: '${ $.provider }:params.search', + keywordUpdated: '${ $.provider }:params.keywordUpdated' }, modules: { chips: '${ $.chipsProvider }' @@ -124,6 +127,7 @@ define([ apply: function (value) { value = value || this.inputValue; + this.keywordUpdated = this.value !== this.inputValue; this.value = this.inputValue = value.trim(); return this; From f1f4a861b9b516637de3b1910101a7ba406f8ea7 Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Thu, 19 Nov 2020 15:44:45 -0600 Subject: [PATCH 223/490] MC-38787: Admin Product Grid Page indicator issue --- app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 6b6636fac5668..a411a7c1a6837 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -60,7 +60,7 @@ define([ 'pageSize': 'onPageSizeChange', 'totalRecords': 'updateCounter', '${ $.provider }:params.filters': 'goFirst', - 'keywordUpdated': 'goFirst' + '${ $.provider }:params.search': 'goFirst' }, modules: { From 36640fd5f43c0b7bc3fc7312ff491432744148b8 Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Thu, 19 Nov 2020 15:54:26 -0600 Subject: [PATCH 224/490] MC-38787: Admin Product Grid Page indicator issue --- app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index a411a7c1a6837..9d4461d0bdc64 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -186,7 +186,10 @@ define([ * @returns {Paging} Chainable. */ goFirst: function () { - if ((!_.isUndefined(this.filters) && _.keys(this.filters) > 1) || this.keywordUpdated) { + if ( + (!_.isUndefined(this.filters) && _.keys(this.filters) > 1) || + (!_.isUndefined(this.keywordUpdated) && this.keywordUpdated) + ) { this.current = 1; } From b5b79b71cb252a91779cc3e2f78c6cf89e3f5a13 Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Thu, 19 Nov 2020 16:21:29 -0600 Subject: [PATCH 225/490] MC-38787: Admin Product Grid Page indicator issue --- .../Ui/view/base/web/js/grid/paging/paging.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 9d4461d0bdc64..5f6c21cf6167f 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -60,7 +60,7 @@ define([ 'pageSize': 'onPageSizeChange', 'totalRecords': 'updateCounter', '${ $.provider }:params.filters': 'goFirst', - '${ $.provider }:params.search': 'goFirst' + '${ $.provider }:params.search': 'onSearchUpdate' }, modules: { @@ -186,10 +186,7 @@ define([ * @returns {Paging} Chainable. */ goFirst: function () { - if ( - (!_.isUndefined(this.filters) && _.keys(this.filters) > 1) || - (!_.isUndefined(this.keywordUpdated) && this.keywordUpdated) - ) { + if (!_.isUndefined(this.filters)) { this.current = 1; } @@ -287,6 +284,17 @@ define([ */ onPagesChange: function () { this.updateCursor(); + }, + + /** + * Resent the pagination to Page 1 on search keyword update + */ + onSearchUpdate: function () { + if (!_.isUndefined(this.keywordUpdated) && this.keywordUpdated) { + this.goFirst(); + } + + return this; } }); }); From ff2451b8420076f7362f3b547f090024f78c0813 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi Date: Fri, 20 Nov 2020 08:49:18 +0200 Subject: [PATCH 226/490] Removed 'cache:flush' commands from tests --- .../Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml | 2 +- ...rifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerAddProductToWishlistTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerEditCustomersAddressTest.xml | 4 ++-- ...oginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml | 4 ++-- .../AdminLoginAsCustomerManualChooseFromOrderPageTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerMultishippingLoggingTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml | 4 ++-- .../Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml | 4 ++-- .../Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml | 4 ++-- .../Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml | 4 ++-- .../Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../Test/StorefrontLoginAsCustomerNotificationBannerTest.xml | 4 ++-- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml index dc608a7f12dd3..2063054a94d0b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml @@ -23,7 +23,7 @@ - + diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml index d529c6dd3ecc3..fc9eb8529da6f 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml index c083383dd8861..f5919c6ccbb80 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -38,7 +38,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml index 1175103395427..09e48b5c61aaf 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -28,7 +28,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml index f9418a9cf1e1b..3b2f61339b921 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml @@ -26,7 +26,7 @@ - + @@ -60,7 +60,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml index cf90f0b6a8511..3a80bbb7a6f2e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -32,7 +32,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index 4ef72d949065d..e4a6767ce7b22 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -19,7 +19,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml index 5b5e9e21113c8..6ae6ddfeccb47 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -40,7 +40,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml index e4f0209c55233..8493fda17636a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml @@ -29,7 +29,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -54,7 +54,7 @@ stepKey="disableLoginAsCustomer"/> - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index 5f706a814eb71..551139fb8095e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -25,7 +25,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -50,7 +50,7 @@ stepKey="disableLoginAsCustomer"/> - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml index 79c7571a08cfb..bde6f34e86f1a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml @@ -30,7 +30,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -44,7 +44,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index 8169b9df4c43d..8afaaabbc92bf 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -59,7 +59,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index 11d622319af33..8bef9fce9995b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -59,7 +59,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml index bc4c4adc3ac5a..1c3ae6e790089 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -31,7 +31,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml index e7b5de55a56cb..ae99a4dda5593 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -33,7 +33,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml index 5bbc218e0a948..51a4d1cf9fbed 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml index 50513797d06e9..9c95ab3c3c5cc 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml @@ -24,7 +24,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml index d48f167656301..4032aff6d122f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml @@ -26,7 +26,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -70,7 +70,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index e1ea363bdf6bc..10bff7c2ef68f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -19,7 +19,7 @@ - + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml index 351a3c569ce24..6a83e820039d8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> - + @@ -32,7 +32,7 @@ - + From 2baf801a9e34f1be2aee737663ad6d5a1f47574c Mon Sep 17 00:00:00 2001 From: saphaljha Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 227/490] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From bedee3d6471396b4a04e27d53d42568ee796714f Mon Sep 17 00:00:00 2001 From: saphaljha Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 228/490] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 2 + ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ + + + + + + Goes to the Admin Widget creation page. Add and delete multiple layouts + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 8a17b589d7ab2..fecad673e494e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -52,6 +52,8 @@ + + diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ + + + + + + + + + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From e03e17ea488b91388f296ffef7978f12bb33f3d9 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 229/490] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 6 files changed, 72 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml +++ /dev/null @@ -1,38 +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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml @@ -0,0 +1,17 @@ +<?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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 0fee9a1ab949b29ae86fd4eca4150d4f6a10c895 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 230/490] Fixed issue when using dynamic elements --- .../Magento/Framework/View/Helper/SecureHtmlRenderer.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index 87d4e88295356..aedb2026e4bb5 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -116,6 +116,7 @@ function {$listenerFunction} () { {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { + event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; @@ -124,10 +125,8 @@ function {$listenerFunction} () { } } }); - } - -script; - + } + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); } From 20275ce6331957c854162c71742f7c9c7da25a50 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 231/490] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <waitForAjaxLoad stepKey="waitForLoad2"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> + <waitForAjaxLoad stepKey="waitForLoad3"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index eee6058836f2e..04c1552d53522 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -42,4 +42,4 @@ <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> -</tests> +</tests> \ No newline at end of file From a1f731f86f6fd3a5257ab042d952e48f5ace0440 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 232/490] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml +++ /dev/null @@ -1,38 +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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> From 7d3d9c96f9dfbf7a828fc4874875d8f1436515e5 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 12:10:20 +0200 Subject: [PATCH 233/490] replace changelog to changelogData --- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 18 +++++++++--------- .../Magento/Test/Legacy/_files/words_ce.xml | 4 ---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php index fdc71faa90902..ff9268117d464 100644 --- a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -45,15 +45,15 @@ public function __construct( /** * Calculate EAV attributes size * - * @param ChangelogInterface $changelog + * @param ChangelogInterface $changelogData * @return int * @throws \Exception */ - private function calculateEavAttributeSize(ChangelogInterface $changelog): int + private function calculateEavAttributeSize(ChangelogInterface $changelogData): int { $connection = $this->resourceConnection->getConnection(); - if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { + if (!isset($this->entityTypeCodes[$changelogData->getViewId()])) { throw new \Exception('Entity type for view was not defined'); } @@ -66,7 +66,7 @@ private function calculateEavAttributeSize(ChangelogInterface $changelog): int ['type' => $connection->getTableName('eav_entity_type')], 'type.entity_type_id=eav_attribute.entity_type_id' ) - ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelogData->getViewId()]); return (int) $connection->fetchOne($select); } @@ -92,10 +92,10 @@ private function setGroupConcatMax(int $numberOfAttributes): void * @inheritdoc * @throws \Exception */ - public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + public function walk(ChangelogInterface $changelogData, int $fromVersionId, int $toVersion, int $batchSize) { $connection = $this->resourceConnection->getConnection(); - $numberOfAttributes = $this->calculateEavAttributeSize($changelog); + $numberOfAttributes = $this->calculateEavAttributeSize($changelogData); $this->setGroupConcatMax($numberOfAttributes); $select = $connection->select()->distinct(true) ->where( @@ -106,15 +106,15 @@ public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toV 'version_id <= ?', $toVersion ) - ->group([$changelog->getColumnName(), 'store_id']) + ->group([$changelogData->getColumnName(), 'store_id']) ->limit($batchSize); $columns = [ - $changelog->getColumnName(), + $changelogData->getColumnName(), 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), 'store_id' ]; - $select->from($changelog->getName(), $columns); + $select->from($changelogData->getName(), $columns); return $connection->fetchAll($select); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml index ccad52fae453e..92e7b15efed29 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml @@ -73,9 +73,5 @@ <path>app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less</path> <word>rma</word> </item> - <item> - <path>app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php</path> - <word>changelog</word> - </item> </whitelist> </config> From 80a192467d74c1291d8a1da00a34d0fdb6090a77 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 14:28:09 +0200 Subject: [PATCH 234/490] put "changelog" back --- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php index ff9268117d464..fdc71faa90902 100644 --- a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -45,15 +45,15 @@ public function __construct( /** * Calculate EAV attributes size * - * @param ChangelogInterface $changelogData + * @param ChangelogInterface $changelog * @return int * @throws \Exception */ - private function calculateEavAttributeSize(ChangelogInterface $changelogData): int + private function calculateEavAttributeSize(ChangelogInterface $changelog): int { $connection = $this->resourceConnection->getConnection(); - if (!isset($this->entityTypeCodes[$changelogData->getViewId()])) { + if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { throw new \Exception('Entity type for view was not defined'); } @@ -66,7 +66,7 @@ private function calculateEavAttributeSize(ChangelogInterface $changelogData): i ['type' => $connection->getTableName('eav_entity_type')], 'type.entity_type_id=eav_attribute.entity_type_id' ) - ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelogData->getViewId()]); + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); return (int) $connection->fetchOne($select); } @@ -92,10 +92,10 @@ private function setGroupConcatMax(int $numberOfAttributes): void * @inheritdoc * @throws \Exception */ - public function walk(ChangelogInterface $changelogData, int $fromVersionId, int $toVersion, int $batchSize) + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) { $connection = $this->resourceConnection->getConnection(); - $numberOfAttributes = $this->calculateEavAttributeSize($changelogData); + $numberOfAttributes = $this->calculateEavAttributeSize($changelog); $this->setGroupConcatMax($numberOfAttributes); $select = $connection->select()->distinct(true) ->where( @@ -106,15 +106,15 @@ public function walk(ChangelogInterface $changelogData, int $fromVersionId, int 'version_id <= ?', $toVersion ) - ->group([$changelogData->getColumnName(), 'store_id']) + ->group([$changelog->getColumnName(), 'store_id']) ->limit($batchSize); $columns = [ - $changelogData->getColumnName(), + $changelog->getColumnName(), 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), 'store_id' ]; - $select->from($changelogData->getName(), $columns); + $select->from($changelog->getName(), $columns); return $connection->fetchAll($select); } } From 906441de5d9237919192cf54556059a7ad167204 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 15:51:11 +0200 Subject: [PATCH 235/490] added AdditionalColumnProcessorFactory class to unit tests --- .../Mview/Test/Unit/View/ChangelogTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 4af3f65be6883..16fc3a91924b8 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -12,6 +12,7 @@ use Magento\Framework\DB\Ddl\Table; use Magento\Framework\DB\Select; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\ProcessorFactory; use Magento\Framework\Mview\View\Changelog; use Magento\Framework\Mview\View\ChangelogInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -41,13 +42,19 @@ class ChangelogTest extends TestCase */ protected $resourceMock; + /** + * @var ProcessorFactory|MockObject + */ + protected $processorFactory; + protected function setUp(): void { $this->connectionMock = $this->createMock(Mysql::class); $this->resourceMock = $this->createMock(ResourceConnection::class); $this->mockGetConnection($this->connectionMock); + $this->processorFactory = $this->createMock(ProcessorFactory::class); - $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock()); + $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock(), $this->processorFactory); } /** @@ -69,7 +76,7 @@ public function testInstanceOf() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(true); - $model = new Changelog($resourceMock, $this->getMviewConfigMock()); + $model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory); $this->assertInstanceOf(ChangelogInterface::class, $model); } @@ -80,7 +87,7 @@ public function testCheckConnectionException() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(null); - $model = new Changelog($resourceMock, $this->getMviewConfigMock()); + $model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory); $model->setViewId('ViewIdTest'); $this->assertNull($model); } From 5b2ab2fdcff76aafec82935856fc2e2a45087777 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Fri, 20 Nov 2020 16:28:05 +0200 Subject: [PATCH 236/490] MC-37502: Create automated test for "Move Order to Archive" --- .../_files/order_with_invoice_shipment_creditmemo.php | 8 ++++++-- .../order_with_invoice_shipment_creditmemo_rollback.php | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php index f84a8b65e13fd..c95b21c1433bf 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -27,6 +27,7 @@ use Magento\Sales\Model\Order\Creditmemo; use Magento\Sales\Model\Order\CreditmemoFactory; use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Workaround\Override\Fixture\Resolver; @@ -34,6 +35,8 @@ Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); $objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); /** @var ProductRepositoryInterface $productRepository */ $productRepository = $objectManager->get(ProductRepositoryInterface::class); $productRepository->cleanCache(); @@ -89,7 +92,7 @@ ->setName('Test item'); /** @var OrderInterface $order */ $order = $objectManager->get(OrderInterfaceFactory::class)->create(); -$order->setIncrementId('100000001') +$order->setIncrementId('100000111') ->setState(Order::STATE_PROCESSING) ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) ->setSubtotal(100) @@ -103,7 +106,8 @@ ->setBillingAddress($billingAddress) ->setShippingAddress($shippingAddress) ->addItem($orderItem) - ->setPayment($payment); + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); $orderRepository->save($order); $invoice = $invoiceService->prepareInvoice($order); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php index 56670ecc2a470..f9330bc99ac14 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -40,4 +40,7 @@ $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); +$creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); +$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); + Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From 673edbeef402cdce35888dcc105261be24184337 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 20 Nov 2020 16:36:03 +0200 Subject: [PATCH 237/490] fix static --- .../Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php | 8 ++++++-- .../Test/Unit/Model/Resolver/ProductUrlSuffixTest.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php index 315e1040046cb..761e4dabc9919 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php @@ -11,9 +11,11 @@ use PHPUnit\Framework\TestCase; use Magento\Framework\App\Config\ScopeConfigInterface; +/** + * Test for \Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix. + */ class CategoryUrlSuffixTest extends TestCase { - /** * @var ScopeConfigInterface|MockObject */ @@ -49,7 +51,9 @@ class CategoryUrlSuffixTest extends TestCase */ private $resolver; - + /** + * @inheritDoc + */ protected function setUp(): void { $this->contextMock = $this->getMockBuilder(ContextInterface::class) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php index 079389ede50fc..352bade3c6eef 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php @@ -11,9 +11,11 @@ use PHPUnit\Framework\TestCase; use Magento\Framework\App\Config\ScopeConfigInterface; +/** + * Test for \Magento\CatalogUrlRewriteGraphQl\Model\Resolver\ProductUrlSuffix. + */ class ProductUrlSuffixTest extends TestCase { - /** * @var ScopeConfigInterface|MockObject */ @@ -49,7 +51,9 @@ class ProductUrlSuffixTest extends TestCase */ private $resolver; - + /** + * @inheritDoc + */ protected function setUp(): void { $this->contextMock = $this->getMockBuilder(ContextInterface::class) From 1d3b89515cd95a1077fda05f91a96535d6b44809 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 20 Nov 2020 16:49:30 +0200 Subject: [PATCH 238/490] MC-37922: Html tag <br> visible in message --- .../ImportExport/Controller/Adminhtml/ImportResult.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php index 6da90efa4592c..86fae141d1470 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php @@ -69,12 +69,16 @@ protected function addErrorMessages( if ($errorAggregator->getErrorsCount()) { $message = ''; $counter = 0; + $unescapedMessages = []; foreach ($this->getErrorMessages($errorAggregator) as $error) { - $message .= (++$counter) . '. ' . $error . '<br>'; + $unescapedMessages[] = (++$counter) . '. ' . $error; if ($counter >= self::LIMIT_ERRORS_MESSAGE) { break; } } + foreach ($unescapedMessages as $unescapedMessage) { + $message .= $resultBlock->escapeHtml($unescapedMessage) . '<br>'; + } if ($errorAggregator->hasFatalExceptions()) { foreach ($this->getSystemExceptions($errorAggregator) as $error) { $message .= $error->getErrorMessage() @@ -90,7 +94,7 @@ protected function addErrorMessages( . '<a href="' . $this->createDownloadUrlImportHistoryFile($this->createErrorReport($errorAggregator)) . '">' . __('Download full report') . '</a><br>' - . '<div class="import-error-list">' . $resultBlock->escapeHtml($message) . '</div></div>' + . '<div class="import-error-list">' . $message . '</div></div>' ); } catch (\Exception $e) { foreach ($this->getErrorMessages($errorAggregator) as $errorMessage) { From e5b24273467e80dc0994cb7d5c9ae79c64d3ae3a Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 17:08:11 +0200 Subject: [PATCH 239/490] changes to Unit Tests --- .../Magento/Framework/Mview/Test/Unit/_files/mview_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php index 36e7dca899047..af488ecf5589e 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php @@ -32,7 +32,7 @@ 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], ], - 'iterator' => \Magento\Framework\Mview\View\ChangeLogBatchIterator::class + 'walker' => \Magento\Framework\Mview\View\ChangeLogBatchWalker::class ], ] ]; From ed41a6200b3517b49e9b64d5c44dc096294796bc Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Fri, 20 Nov 2020 12:25:59 -0600 Subject: [PATCH 240/490] MC-38787: Admin Product Grid Page indicator issue --- .../Magento/Ui/view/base/web/js/grid/search/search.js | 2 +- .../code/Magento/Ui/base/js/grid/search/search.test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js index 307f3606a2e3f..d4db0100db7c6 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js @@ -127,7 +127,7 @@ define([ apply: function (value) { value = value || this.inputValue; - this.keywordUpdated = this.value !== this.inputValue; + this.keywordUpdated = this.value !== value; this.value = this.inputValue = value.trim(); return this; diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/search/search.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/search/search.test.js index 11af4cdc219a9..87fb61873b653 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/search/search.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/search/search.test.js @@ -37,5 +37,15 @@ define([ searchObj.updatePreview(); expect(searchObj.updatePreview).toHaveBeenCalled(); }); + it('set the proper keywordUpdated value on new search keyword', function () { + searchObj.value = 'keyword 1'; + expect(searchObj.keywordUpdated).toEqual(false); + searchObj.apply('keyword 2'); + expect(searchObj.keywordUpdated).toEqual(true); + searchObj.apply('keyword 2'); + expect(searchObj.keywordUpdated).toEqual(false); + searchObj.apply('keyword 3'); + expect(searchObj.keywordUpdated).toEqual(true); + }); }); }); From ba74b25f09c76f6efb5bde3c228671571ab0b954 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 14:43:52 -0600 Subject: [PATCH 241/490] MC-38995: Customer group price is not working in product query graphql --- .../Context/AddCustomerGroupToContext.php | 68 +++++++++++++++++++ .../CustomerGraphQl/etc/graphql/di.xml | 1 + 2 files changed, 69 insertions(+) create mode 100644 app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php new file mode 100644 index 0000000000000..05209974ecd7b --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CustomerGraphQl\Model\Context; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\GraphQl\Model\Query\ContextParametersInterface; +use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Customer\Model\Group; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * @inheritdoc + */ +class AddCustomerGroupToContext implements ContextParametersProcessorInterface +{ + /** + * @var CustomerSession + */ + private $customerSession; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param CustomerSession $customerSession + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct( + CustomerSession $customerSession, + CustomerRepositoryInterface $customerRepository + ) { + $this->customerSession = $customerSession; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritdoc + */ + public function execute(ContextParametersInterface $contextParameters): ContextParametersInterface + { + $customerSession = $this->customerSession; + $customerGroupId = null; + if ($contextParameters->getUserType() === UserContextInterface::USER_TYPE_GUEST) { + $customerGroupId = Group::NOT_LOGGED_IN_ID; + } elseif ($contextParameters->getExtensionAttributes()->getIsCustomer() === true) { + try { + $customer = $this->customerRepository->getById($contextParameters->getUserId()); + $customerGroupId = (int) $customer->getGroupId(); + } catch (LocalizedException $e) { + $customerGroupId = null; + } + } + if ($customerGroupId !== null) { + $customerSession->setCustomerGroupId($customerGroupId); + $contextParameters->addExtensionAttribute('customer_group_id', $customerGroupId); + } + return $contextParameters; + } +} diff --git a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml index 3ed77a2ad563c..3e3a5327370a5 100644 --- a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml @@ -17,6 +17,7 @@ <arguments> <argument name="contextParametersProcessors" xsi:type="array"> <item name="add_user_info_to_context" xsi:type="object">Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext</item> + <item name="add_customer_group_to_context" xsi:type="object">Magento\CustomerGraphQl\Model\Context\AddCustomerGroupToContext</item> </argument> </arguments> </type> From 72d4cd76ada26777ae3733d46c3e46d1ec482cac Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Fri, 20 Nov 2020 16:27:41 -0600 Subject: [PATCH 242/490] MC-38787: Admin Product Grid Page indicator issue --- ...hProductGridByStringNoClearActionGroup.xml | 23 +++++ ...dPageNumberSetsToOneAfterNewSearchTest.xml | 95 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml new file mode 100644 index 0000000000000..a763f37ed153f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.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="SearchProductGridByStringNoClearActionGroup"> + <annotations> + <description>Searches the Admin Products grid by string without clearing filters.</description> + </annotations> + <arguments> + <argument name="keyword" type="string"/> + </arguments> + + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> + <waitForPageLoad stepKey="waitForProductSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml new file mode 100644 index 0000000000000..f2dd87e74e9de --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml @@ -0,0 +1,95 @@ +<?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="AdminGridPageNumberSetsToOneAfterNewSearchTest"> + + <annotations> + <features value="Catalog"/> + <stories value="Catalog grid"/> + <title value="Checking Catalog grid page number after entering a new search keyword"/> + <description value="Checking Catalog grid page number after entering a new search keyword"/> + <severity value="MINOR"/> + <testCaseId value="MC-xxxxx"/> + <useCaseId value="MC-38787"/> + <group value="Catalog"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <comment userInput="Clear product grid" stepKey="commentClearProductGrid"/> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProductIfTheyExist"/> + <createData stepKey="category1" entity="SimpleSubCategory"/> + + <createData stepKey="simpleProduct1" entity="SimpleProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="simpleProduct2" entity="SimpleProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="simpleProduct3" entity="SimpleProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="simpleProduct4" entity="SimpleProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="virtualProduct1" entity="VirtualProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="virtualProduct2" entity="VirtualProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData stepKey="virtualProduct3" entity="VirtualProduct"> + <requiredEntity createDataKey="category1"/> + </createData> + </before> + + <after> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> + <actionGroup ref="AdminDataGridDeleteCustomPerPageActionGroup" stepKey="deleteCustomAddedPerPage"> + <argument name="perPage" value="ProductPerPage.productCount"/> + </actionGroup> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> + + <deleteData stepKey="deleteCategory1" createDataKey="category1"/> + + <deleteData stepKey="deleteSimpleProduct1" createDataKey="simpleProduct1"/> + <deleteData stepKey="deleteSimpleProduct2" createDataKey="simpleProduct2"/> + <deleteData stepKey="deleteSimpleProduct3" createDataKey="simpleProduct3"/> + <deleteData stepKey="deleteSimpleProduct4" createDataKey="simpleProduct4"/> + <deleteData stepKey="deleteVirtualProduct1" createDataKey="virtualProduct1"/> + <deleteData stepKey="deleteVirtualProduct2" createDataKey="virtualProduct2"/> + <deleteData stepKey="deleteVirtualProduct3" createDataKey="virtualProduct3"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> + + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1ProductPerPage"> + <argument name="perPage" value="ProductPerPage.productCount"/> + </actionGroup> + + <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForSimpleProduct"> + <argument name="keyword" value="SimpleProduct"/> + </actionGroup> + + <comment userInput="Go to the next page" stepKey="nextPage"/> + <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageProductGrid"/> + <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGrid"/> + + <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct"> + <argument name="keyword" value="VirtualProduct"/> + </actionGroup> + + <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGrid"/> + </test> +</tests> From c491bef2b2e00145d8bddae965599cff1176a7ec Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 17:03:03 -0600 Subject: [PATCH 243/490] MC-38995: Customer group price is not working in product query graphql --- .../Model/Context/AddCustomerGroupToContext.php | 4 ++-- app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index 05209974ecd7b..a98416753f190 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -56,12 +56,12 @@ public function execute(ContextParametersInterface $contextParameters): ContextP $customer = $this->customerRepository->getById($contextParameters->getUserId()); $customerGroupId = (int) $customer->getGroupId(); } catch (LocalizedException $e) { - $customerGroupId = null; + $customerGroupId = Group::NOT_LOGGED_IN_ID; } } if ($customerGroupId !== null) { $customerSession->setCustomerGroupId($customerGroupId); - $contextParameters->addExtensionAttribute('customer_group_id', $customerGroupId); + $contextParameters->addExtensionAttribute('customer_group', (int) $customerGroupId); } return $contextParameters; } diff --git a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml index b8bdb5a46ca81..a0917b2ef573b 100644 --- a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml +++ b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml @@ -8,6 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\GraphQl\Model\Query\ContextInterface"> <attribute code="is_customer" type="boolean"/> - <attribute code="customer_group_id" type="integer"/> + <attribute code="customer_group" type="integer"/> </extension_attributes> </config> From 7597f8b41e032eb9bfe351876d8eb354a0e8337d Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 17:04:48 -0600 Subject: [PATCH 244/490] MC-38995: Customer group price is not working in product query graphql --- app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml index a0917b2ef573b..1f8584c6e152a 100644 --- a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml +++ b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\GraphQl\Model\Query\ContextInterface"> <attribute code="is_customer" type="boolean"/> + <attribute code="id_customer_group" type="integer"/> <attribute code="customer_group" type="integer"/> </extension_attributes> </config> From ac54594c374b0c49983f7dfa5b7b1830518244f2 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 17:43:47 -0600 Subject: [PATCH 245/490] MC-38995: Customer group price is not working in product query graphql --- .../Model/Context/AddCustomerGroupToContext.php | 5 +++-- .../Magento/CustomerGraphQl/etc/extension_attributes.xml | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index a98416753f190..d712b4e2e6db1 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -49,9 +49,10 @@ public function execute(ContextParametersInterface $contextParameters): ContextP { $customerSession = $this->customerSession; $customerGroupId = null; + $extensionAttributes = $contextParameters->getExtensionAttributesData(); if ($contextParameters->getUserType() === UserContextInterface::USER_TYPE_GUEST) { $customerGroupId = Group::NOT_LOGGED_IN_ID; - } elseif ($contextParameters->getExtensionAttributes()->getIsCustomer() === true) { + } elseif (!empty($extensionAttributes) && $extensionAttributes['is_customer'] === true) { try { $customer = $this->customerRepository->getById($contextParameters->getUserId()); $customerGroupId = (int) $customer->getGroupId(); @@ -61,7 +62,7 @@ public function execute(ContextParametersInterface $contextParameters): ContextP } if ($customerGroupId !== null) { $customerSession->setCustomerGroupId($customerGroupId); - $contextParameters->addExtensionAttribute('customer_group', (int) $customerGroupId); + $contextParameters->addExtensionAttribute('id_customer_group', (int) $customerGroupId); } return $contextParameters; } diff --git a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml index 1f8584c6e152a..7f829b425f36e 100644 --- a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml +++ b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml @@ -9,6 +9,5 @@ <extension_attributes for="Magento\GraphQl\Model\Query\ContextInterface"> <attribute code="is_customer" type="boolean"/> <attribute code="id_customer_group" type="integer"/> - <attribute code="customer_group" type="integer"/> </extension_attributes> </config> From 74707e5fcda41c83406451c6b1ac0014e76245a3 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 17:45:49 -0600 Subject: [PATCH 246/490] MC-38995: Customer group price is not working in product query graphql --- .../CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php | 2 +- app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index d712b4e2e6db1..5a68756183e88 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -62,7 +62,7 @@ public function execute(ContextParametersInterface $contextParameters): ContextP } if ($customerGroupId !== null) { $customerSession->setCustomerGroupId($customerGroupId); - $contextParameters->addExtensionAttribute('id_customer_group', (int) $customerGroupId); + $contextParameters->addExtensionAttribute('customer_group_id', (int) $customerGroupId); } return $contextParameters; } diff --git a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml index 7f829b425f36e..b8bdb5a46ca81 100644 --- a/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml +++ b/app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml @@ -8,6 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\GraphQl\Model\Query\ContextInterface"> <attribute code="is_customer" type="boolean"/> - <attribute code="id_customer_group" type="integer"/> + <attribute code="customer_group_id" type="integer"/> </extension_attributes> </config> From fd8749f6ecea40dcd759b1bf76cb68695737fadf Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Fri, 20 Nov 2020 18:19:06 -0600 Subject: [PATCH 247/490] MC-38770: Exception during initialization is cacheable - fixed --- lib/internal/Magento/Framework/App/Bootstrap.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 93d5535d0e10e..92b925836b295 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -386,7 +386,7 @@ private function initErrorHandler() $handler = new ErrorHandler(); set_error_handler([$handler, 'handler']); } - + /** * Getter for error code * @@ -428,9 +428,13 @@ public function isDeveloperMode() */ protected function terminate(\Throwable $e) { - + /** @var \Magento\Framework\HTTP\PhpEnvironment\Response $response */ + $response = $this->objectManager->get(\Magento\Framework\HTTP\PhpEnvironment\Response::class); + $response->clearHeaders(); + $response->setHttpResponseCode(500); + $response->setHeader('Content-Type', 'text/plain'); if ($this->isDeveloperMode()) { - echo $e; + $response->setBody($e); } else { $message = "An error has happened during application run. See exception log for details.\n"; try { @@ -441,8 +445,9 @@ protected function terminate(\Throwable $e) } catch (\Exception $e) { $message .= "Could not write error message to log. Please use developer mode to see the message.\n"; } - echo $message; + $response->setBody($message); } + $response->sendResponse(); exit(1); } // phpcs:enable From 4539b37834de3fdcb0ef20e26ba3ac90a3b6c509 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 20 Nov 2020 22:16:18 -0600 Subject: [PATCH 248/490] MC-38995: Customer group price is not working in product query graphql --- .../PriceDataProcessor.php | 45 +++++++++++++++++++ app/code/Magento/CatalogGraphQl/etc/di.xml | 1 + .../Context/AddCustomerGroupToContext.php | 11 ----- 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php new file mode 100644 index 0000000000000..1cff0feecc730 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor; + +use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface; +use Magento\Framework\Api\SearchCriteriaInterface; +use Magento\GraphQl\Model\Query\ContextInterface; + +/** + * Add price data to product collection results + */ +class PriceDataProcessor implements CollectionProcessorInterface +{ + /** + * Process to add price data to product collection. + * + * @param Collection $collection + * @param SearchCriteriaInterface $searchCriteria + * @param array $attributeNames + * @param ContextInterface|null $context + * @return Collection + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function process( + Collection $collection, + SearchCriteriaInterface $searchCriteria, + array $attributeNames, + ?ContextInterface $context = null + ): Collection { + if ($context) { + $customerGroupId = $context->getExtensionAttributes()->getCustomerGroupId(); + if ($customerGroupId !== null) { + $collection->addPriceData($customerGroupId); + } + } + + return $collection; + } +} diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index fd3a834bff160..5c840d2e60981 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -51,6 +51,7 @@ <item name="stock" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\StockProcessor</item> <item name="visibility" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\VisibilityStatusProcessor</item> <item name="mediaGallery" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\MediaGalleryProcessor</item> + <item name="priceData" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\PriceDataProcessor</item> </argument> </arguments> </type> diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index 5a68756183e88..f7b8c95078f96 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -10,7 +10,6 @@ use Magento\Authorization\Model\UserContextInterface; use Magento\GraphQl\Model\Query\ContextParametersInterface; use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface; -use Magento\Customer\Model\Session as CustomerSession; use Magento\Customer\Model\Group; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Exception\LocalizedException; @@ -20,25 +19,17 @@ */ class AddCustomerGroupToContext implements ContextParametersProcessorInterface { - /** - * @var CustomerSession - */ - private $customerSession; - /** * @var CustomerRepositoryInterface */ private $customerRepository; /** - * @param CustomerSession $customerSession * @param CustomerRepositoryInterface $customerRepository */ public function __construct( - CustomerSession $customerSession, CustomerRepositoryInterface $customerRepository ) { - $this->customerSession = $customerSession; $this->customerRepository = $customerRepository; } @@ -47,7 +38,6 @@ public function __construct( */ public function execute(ContextParametersInterface $contextParameters): ContextParametersInterface { - $customerSession = $this->customerSession; $customerGroupId = null; $extensionAttributes = $contextParameters->getExtensionAttributesData(); if ($contextParameters->getUserType() === UserContextInterface::USER_TYPE_GUEST) { @@ -61,7 +51,6 @@ public function execute(ContextParametersInterface $contextParameters): ContextP } } if ($customerGroupId !== null) { - $customerSession->setCustomerGroupId($customerGroupId); $contextParameters->addExtensionAttribute('customer_group_id', (int) $customerGroupId); } return $contextParameters; From 8ecb615ab4e1181694caa77fdf0070a02e5d25ec Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Sat, 21 Nov 2020 00:41:24 -0600 Subject: [PATCH 249/490] MC-38995: Customer group price is not working in product query graphql --- .../Model/Resolver/Product/PriceRange.php | 7 +++ .../PriceDataProcessor.php | 45 ------------------- app/code/Magento/CatalogGraphQl/etc/di.xml | 1 - 3 files changed, 7 insertions(+), 46 deletions(-) delete mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php index 805571d58d634..ed5ae433dd5b7 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php @@ -63,6 +63,13 @@ public function resolve( $product = $value['model']; $product->unsetData('minimal_price'); + if ($context) { + $customerGroupId = $context->getExtensionAttributes()->getCustomerGroupId(); + if ($customerGroupId !== null) { + $product->setCustomerGroupId($customerGroupId); + } + } + $requestedFields = $info->getFieldSelection(10); $returnArray = []; diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php deleted file mode 100644 index 1cff0feecc730..0000000000000 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/PriceDataProcessor.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor; - -use Magento\Catalog\Model\ResourceModel\Product\Collection; -use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface; -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\GraphQl\Model\Query\ContextInterface; - -/** - * Add price data to product collection results - */ -class PriceDataProcessor implements CollectionProcessorInterface -{ - /** - * Process to add price data to product collection. - * - * @param Collection $collection - * @param SearchCriteriaInterface $searchCriteria - * @param array $attributeNames - * @param ContextInterface|null $context - * @return Collection - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function process( - Collection $collection, - SearchCriteriaInterface $searchCriteria, - array $attributeNames, - ?ContextInterface $context = null - ): Collection { - if ($context) { - $customerGroupId = $context->getExtensionAttributes()->getCustomerGroupId(); - if ($customerGroupId !== null) { - $collection->addPriceData($customerGroupId); - } - } - - return $collection; - } -} diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index 5c840d2e60981..fd3a834bff160 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -51,7 +51,6 @@ <item name="stock" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\StockProcessor</item> <item name="visibility" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\VisibilityStatusProcessor</item> <item name="mediaGallery" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\MediaGalleryProcessor</item> - <item name="priceData" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\PriceDataProcessor</item> </argument> </arguments> </type> From 36debb3d05e13b07b27a057d8ea6a311f67a830e Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Sat, 21 Nov 2020 12:12:01 +0200 Subject: [PATCH 250/490] MC-37504: Create automated test for "Mass Action Archive Order" --- .../Magento/Sales/_files/order_closed.php | 148 ++++++++++++++++++ .../Sales/_files/order_closed_rollback.php | 46 ++++++ .../Magento/Sales/_files/order_complete.php | 116 ++++++++++++++ .../Sales/_files/order_complete_rollback.php | 40 +++++ .../_files/order_state_hold_rollback.php | 10 ++ 5 files changed, 360 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php new file mode 100644 index 0000000000000..1708d89881592 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php @@ -0,0 +1,148 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\DB\Transaction; +use Magento\OfflinePayments\Model\Checkmo; +use Magento\Sales\Api\CreditmemoItemRepositoryInterface; +use Magento\Sales\Api\CreditmemoRepositoryInterface; +use Magento\Sales\Api\Data\CreditmemoItemInterfaceFactory; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\Data\OrderPaymentInterfaceFactory; +use Magento\Sales\Api\InvoiceManagementInterface; +use Magento\Sales\Api\Data\OrderItemInterfaceFactory; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Address; +use Magento\Sales\Model\Order\AddressFactory; +use Magento\Sales\Api\Data\OrderAddressInterfaceFactory; +use Magento\Sales\Model\Order\Creditmemo; +use Magento\Sales\Model\Order\CreditmemoFactory; +use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +/** @var CreditmemoItemInterfaceFactory $creditmemoItemFactory */ +$creditmemoItemFactory = $objectManager->get(CreditmemoItemInterfaceFactory::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var CreditmemoItemRepositoryInterface $creditmemoItemRepository */ +$creditmemoItemRepository = $objectManager->get(CreditmemoItemRepositoryInterface::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US', +]; +$product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100001111') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +$creditmemo = $creditmemoFactory->createByOrder($order, $order->getData()); +$creditmemo->setOrder($order); +$creditmemo->setState(Creditmemo::STATE_OPEN); +$creditmemo->setIncrementId($order->getIncrementId()); +$creditmemoRepository->save($creditmemo); + +$orderItem->setName('Test item') + ->setQtyRefunded(2) + ->setQtyInvoiced(2) + ->setOriginalPrice($product->getPrice()); +$creditItem = $creditmemoItemFactory->create(); +$creditItem->setCreditmemo($creditmemo) + ->setName('Creditmemo item') + ->setOrderItemId($orderItem->getId()) + ->setQty(2) + ->setPrice($product->getPrice()); +$creditmemoItemRepository->save($creditItem); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php new file mode 100644 index 0000000000000..13263fd442713 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Registry; +use Magento\Sales\Api\CreditmemoRepositoryInterface; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\InvoiceRepositoryInterface; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Api\ShipmentRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100001111'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +$creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); +$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php new file mode 100644 index 0000000000000..bb8f028b41380 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php @@ -0,0 +1,116 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\DB\Transaction; +use Magento\OfflinePayments\Model\Checkmo; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\Data\OrderPaymentInterfaceFactory; +use Magento\Sales\Api\InvoiceManagementInterface; +use Magento\Sales\Api\Data\OrderItemInterfaceFactory; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Address; +use Magento\Sales\Model\Order\AddressFactory; +use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/default_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US', +]; +$product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100000333') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php new file mode 100644 index 0000000000000..06a36c16b90f7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Registry; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\InvoiceRepositoryInterface; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Api\ShipmentRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000333'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php new file mode 100644 index 0000000000000..07d468289f5b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_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/Sales/_files/order_rollback.php'); From 94fd3a162c5e6eaacf558c26c71ea1ebf4c131d4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Sat, 21 Nov 2020 08:36:00 -0600 Subject: [PATCH 251/490] MC-38995: Customer group price is not working in product query graphql --- .../Magento/Customer/Model/Group/Resolver.php | 40 +++++++++++++ .../Model/ResourceModel/Group/Resolver.php | 58 +++++++++++++++++++ .../Context/AddCustomerGroupToContext.php | 19 +++--- 3 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 app/code/Magento/Customer/Model/Group/Resolver.php create mode 100644 app/code/Magento/Customer/Model/ResourceModel/Group/Resolver.php diff --git a/app/code/Magento/Customer/Model/Group/Resolver.php b/app/code/Magento/Customer/Model/Group/Resolver.php new file mode 100644 index 0000000000000..fd797d744e6dc --- /dev/null +++ b/app/code/Magento/Customer/Model/Group/Resolver.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Group; + +use Magento\Customer\Model\ResourceModel\Group\Resolver as ResolverResource; + +/** + * Lightweight service for getting current customer group based on customer id + */ +class Resolver +{ + /** + * @var ResolverResource + */ + private $resolverResource; + + /** + * @param ResolverResource $resolverResource + */ + public function __construct(ResolverResource $resolverResource) + { + $this->resolverResource = $resolverResource; + } + + /** + * Return customer group id + * + * @param int $customerId + * @return int|null + */ + public function resolve(int $customerId) : ?int + { + return $this->resolverResource->resolve($customerId); + } +} diff --git a/app/code/Magento/Customer/Model/ResourceModel/Group/Resolver.php b/app/code/Magento/Customer/Model/ResourceModel/Group/Resolver.php new file mode 100644 index 0000000000000..82c2cf2449cd3 --- /dev/null +++ b/app/code/Magento/Customer/Model/ResourceModel/Group/Resolver.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\ResourceModel\Group; + +use Magento\Framework\App\ResourceConnection; + +/** + * Resource model for customer group resolver service + */ +class Resolver +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct( + ResourceConnection $resourceConnection + ) { + $this->resourceConnection = $resourceConnection; + } + + /** + * Resolve customer group from db + * + * @param int $customerId + * @return int|null + */ + public function resolve(int $customerId) : ?int + { + $result = null; + + $connection = $this->resourceConnection->getConnection(); + $tableName = $this->resourceConnection->getTableName('customer_entity'); + + $query = $connection + ->select() + ->from( + ['main_table' => $tableName], + ['main_table.group_id'] + ) + ->where('main_table.entity_id = ?', $customerId); + $groupId = $connection->fetchOne($query); + if ($groupId) { + $result = (int) $groupId; + } + + return $result; + } +} diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index f7b8c95078f96..d576475759a59 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -11,7 +11,7 @@ use Magento\GraphQl\Model\Query\ContextParametersInterface; use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface; use Magento\Customer\Model\Group; -use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Model\Group\Resolver as CustomerGroupResolver; use Magento\Framework\Exception\LocalizedException; /** @@ -20,17 +20,17 @@ class AddCustomerGroupToContext implements ContextParametersProcessorInterface { /** - * @var CustomerRepositoryInterface + * @var CustomerGroupResolver */ - private $customerRepository; + private $customerGroupResolver; /** - * @param CustomerRepositoryInterface $customerRepository + * @param CustomerGroupResolver $customerGroupResolver */ public function __construct( - CustomerRepositoryInterface $customerRepository + CustomerGroupResolver $customerGroupResolver ) { - $this->customerRepository = $customerRepository; + $this->customerGroupResolver = $customerGroupResolver; } /** @@ -43,12 +43,7 @@ public function execute(ContextParametersInterface $contextParameters): ContextP if ($contextParameters->getUserType() === UserContextInterface::USER_TYPE_GUEST) { $customerGroupId = Group::NOT_LOGGED_IN_ID; } elseif (!empty($extensionAttributes) && $extensionAttributes['is_customer'] === true) { - try { - $customer = $this->customerRepository->getById($contextParameters->getUserId()); - $customerGroupId = (int) $customer->getGroupId(); - } catch (LocalizedException $e) { - $customerGroupId = Group::NOT_LOGGED_IN_ID; - } + $customerGroupId = $this->customerGroupResolver->resolve((int) $contextParameters->getUserId()); } if ($customerGroupId !== null) { $contextParameters->addExtensionAttribute('customer_group_id', (int) $customerGroupId); From 98c0b0bb8bdec475109fcd822fd27d86c689bbd6 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 22 Nov 2020 12:37:08 +0200 Subject: [PATCH 252/490] adjusted comments to clarify that they were added for preserving backward compatibility --- .../Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml | 2 +- .../Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml | 2 +- .../Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml | 2 +- .../Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml | 2 +- .../AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml | 2 +- .../Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 4379fc283510d..afede97556513 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -61,7 +61,7 @@ <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index 2d8b8e9b8fb46..6b714e0d18726 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Fill customer group information--> - <comment userInput="Fill Account Information" stepKey="selectGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 1e09f308018d2..addf978235af4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,7 +48,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 215c888833885..7c2309eeb7be3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 48ce356a43174..db779a7340b07 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml index 61482d7f5a567..8bacc134c7ab8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml @@ -154,7 +154,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> From ff5f7f689a87ce4331773e6fc27e4f18d2114ca7 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Sun, 22 Nov 2020 15:30:35 -0600 Subject: [PATCH 253/490] MC-37484: Cart query error when trying to switch store view --- app/code/Magento/Quote/Model/PaymentMethodManagement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/PaymentMethodManagement.php b/app/code/Magento/Quote/Model/PaymentMethodManagement.php index b6e4bcf5ccc8f..d6768fe31ecb2 100644 --- a/app/code/Magento/Quote/Model/PaymentMethodManagement.php +++ b/app/code/Magento/Quote/Model/PaymentMethodManagement.php @@ -83,7 +83,7 @@ public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method) throw new InvalidTransitionException(__('The requested Payment Method is not available.')); } - $quote->save(); + $this->quoteRepository->save($quote); return $quote->getPayment()->getId(); } From 53ed515634f5a38a04eb32b93a69f12ae6695ab2 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 23 Nov 2020 10:30:58 +0200 Subject: [PATCH 254/490] add Copyright --- .../Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php | 5 +++++ .../Test/Unit/Model/Resolver/ProductUrlSuffixTest.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php index 761e4dabc9919..1d8cb6a391064 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/CategoryUrlSuffixTest.php @@ -1,4 +1,9 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver; use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix; diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php index 352bade3c6eef..e133ff8dc5855 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Test/Unit/Model/Resolver/ProductUrlSuffixTest.php @@ -1,4 +1,9 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver; use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\ProductUrlSuffix; From 4508c482a2ea3116832679223245ae91e37a60f5 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Mon, 23 Nov 2020 11:36:32 +0200 Subject: [PATCH 255/490] MC-37502: Create automated test for "Move Order to Archive" --- .../_files/order_with_invoice_shipment_creditmemo_rollback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php index f9330bc99ac14..123d44c4610d0 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -25,7 +25,7 @@ /** @var CreditmemoRepositoryInterface $creditmemoRepository */ $creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); /** @var OrderInterface $order */ -$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000111'); /** @var Registry $registry */ $registry = $objectManager->get(Registry::class); $registry->unregister('isSecureArea'); From 3adff7a93fd84bdcbb8b758119499bc5a528a417 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 13:02:13 +0200 Subject: [PATCH 256/490] adding AdminSetStockStatusActionGroup --- ...nfigurableProductPriceWithOutOfStockChildProductTest.xml | 5 ++++- .../Test/AdminCreateProductAttributeFromProductPageTest.xml | 2 +- .../AdminCreateProductAttributeRequiredTextFieldTest.xml | 3 ++- .../NoOptionAvailableToConfigureDisabledProductTest.xml | 6 +++++- ...efrontVerifyConfigurableProductLayeredNavigationTest.xml | 4 +++- .../Test/StorefrontVisibilityOfDuplicateProductTest.xml | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml index 8d41b276334a6..dd98df9325665 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml @@ -20,6 +20,9 @@ <scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToProductQuantity" after="waitForProductPageToLoad"/> <remove keyForRemoval="disableProduct"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="selectOutOfStock" after="scrollToProductQuantity"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectOutOfStock" after="scrollToProductQuantity"> + <argument name="stockStatus" value="Out of Stock"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 61ef389c7909e..7b3d19b0f7977 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -53,7 +53,7 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"/> <!-- Create New Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index 9a9d64617f7b5..cf36a13389fe0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -50,7 +50,8 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"/> + <!-- <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/> --> <!-- Create Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index aa2c19ebc17f4..b8bfde8896ba6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -121,7 +121,11 @@ <argument name="productId" value="$$createConfigChildProduct2.id$$"/> </actionGroup> <waitForPageLoad stepKey="waitForSecondChildProductPageLoad"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="outOfStockStatus"/> + + <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"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 9b046d5c71cfc..9be5c2351494b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -132,7 +132,9 @@ <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/> <waitForPageLoad stepKey="waitForProductPageToLoad"/> <scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="disableProduct"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="disableProduct"> + <argument name="stockStatus" value="Out of Stock"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 79705e679fb78..d6f4ae5e20a0f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -120,7 +120,7 @@ <actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductForm"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProduct"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="1" stepKey="selectInStock"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectInStock"/> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> From fe4a58f2533d49502a455b8436a29f88b463602a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 13:12:14 +0200 Subject: [PATCH 257/490] refactored --- .../Test/AdminCreateProductAttributeRequiredTextFieldTest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index cf36a13389fe0..4f4c4ad9ff7fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -51,7 +51,6 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"/> - <!-- <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/> --> <!-- Create Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> From 84e6e1e0d9cf8b3faa983627a37f7643aa135134 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 16:33:47 +0200 Subject: [PATCH 258/490] refactored AdminCreateOrderAddProductCheckboxTest --- ...ductToOrderAndCheckCheckboxActionGroup.xml | 19 +++++++++++++++++++ ...AdminCreateOrderAddProductCheckboxTest.xml | 19 +++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml new file mode 100644 index 0000000000000..8aa50526519b8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.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="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Simple Product to an Order. Checks of checkbox is checkedFills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked" after="selectProduct"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index baef605ad52af..718464f215fcb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -34,17 +34,20 @@ <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="$$createSimpleProduct.sku$$" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked"/> - + <actionGroup ref="AddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSkuFilterBundle"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchBundle"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToCheckColumn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyProductChecked"/> + <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createSimpleCustomer" stepKey="deleteSimpleCustomer"/> </after> </test> -</tests> +</tests> \ No newline at end of file From 3838099a2a35e4087365db405c3d8ce75d7c3b49 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 16:42:51 +0200 Subject: [PATCH 259/490] refactored --- .../AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml index 8aa50526519b8..b26a592d3442a 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> <annotations> - <description>Adds the provided Simple Product to an Order. Checks of checkbox is checkedFills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + <description>Adds the provided Simple Product to an Order. Checks if checkbox is checked. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> </annotations> <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked" after="selectProduct"/> From b542bd890ae8179d1403197a4a3f7907147fa3e0 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 16:50:57 +0200 Subject: [PATCH 260/490] Adding explicit values --- .../Test/AdminCreateProductAttributeFromProductPageTest.xml | 4 +++- .../Test/AdminCreateProductAttributeRequiredTextFieldTest.xml | 4 +++- .../Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 7b3d19b0f7977..c5401d87031e5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -53,7 +53,9 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> - <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> + <argument name="stockStatus" value="In Stock"/> + </actionGroup> <!-- Create New Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index 4f4c4ad9ff7fe..573877f9869d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -50,7 +50,9 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> - <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> + <argument name="stockStatus" value="In Stock"/> + </actionGroup> <!-- Create Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index d6f4ae5e20a0f..03351e16cbbaf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -120,7 +120,9 @@ <actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductForm"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProduct"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/> - <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectInStock"/> + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectInStock"> + <argument name="stockStatus" value="In Stock"/> + </actionGroup> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> From 4845457624e11d6d4c94d5b17713ed21e39378d9 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Mon, 23 Nov 2020 20:24:10 +0530 Subject: [PATCH 261/490] Code formatting --- .../Magento/LoginAsCustomer/_files/admin.php | 19 +++++++++++++++--- .../LoginAsCustomer/_files/admin_rollback.php | 20 ++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php index fc8cc3101a8d8..66acb3c70f9be 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin.php @@ -12,6 +12,9 @@ use Magento\User\Model\User; use Magento\Authorization\Model\RulesFactory; use Magento\Authorization\Model\Rules; +use Magento\Authorization\Model\ResourceModel\Role as RoleResource; +use Magento\Authorization\Model\ResourceModel\Rules as RulesResource; +use Magento\User\Model\ResourceModel\User as UserResource; //Creating a new admin user with a custom role to safely change role settings without affecting the main user's role. /** @var Role $role */ @@ -20,13 +23,20 @@ $role->setData('role_name', $role->getName()); $role->setRoleType(\Magento\Authorization\Model\Acl\Role\Group::ROLE_TYPE); $role->setUserType((string)\Magento\Authorization\Model\UserContextInterface::USER_TYPE_ADMIN); -$role->save(); + +/** @var RoleResource $roleResource */ +$roleResource = Bootstrap::getObjectManager()->get(RoleResource::class); +$roleResource->save($role); + /** @var Rules $rules */ $rules = Bootstrap::getObjectManager()->get(RulesFactory::class)->create(); $rules->setRoleId($role->getId()); //Granted all permissions. $rules->setResources([Bootstrap::getObjectManager()->get(\Magento\Framework\Acl\RootResource::class)->getId()]); -$rules->saveRel(); + +/** @var RulesResource $rulesResource */ +$rulesResource = Bootstrap::getObjectManager()->get(RulesResource::class); +$rulesResource->saveRel($rules); /** @var User $user */ $user = Bootstrap::getObjectManager()->create(User::class); @@ -37,4 +47,7 @@ ->setEmail('testadmin1@gmail.com') ->setIsActive(1) ->setRoleId($role->getId()); -$user->save(); + +/** @var UserResource $userResource */ +$userResource = Bootstrap::getObjectManager()->get(UserResource::class); +$userResource->save($user); \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php index 1e78339bf7cf1..aabfca018d974 100755 --- a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/admin_rollback.php @@ -12,17 +12,31 @@ use Magento\User\Model\User; use Magento\Authorization\Model\RulesFactory; use Magento\Authorization\Model\Rules; +use Magento\Authorization\Model\ResourceModel\Role as RoleResource; +use Magento\Authorization\Model\ResourceModel\Rules as RulesResource; +use Magento\User\Model\ResourceModel\User as UserResource; //Deleting the user and the role. /** @var User $user */ $user = Bootstrap::getObjectManager()->create(User::class); $user->load('TestAdmin1', 'username'); -$user->delete(); + +/** @var UserResource $userResource */ +$userResource = Bootstrap::getObjectManager()->get(UserResource::class); +$userResource->delete($user); + /** @var Role $role */ $role = Bootstrap::getObjectManager()->get(RoleFactory::class)->create(); $role->load('test_custom_role', 'role_name'); + /** @var Rules $rules */ $rules = Bootstrap::getObjectManager()->get(RulesFactory::class)->create(); $rules->load($role->getId(), 'role_id'); -$rules->delete(); -$role->delete(); + +/** @var RulesResource $rulesResource */ +$rulesResource = Bootstrap::getObjectManager()->get(RulesResource::class); +$rulesResource->delete($rules); + +/** @var RoleResource $roleResource */ +$roleResource = Bootstrap::getObjectManager()->get(RoleResource::class); +$roleResource->delete($role); From f4320523eaf3c59cd0fc61088f3a0d51170b90f4 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Mon, 23 Nov 2020 20:43:54 +0200 Subject: [PATCH 262/490] MC-37504: Create automated test for "Mass Action Archive Order" --- .../testsuite/Magento/Sales/_files/order_closed_rollback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php index 13263fd442713..4567294cec0a6 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php @@ -41,6 +41,6 @@ $registry->register('isSecureArea', false); $creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); -$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); +$creditMemoGridAggregator->purge('100001111', 'order_increment_id'); Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From 058a0be3cdd359be2b87e888bfeec04de639d03b Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 23 Nov 2020 20:53:22 +0200 Subject: [PATCH 263/490] Update app/code/Magento/CompareListGraphQl/etc/schema.graphqls Co-authored-by: Kevin Harper <keharper@users.noreply.github.com> --- app/code/Magento/CompareListGraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index ebae3ca0ff940..73ccb9ba4bc67 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -21,7 +21,7 @@ type CompareList { uid: ID! @doc(description: "The unique ID assigned to the compare list") items: [ComparableItem] @doc(description: "An array of products to compare") attributes: [ComparableAttribute] @doc(description: "An array of attributes that can be used for comparing products") - item_count: Int! + item_count: Int! @doc(description: "The number of items in the compare list") } type Customer { From 9640f32149764323992bb7caccabf8b4fd59498a Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 23 Nov 2020 20:53:36 +0200 Subject: [PATCH 264/490] Update app/code/Magento/CompareListGraphQl/etc/schema.graphqls Co-authored-by: Kevin Harper <keharper@users.noreply.github.com> --- app/code/Magento/CompareListGraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index 73ccb9ba4bc67..e533d476ddd59 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -60,5 +60,5 @@ type DeleteCompareListOutput { type AssignCompareListToCustomerOutput { result: Boolean! - compare_list: CompareList + compare_list: CompareList @doc(description: "The contents of the customer's compare list") } From 60460f6c4963e18ca8a7a8e36bb51b14ce71fe2b Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 21:18:57 +0200 Subject: [PATCH 265/490] refactored --- .../AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml index b26a592d3442a..67b10d6955775 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <actionGroup name="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> <annotations> <description>Adds the provided Simple Product to an Order. Checks if checkbox is checked. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> </annotations> From b61c19ee94bbe294f6d42f807cedd9d26c715450 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 21:19:57 +0200 Subject: [PATCH 266/490] refactored --- .../Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index 718464f215fcb..13b91fa605bca 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -34,7 +34,7 @@ <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> + <actionGroup ref="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> <argument name="product" value="$createSimpleProduct$"/> </actionGroup> From ba1a3393e5b09a141a2a06e11d15dad91a8e041c Mon Sep 17 00:00:00 2001 From: Evangelos Pallis <info.vpsnak@gmail.com> Date: Mon, 23 Nov 2020 22:17:20 +0200 Subject: [PATCH 267/490] Fix wrong format error DHL shipping label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix "The response is in wrong format." error while generating dhl shipping label. When product name has unicode characters substr() is sending � in <PieceContents> causing erros dhl syntax errors. --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index c5eb27b21e58b..ac82120893698 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1748,7 +1748,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') foreach ($package['items'] as $item) { $content[] = $item['name']; } - $nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34)); + $nodePiece->addChild('PieceContents', $this->string->substr(implode(',', $content), 0, 34)); } $nodeShipmentDetails->addChild('Weight', sprintf('%.3f', $rawRequest->getPackageWeight())); From d01898822c090f5a04d616271bd94c8ae3679672 Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Mon, 23 Nov 2020 15:02:25 -0600 Subject: [PATCH 268/490] ISSUE-30265 - Move iframe listener js out of iframe parent so safari can properly query for last-of-type on page load. --- .../catalog/product/composite/configure.phtml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml index 5ca88689b9e5f..d786f843e052f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml @@ -10,11 +10,6 @@ $blockId = $block->getId(); <div id="product_composite_configure" class="product-configure-popup product-configure-popup-<?= $block->escapeHtmlAttr($blockId) ?>"> <iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe"></iframe> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onload', - "window.productConfigure && productConfigure.onLoadIFrame()", - 'iframe[name=\'product_composite_configure_iframe\']:last-of-type' - ) ?> <form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data" target="product_composite_configure_iframe" class="product_composite_configure_form"> @@ -85,3 +80,8 @@ script; ?> <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?> </div> +<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onload', + "window.productConfigure && productConfigure.onLoadIFrame()", + 'iframe[name=\'product_composite_configure_iframe\']:last-of-type' +) ?> From 260cc0e5aa09a8938d4f8479447f429703087cb8 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Mon, 23 Nov 2020 15:09:05 -0600 Subject: [PATCH 269/490] MC-37484: Cart query error when trying to switch store view --- .../Quote/Test/Unit/Model/PaymentMethodManagementTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php index b9c7d8c93e724..bc5b811bc9611 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php @@ -136,7 +136,7 @@ public function testSetVirtualProduct() $quoteMock = $this->getMockBuilder(Quote::class) ->addMethods(['setTotalsCollectedFlag']) - ->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals', 'save']) + ->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals']) ->disableOriginalConstructor() ->getMock(); $this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock); @@ -189,7 +189,7 @@ public function testSetVirtualProduct() ->willReturn(true); $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf(); - $quoteMock->expects($this->once())->method('save')->willReturnSelf(); + $this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock); $paymentMock->expects($this->once())->method('getId')->willReturn($paymentId); $this->assertEquals($paymentId, $this->model->set($cartId, $methodMock)); @@ -267,7 +267,7 @@ public function testSetSimpleProduct() $quoteMock = $this->getMockBuilder(Quote::class) ->addMethods(['setTotalsCollectedFlag']) - ->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals', 'save']) + ->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals']) ->disableOriginalConstructor() ->getMock(); $this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock); @@ -324,7 +324,7 @@ public function testSetSimpleProduct() ->willReturn(true); $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf(); - $quoteMock->expects($this->once())->method('save')->willReturnSelf(); + $this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock); $paymentMock->expects($this->once())->method('getId')->willReturn($paymentId); $this->assertEquals($paymentId, $this->model->set($cartId, $methodMock)); From 3b8e183b9c960a9e857cc10f45aed09decf70bd8 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 23 Nov 2020 17:17:38 -0600 Subject: [PATCH 270/490] MC-38995: Customer group price is not working in product query graphql --- .../Context/AddCustomerGroupToContext.php | 1 - .../Customer/Model/Group/ResolverTest.php | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/Customer/Model/Group/ResolverTest.php diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php index d576475759a59..aaa2b85636f79 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php @@ -12,7 +12,6 @@ use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface; use Magento\Customer\Model\Group; use Magento\Customer\Model\Group\Resolver as CustomerGroupResolver; -use Magento\Framework\Exception\LocalizedException; /** * @inheritdoc diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Group/ResolverTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Group/ResolverTest.php new file mode 100644 index 0000000000000..0f85a94f639d1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Group/ResolverTest.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Customer\Model\Group; + +use PHPUnit\Framework\TestCase; +use Magento\TestFramework\Helper\Bootstrap; + +class ResolverTest extends TestCase +{ + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testResolve() + { + $customerId = 1; + $expectedGroupId = 1; + + $resolver = Bootstrap::getObjectManager()->create(Resolver::class); + $groupId = $resolver->resolve($customerId); + $this->assertEquals($groupId, $expectedGroupId); + } +} From 392345e9c1802be4b360c5050940b4b29a11ce54 Mon Sep 17 00:00:00 2001 From: mastiuhin-olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 24 Nov 2020 02:22:09 +0200 Subject: [PATCH 271/490] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design --- .../Model/ResourceModel/Product/Relation.php | 4 +- .../ResourceModel/Product/RelationTest.php | 55 +++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php index 2f8c4a34f0087..cc770bfb928d9 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php @@ -148,12 +148,12 @@ public function getRelationsByChildren(array $childrenIds): array $select = $connection->select() ->from( ['cpe' => $this->getTable('catalog_product_entity')], - 'entity_id' + ['relation.child_id', 'cpe.entity_id'] )->join( ['relation' => $this->getTable('catalog_product_relation')], 'relation.parent_id = cpe.' . $linkField )->where('relation.child_id IN(?)', $childrenIds); - return $connection->fetchCol($select); + return $connection->fetchPairs($select); } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php index e9fa6d5bf96b7..d221674ad7dc8 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php @@ -57,30 +57,53 @@ protected function setUp(): void */ public function testGetRelationsByChildren(): void { - // Find configurable products options - $productOptionSkus = ['simple_10', 'simple_20', 'simple_30', 'simple_40']; - $searchCriteria = $this->searchCriteriaBuilder->addFilter('sku', $productOptionSkus, 'in') + $childSkusOfParentSkus = [ + 'configurable' => ['simple_10', 'simple_20'], + 'configurable_12345' => ['simple_30', 'simple_40'], + ]; + $configurableSkus = [ + 'configurable', + 'configurable_12345', + 'simple_10', + 'simple_20', + 'simple_30', + 'simple_40', + ]; + $configurableIdsOfSkus = []; + + $searchCriteria = $this->searchCriteriaBuilder->addFilter('sku', $configurableSkus, 'in') ->create(); - $productOptions = $this->productRepository->getList($searchCriteria) + $configurableProducts = $this->productRepository->getList($searchCriteria) ->getItems(); - $productOptionsIds = []; + $childIds = []; - foreach ($productOptions as $productOption) { - $productOptionsIds[] = $productOption->getId(); + foreach ($configurableProducts as $product) { + $configurableIdsOfSkus[$product->getSku()] = $product->getId(); + + if ($product->getTypeId() != 'configurable') { + $childIds[] = $product->getId(); + } } - // Find configurable products - $searchCriteria = $this->searchCriteriaBuilder->addFilter('sku', ['configurable', 'configurable_12345'], 'in') - ->create(); - $configurableProducts = $this->productRepository->getList($searchCriteria) - ->getItems(); + $parentIdsOfChildIds = []; + + foreach ($childSkusOfParentSkus as $parentSku => $childSkus) { + foreach ($childSkus as $childSku) { + $childId = $configurableIdsOfSkus[$childSku]; + $parentIdsOfChildIds[$childId][] = $configurableIdsOfSkus[$parentSku]; + } + } - // Assert there are configurable products ids in result of getRelationsByChildren method. - $result = $this->model->getRelationsByChildren($productOptionsIds); + /** + * Assert there are parent configurable products ids in result of getRelationsByChildren method + * and they are related to child ids. + */ + $result = $this->model->getRelationsByChildren($childIds); - foreach ($configurableProducts as $configurableProduct) { - $this->assertContains($configurableProduct->getId(), $result); + foreach ($childIds as $childId) { + $this->assertArrayHasKey($childId, $result); + $this->assertContains($result[$childId], $parentIdsOfChildIds[$childId]); } } } From fc4481c60a770a548814e60aae1d493a8ef93384 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Tue, 24 Nov 2020 11:08:13 +0200 Subject: [PATCH 272/490] Removed 'indexer:reindex', 'cache:flush' commands and usage of AdminReindexAndFlushCache action group from tests --- ...tBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml | 3 +-- ...CheckNoAppearDefaultOptionConfigurableProductTest.xml | 2 +- .../AdminCreateCatalogPriceRuleForCustomerGroupTest.xml | 3 +-- ...onfigurableProductWithAssignedSimpleProducts2Test.xml | 2 +- ...CatalogRuleForConfigurableProductWithOptions2Test.xml | 2 +- ...heckboxIsDisabledCreatePermanentRedirectSetNoTest.xml | 4 ++-- ...ountDownloadableProductLinkAfterPartialRefundTest.xml | 9 ++++----- .../ActionGroup/AdminReindexAndFlushCacheActionGroup.xml | 9 +++++++++ ...ontPaypalSmartButtonWithFranceMerchantCountryTest.xml | 2 +- .../Test/Mftf/Test/StorefrontReorderAsGuestTest.xml | 5 ++--- 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml index fe4faed29d144..8b19753067593 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml @@ -48,8 +48,7 @@ <argument name="productId" value="$createFixedBundleProduct.id$"/> </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Perform reindex and flush cache--> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml index 507e4ae14e83c..2f38e16a44476 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml @@ -44,7 +44,7 @@ </actionGroup> <actionGroup ref="AdminSetQuantityToEachSkusConfigurableProductActionGroup" stepKey="saveConfigurable"/> <grabValueFrom selector="{{NewProductPageSection.sku}}" stepKey="grabSkuProduct"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="expandOption"> <argument name="categoryName" value="$$createCategory.name$$"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml index fb218297b646d..3c08fbdf641e4 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml @@ -27,8 +27,7 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> </before> <after> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml index 48f53da8e2a2e..ca9017b7c5f29 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml @@ -190,7 +190,7 @@ </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> <!-- Login to storefront from customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomerOnStorefront"> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml index 350f896606c19..b20bd34106e03 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml @@ -173,7 +173,7 @@ </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplySecondPriceRule"/> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> <!-- Assert product in storefront product page --> <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml index d529c6dd3ecc3..fc9eb8529da6f 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <magentoCLI command="config:set {{DisableCreatePermanentRedirect.path}} {{DisableCreatePermanentRedirect.value}}" stepKey="enableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createDefaultCategory"/> @@ -29,7 +29,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> <magentoCLI command="config:set {{EnableCreatePermanentRedirect.path}} {{EnableCreatePermanentRedirect.value}}" stepKey="disableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml index d82cc25b0eccf..dc48f600167a2 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml @@ -30,9 +30,8 @@ <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signIn"> @@ -51,8 +50,8 @@ <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart"> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml index d474094dcd54b..e7e7ba82bf09c 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml @@ -9,6 +9,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminReindexAndFlushCache"> <annotations> + <!-- + PLEASE NOTE: + The action group runs commands to reindex ALL indexers and to flush ALL cache types. + It's better to specify needed index (for reindexing) / cache type (for cache flushing). + Please use the following action groups: + - CliIndexerReindexActionGroup - run reindex by CLI with specified indexers + - CliCacheCleanActionGroup - run cache:clean by CLI with specified cache tags + - CliCacheFlushActionGroup - run cache:flush by CLI with specified cache tags + --> <description>Run reindex and flush cache.</description> </annotations> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml index a4d99ecbf7e61..7e3c4dab4588e 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml @@ -29,7 +29,7 @@ <!--Enable Advanced Setting--> <magentoCLI command="config:set {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.value}}" stepKey="enableSkipOrderReview"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.value}}" stepKey="disableSkipOrderReview"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml index 0718783534925..2b60c1d7ba550 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml @@ -24,9 +24,8 @@ </createData> <!-- Create Customer Account --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <!-- Reindex and flush cache --> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/> From be1d79a98253081ceb9bcf36f84fe6132f13a5b9 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 24 Nov 2020 13:41:22 +0200 Subject: [PATCH 273/490] revert return types --- .../Review/Ui/DataProvider/Product/ReviewDataProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index afedf98b50d90..e79ef14b3e3e0 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -102,7 +102,7 @@ private function getPreparedField(string $name): string /** * @inheritDoc */ - public function addOrder($field, $direction): void + public function addOrder($field, $direction) { $this->getCollection()->setOrder($this->getPreparedField($field), $direction); } @@ -112,7 +112,7 @@ public function addOrder($field, $direction): void * @since 100.1.0 * @return void */ - public function addFilter(Filter $filter): void + public function addFilter(Filter $filter) { $field = $filter->getField(); $filter->setField($this->getPreparedField($field)); From 12b1321ca255e5cb45638285b67f591cd9aacdd8 Mon Sep 17 00:00:00 2001 From: mastiuhin-olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 24 Nov 2020 16:59:58 +0200 Subject: [PATCH 274/490] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design --- .../Catalog/Model/ResourceModel/Product/Relation.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php index e5b0de7ad0308..9d2242b1f8283 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php @@ -155,6 +155,13 @@ public function getRelationsByChildren(array $childrenIds): array 'relation.parent_id = cpe.' . $linkField )->where('relation.child_id IN(?)', $childrenIds); - return $connection->fetchPairs($select); + $result = $connection->fetchAll($select); + $parentIdsOfChildIds = []; + + foreach ($result as $row) { + $parentIdsOfChildIds[$row['child_id']][] = $row['parent_id']; + } + + return $parentIdsOfChildIds; } } From 3f820e6a1662cc168163b3fb4f03eb2140beb3a8 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Tue, 24 Nov 2020 17:50:43 +0200 Subject: [PATCH 275/490] MC-37922: Html tag <br> visible in message --- .../Controller/Adminhtml/ImportResult.php | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php index 86fae141d1470..ed0bb3a7aa09f 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php @@ -9,6 +9,8 @@ use Magento\ImportExport\Model\Import\Entity\AbstractEntity; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; use Magento\ImportExport\Model\History as ModelHistory; +use Magento\Framework\Escaper; +use Magento\Framework\App\ObjectManager; /** * Import controller @@ -37,22 +39,31 @@ abstract class ImportResult extends Import */ protected $reportHelper; + /** + * @var Escaper|null + */ + protected $escaper; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\ImportExport\Model\Report\ReportProcessorInterface $reportProcessor * @param \Magento\ImportExport\Model\History $historyModel * @param \Magento\ImportExport\Helper\Report $reportHelper + * @param Escaper|null $escaper */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\ImportExport\Model\Report\ReportProcessorInterface $reportProcessor, \Magento\ImportExport\Model\History $historyModel, - \Magento\ImportExport\Helper\Report $reportHelper + \Magento\ImportExport\Helper\Report $reportHelper, + Escaper $escaper = null ) { parent::__construct($context); $this->reportProcessor = $reportProcessor; $this->historyModel = $historyModel; $this->reportHelper = $reportHelper; + $this->escaper = $escaper + ?? ObjectManager::getInstance()->get(Escaper::class); } /** @@ -69,22 +80,20 @@ protected function addErrorMessages( if ($errorAggregator->getErrorsCount()) { $message = ''; $counter = 0; - $unescapedMessages = []; + $escapedMessages = []; foreach ($this->getErrorMessages($errorAggregator) as $error) { - $unescapedMessages[] = (++$counter) . '. ' . $error; + $escapedMessages[] = (++$counter) . '. ' . $this->escaper->escapeHtml($error); if ($counter >= self::LIMIT_ERRORS_MESSAGE) { break; } } - foreach ($unescapedMessages as $unescapedMessage) { - $message .= $resultBlock->escapeHtml($unescapedMessage) . '<br>'; - } + $message .= implode('<br>', $escapedMessages); if ($errorAggregator->hasFatalExceptions()) { foreach ($this->getSystemExceptions($errorAggregator) as $error) { - $message .= $error->getErrorMessage() + $message .= $this->escaper->escapeHtml($error->getErrorMessage()) . ' <a href="#" onclick="$(this).next().show();$(this).hide();return false;">' . __('Show more') . '</a><div style="display:none;">' . __('Additional data') . ': ' - . $error->getErrorDescription() . '</div>'; + . $this->escaper->escapeHtml($error->getErrorDescription()) . '</div>'; } } try { From 719c206661d00fd526f43041b89d3ddd041154da Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Tue, 24 Nov 2020 11:05:16 -0600 Subject: [PATCH 276/490] MC-38787: Admin Product Grid Page indicator issue --- ...inGridPageNumberSetsToOneAfterNewSearchTest.xml | 14 ++++++++------ .../Section/AdminDataGridPaginationSection.xml | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml index f2dd87e74e9de..0cc57ba94dac6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml @@ -13,10 +13,10 @@ <annotations> <features value="Catalog"/> <stories value="Catalog grid"/> - <title value="Checking Catalog grid page number after entering a new search keyword"/> - <description value="Checking Catalog grid page number after entering a new search keyword"/> - <severity value="MINOR"/> - <testCaseId value="MC-xxxxx"/> + <title value="Updating the search keyword in admin product grid should reset current page to the first one"/> + <description value="When changing the search keyword in admin product grid, new results should be displayed from the page one"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-39332"/> <useCaseId value="MC-38787"/> <group value="Catalog"/> </annotations> @@ -82,14 +82,16 @@ <argument name="keyword" value="SimpleProduct"/> </actionGroup> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('4')}}" stepKey="seeTotalPagesIsFourOnFirstSearch"/> <comment userInput="Go to the next page" stepKey="nextPage"/> <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageProductGrid"/> - <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGrid"/> + <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGridOnFirstSearch"/> <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct"> <argument name="keyword" value="VirtualProduct"/> </actionGroup> - <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGrid"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('3')}}" stepKey="seeTotalPagesIsThreeOnSecondSearch"/> + <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGridOnSecondSearch"/> </test> </tests> diff --git a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridPaginationSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridPaginationSection.xml index 51cebdb01a74d..eaea88fdddb03 100644 --- a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridPaginationSection.xml +++ b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridPaginationSection.xml @@ -20,6 +20,7 @@ <element name="previousPage" type="button" selector="div.admin__data-grid-pager > button.action-previous" timeout="30"/> <element name="currentPage" type="input" selector="div.admin__data-grid-pager > input[data-ui-id='current-page-input']"/> <element name="totalPages" type="text" selector="div.admin__data-grid-pager > label"/> + <element name="totalPagesCount" type="text" selector="//div[@class='admin__data-grid-pager']//label[@class='admin__control-support-text' and .='of {{arg1}}']" parameterized="true"/> <element name="perPageDropDownValue" type="input" selector=".selectmenu-value input" timeout="30"/> <element name="selectedPage" type="input" selector="#sales_order_create_search_grid_page-current" timeout="30"/> <element name="nextPageActive" type="button" selector="div.admin__data-grid-pager > button.action-next:not(.disabled)" timeout="30"/> From 92dc76438063e68f7523d5ab036a57d7faf7bc03 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Tue, 24 Nov 2020 17:26:00 +0000 Subject: [PATCH 277/490] Update app/code/Magento/Cron/Model/DeadlockRetrier.php Co-authored-by: Buba Suma <bubasuma@users.noreply.github.com> --- app/code/Magento/Cron/Model/DeadlockRetrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Model/DeadlockRetrier.php b/app/code/Magento/Cron/Model/DeadlockRetrier.php index 63f7453c8df3c..ab180e93e0ca3 100644 --- a/app/code/Magento/Cron/Model/DeadlockRetrier.php +++ b/app/code/Magento/Cron/Model/DeadlockRetrier.php @@ -44,7 +44,7 @@ public function execute(callable $callback, AdapterInterface $connection) try { return $callback(); } catch (DeadlockException $e) { - $this->logger->warning(sprintf("Deadlock detected in cron cleanup: %s", $e->getMessage())); + $this->logger->warning(sprintf("Deadlock detected in cron: %s", $e->getMessage())); continue; } } From 81d13022b4aa4b7d5c07e26be54e412563bb02d6 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 23 Nov 2020 10:55:25 -0600 Subject: [PATCH 278/490] MC-38951: Images positions are inconsistent across store-views if images were added in a store-view level - Fix images positions for default scope if image were added in store view level --- .../Product/Helper/Form/Gallery/Content.php | 11 +- .../Model/Product/Gallery/ReadHandler.php | 32 ++++- .../Helper/Form/Gallery/ContentTest.php | 130 ++++++++++++++++++ .../Block/Product/View/GalleryTest.php | 102 ++++++++++++++ 4 files changed, 270 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php index 57cea59bee207..b06edc43cd71d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php @@ -209,7 +209,14 @@ public function getImagesJson() */ private function sortImagesByPosition($images) { - if (is_array($images)) { + $nullPositions = []; + foreach ($images as $index => $image) { + if ($image['position'] === null) { + $nullPositions[] = $image; + unset($images[$index]); + } + } + if (is_array($images) && !empty($images)) { usort( $images, function ($imageA, $imageB) { @@ -217,7 +224,7 @@ function ($imageA, $imageB) { } ); } - return $images; + return array_merge($images, $nullPositions); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php index a3726207b3024..ed2e09249e495 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php @@ -64,9 +64,9 @@ public function execute($entity, $arguments = []) $this->addMediaDataToProduct( $entity, - $mediaEntries + $this->sortMediaEntriesByPosition($mediaEntries) ); - + return $entity; } @@ -108,7 +108,7 @@ public function getAttribute() * Find default value * * @param string $key - * @param string[] &$image + * @param string[] $image * @return string * @deprecated 101.0.1 * @since 101.0.0 @@ -121,4 +121,30 @@ protected function findDefaultValue($key, &$image) return ''; } + + /** + * Sort media entries by position + * + * @param array $mediaEntries + * @return array + */ + private function sortMediaEntriesByPosition(array $mediaEntries): array + { + $mediaEntriesWithNullPositions = []; + foreach ($mediaEntries as $index => $mediaEntry) { + if ($mediaEntry['position'] === null) { + $mediaEntriesWithNullPositions[] = $mediaEntry; + unset($mediaEntries[$index]); + } + } + if (!empty($mediaEntries)) { + usort( + $mediaEntries, + function ($entryA, $entryB) { + return ($entryA['position'] < $entryB['position']) ? -1 : 1; + } + ); + } + return array_merge($mediaEntries, $mediaEntriesWithNullPositions); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php index 7e94484961f9e..28c5d435cd038 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php @@ -6,15 +6,20 @@ namespace Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Gallery\UpdateHandler; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\Framework\Registry; +use Magento\Store\Api\StoreRepositoryInterface; +use Magento\Store\Model\Store; use Magento\TestFramework\Helper\Bootstrap; /** * @magentoAppArea adminhtml + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class ContentTest extends \PHPUnit\Framework\TestCase { @@ -35,6 +40,16 @@ class ContentTest extends \PHPUnit\Framework\TestCase */ private $dataPersistor; + /** + * @var StoreRepositoryInterface + */ + private $storeRepository; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + /** * @inheritdoc */ @@ -51,6 +66,8 @@ protected function setUp(): void $this->block->setElement($gallery); $this->registry = Bootstrap::getObjectManager()->get(Registry::class); $this->dataPersistor = Bootstrap::getObjectManager()->get(DataPersistorInterface::class); + $this->storeRepository = Bootstrap::getObjectManager()->create(StoreRepositoryInterface::class); + $this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); } public function testGetUploader() @@ -120,6 +137,119 @@ public function getImagesAndImageTypesDataProvider() ]; } + /** + * Tests images positions in store view + * + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @magentoDataFixture Magento/Store/_files/second_store.php + * @dataProvider imagesPositionStoreViewDataProvider + * @param string $addFromStore + * @param array $newImages + * @param string $viewFromStore + * @param array $expectedImages + * @return void + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function testImagesPositionStoreView( + string $addFromStore, + array $newImages, + string $viewFromStore, + array $expectedImages + ): void { + $storeId = (int)$this->storeRepository->get($addFromStore)->getId(); + $product = $this->getProduct($storeId); + $images = $product->getData('media_gallery')['images']; + $images = array_merge($images, $newImages); + $product->setData('media_gallery', ['images' => $images]); + $updateHandler = Bootstrap::getObjectManager()->create(UpdateHandler::class); + $updateHandler->execute($product); + $storeId = (int)$this->storeRepository->get($viewFromStore)->getId(); + $product = $this->getProduct($storeId); + $this->registry->register('current_product', $product); + $actualImages = array_map( + function ($item) { + return [ + 'file' => $item['file'], + 'label' => $item['label'], + 'position' => $item['position'], + ]; + }, + json_decode($this->block->getImagesJson(), true) + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + } + + /** + * @return array[] + */ + public function imagesPositionStoreViewDataProvider(): array + { + return [ + [ + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'default', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => null, + 'position' => null, + ], + ] + ], + [ + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'New Image Alt Text', + 'position' => 2, + ], + ] + ] + ]; + } + + /** + * Returns product for testing. + * + * @param int $storeId + * @param string $sku + * @return ProductInterface + */ + private function getProduct(int $storeId = Store::DEFAULT_STORE_ID, string $sku = 'simple'): ProductInterface + { + return $this->productRepository->get($sku, false, $storeId, true); + } + /** * Prepare product, and set it to registry and data persistor. * diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php index b57969280cdf3..2941349a94eaa 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php @@ -9,6 +9,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Gallery\UpdateHandler; use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\View\LayoutInterface; @@ -392,6 +393,107 @@ public function galleryImagesOnStoreViewDataProvider(): array ]; } + /** + * Tests images positions in store view + * + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @magentoDataFixture Magento/Store/_files/second_store.php + * @magentoConfigFixture default/web/url/catalog_media_url_format image_optimization_parameters + * @dataProvider imagesPositionStoreViewDataProvider + * @param string $addFromStore + * @param array $newImages + * @param string $viewFromStore + * @param array $expectedImages + * @return void + */ + public function testImagesPositionStoreView( + string $addFromStore, + array $newImages, + string $viewFromStore, + array $expectedImages + ): void { + $storeId = (int)$this->storeRepository->get($addFromStore)->getId(); + $product = $this->getProduct($storeId); + $images = $product->getData('media_gallery')['images']; + $images = array_merge($images, $newImages); + $product->setData('media_gallery', ['images' => $images]); + $updateHandler = Bootstrap::getObjectManager()->create(UpdateHandler::class); + $updateHandler->execute($product); + $storeId = (int)$this->storeRepository->get($viewFromStore)->getId(); + $product = $this->getProduct($storeId); + $this->block->setData('product', $product); + $actualImages = array_map( + function ($item) { + return [ + 'img' => parse_url($item['img'], PHP_URL_PATH), + 'caption' => $item['caption'], + 'position' => $item['position'], + ]; + }, + $this->serializer->unserialize($this->block->getGalleryImagesJson()) + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + } + + /** + * @return array[] + */ + public function imagesPositionStoreViewDataProvider(): array + { + return [ + [ + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'default', + [ + [ + 'img' => '/media/catalog/product/m/a/magento_image.jpg', + 'caption' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'img' => '/media/catalog/product/m/a/magento_small_image.jpg', + 'caption' => 'Simple Product', + 'position' => null, + ], + ] + ], + [ + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'fixture_second_store', + [ + [ + 'img' => '/media/catalog/product/m/a/magento_image.jpg', + 'caption' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'img' => '/media/catalog/product/m/a/magento_small_image.jpg', + 'caption' => 'New Image Alt Text', + 'position' => 2, + ], + ] + ] + ]; + } + /** * Updates product gallery images and saves product. * From 0c01b2bc70ecc43aa96cb6bdac3532214e131a00 Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Tue, 24 Nov 2020 13:04:22 -0600 Subject: [PATCH 279/490] MC-38765: Ensure there are no split db specific tests --- .../TestFramework/Deploy/CliCommand.php | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php index 43aacecb6982e..a6522abde04f6 100644 --- a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php +++ b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php @@ -111,46 +111,6 @@ public function disableModule($moduleName) return $this->shell->execute($disableModuleCommand); } - /** - * Split quote db configuration. - * - * @return void - * @throws LocalizedException - */ - public function splitQuote() - { - $initParams = $this->parametersHolder->getInitParams(); - $installParams = $this->toCliArguments( - $this->parametersHolder->getDbData('checkout') - ); - $command = $this->getCliScriptCommand() . ' setup:db-schema:split-quote ' . - implode(" ", array_keys($installParams)) . - ' -vvv --no-interaction --magento-init-params="' . - $initParams['magento-init-params'] . '"'; - - $this->shell->execute($command, array_values($installParams)); - } - - /** - * Split sales db configuration. - * - * @return void - * @throws LocalizedException - */ - public function splitSales() - { - $initParams = $this->parametersHolder->getInitParams(); - $installParams = $this->toCliArguments( - $this->parametersHolder->getDbData('sales') - ); - $command = $this->getCliScriptCommand() . ' setup:db-schema:split-sales ' . - implode(" ", array_keys($installParams)) . - ' -vvv --magento-init-params="' . - $initParams['magento-init-params'] . '"'; - - $this->shell->execute($command, array_values($installParams)); - } - /** * Clean all types of cache */ From 2afabfa318ae5edaca48b4f12df426e3aa4edc8f Mon Sep 17 00:00:00 2001 From: Victor Rad <vrad@magento.com> Date: Tue, 24 Nov 2020 14:11:55 -0600 Subject: [PATCH 280/490] MC-38122: Admin: New user notification email: Custom template not picked up --- .../Magento/User/etc/adminhtml/system.xml | 5 ++ .../email_template_new_user_notification.php | 19 +++++ .../testsuite/Magento/User/Model/UserTest.php | 69 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php diff --git a/app/code/Magento/User/etc/adminhtml/system.xml b/app/code/Magento/User/etc/adminhtml/system.xml index 584b40a023c93..8b619c4f9cf48 100644 --- a/app/code/Magento/User/etc/adminhtml/system.xml +++ b/app/code/Magento/User/etc/adminhtml/system.xml @@ -14,6 +14,11 @@ <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment> <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> </field> + <field id="new_user_notification_template" translate="label comment" type="select" sortOrder="50" showInDefault="1" canRestore="1"> + <label>New User Notification Template</label> + <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment> + <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> + </field> </group> <group id="security"> <field id="lockout_failures" translate="label comment" sortOrder="100" showInDefault="1" canRestore="1"> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php new file mode 100644 index 0000000000000..d5f9ad6889bac --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var \Magento\Email\Model\Template $template */ +$template = $objectManager->create(\Magento\Email\Model\Template::class); +$template->setOptions(['area' => 'test area', 'store' => 1]); +$template->setData( + [ + 'template_text' => 'New User Notification Custom Text', + 'template_code' => 'New User Notification Custom Code', + 'template_type' => \Magento\Email\Model\Template::TYPE_TEXT, + 'orig_template_code' => 'admin_emails_new_user_notification_template' + ] +); +$template->save(); diff --git a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php index 90b1706ed4e22..96530baf2b888 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php @@ -13,6 +13,11 @@ use Magento\Framework\Stdlib\DateTime; use Magento\TestFramework\Helper\Bootstrap; use Magento\User\Model\User as UserModel; +use Magento\Email\Model\ResourceModel\Template\Collection as TemplateCollection; +use Magento\Framework\Exception\NotFoundException; +use Magento\Framework\Phrase; +use Magento\Framework\App\Config\MutableScopeConfigInterface; +use Magento\TestFramework\Mail\Template\TransportBuilderMock; /** * @magentoAppArea adminhtml @@ -565,4 +570,68 @@ public function testPerformIdentityCheckLockExpires() . 'Please wait and try again later.' ); } + + /** + * Verify custom notification is sent when new user created + * + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Email/Model/_files/email_template_new_user_notification.php + */ + public function testSendNotificationEmailsIfRequired() + { + /** @var MutableScopeConfigInterface $config */ + $config = Bootstrap::getObjectManager()->get(MutableScopeConfigInterface::class); + $config->setValue( + 'admin/emails/new_user_notification_template', + $this->getCustomEmailTemplateIdForNewUserNotification() + ); + $userModel = Bootstrap::getObjectManager()->create( + \Magento\User\Model\User::class + ); + $userModel->setFirstname( + 'John' + )->setLastname( + 'Doe' + )->setUsername( + 'user2' + )->setPassword( + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + )->setEmail( + 'user@magento.com' + ); + $userModel->save(); + $userModel->sendNotificationEmailsIfRequired(); + /** @var TransportBuilderMock $transportBuilderMock */ + $transportBuilderMock = Bootstrap::getObjectManager()->get(TransportBuilderMock::class); + $sentMessage = $transportBuilderMock->getSentMessage(); + $this->assertSame( + 'New User Notification Custom Text', + $sentMessage->getBodyText() + ); + } + + /** + * Return email template id for new user notification + * + * @return int|null + * @throws NotFoundException + */ + private function getCustomEmailTemplateIdForNewUserNotification(): ?int + { + $templateId = null; + $templateCollection = Bootstrap::getObjectManager()->get(TemplateCollection::class); + $origTemplateCode = 'admin_emails_new_user_notification_template'; + foreach ($templateCollection as $template) { + if ($template->getOrigTemplateCode() == $origTemplateCode) { + $templateId = (int) $template->getId(); + } + } + if ($templateId === null) { + throw new NotFoundException(new Phrase( + 'Customized %templateCode% email template not found', + ['templateCode' => $origTemplateCode] + )); + } + return $templateId; + } } From 377da7bd1ea269e9362eb9d380c541422a507ecd Mon Sep 17 00:00:00 2001 From: mastiuhin-olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 24 Nov 2020 22:40:43 +0200 Subject: [PATCH 281/490] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design --- .../ResourceModel/Product/RelationTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php index d221674ad7dc8..914427a024d26 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php @@ -105,5 +105,41 @@ public function testGetRelationsByChildren(): void $this->assertArrayHasKey($childId, $result); $this->assertContains($result[$childId], $parentIdsOfChildIds[$childId]); } + + $parentIdsOfChildIds = []; + + foreach ($childSkusOfParentSkus as $parentSku => $childSkus) { + foreach ($childSkus as $childSku) { + $childId = $configurableIdsOfSkus[$childSku]; + $parentIdsOfChildIds[$childId][] = $configurableIdsOfSkus[$parentSku]; + } + } + + /** + * Assert there are parent configurable products ids in result of getRelationsByChildren method + * and they are related to child ids. + */ + $result = $this->model->getRelationsByChildren($childIds); + $sortedResult = $this->sortParentIdsOfChildIds($result); + $sortedExpected = $this->sortParentIdsOfChildIds($parentIdsOfChildIds); + + $this->assertEquals($sortedExpected, $sortedResult); + } + + /** + * Sorts the "Parent Ids Of Child Ids" type of the array + * + * @param array $array + * @return array + */ + private function sortParentIdsOfChildIds(array $array): array + { + foreach ($array as $childId => &$parentIds) { + sort($parentIds, SORT_NUMERIC); + } + + ksort($array, SORT_NUMERIC); + + return $array; } } From 7f362ab7a35e540fba30103f79a3ff8ed51baee7 Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar.dahiwala@briteskies.com> Date: Tue, 24 Nov 2020 16:42:48 -0500 Subject: [PATCH 282/490] magento/partners-magento2b2b#501: mftf fails to rerun when logsout - Updating CE test when log out performed after customer is deleted --- .../Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml | 2 ++ ...ontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml | 2 ++ .../Test/StorefrontPurchaseProductWithCustomOptionsTest.xml | 2 ++ ...urchaseProductWithCustomOptionsWithLongValuesTitleTest.xml | 2 ++ ...pplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml | 4 +++- ...ontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml | 3 ++- .../StorefrontDisplayTableRatesShippingMethodForAETest.xml | 2 ++ 7 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml index b2b71c4ad3eca..ab5f18780082b 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml @@ -22,6 +22,8 @@ <after> <!-- 6. Restore default configuration settings. --> <magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/> + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index 2080aee933aad..4bf7dc0e08812 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -48,6 +48,8 @@ </before> <after> + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 631d1d50077e9..34af0706e30d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -31,6 +31,8 @@ <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </before> <after> + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <!-- Delete product and category --> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml index aac76999636b0..ce419167e9514 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml @@ -33,6 +33,8 @@ <createData entity="Simple_US_Customer" stepKey="createCustomer"/> </before> <after> + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index b90cc66a10d68..a40bf63c5a388 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -38,7 +38,9 @@ <!-- Delete products and category --> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <!-- Delete customer --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml index 4f85b9167fa54..4032d49c74000 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml @@ -33,7 +33,8 @@ <after> <closeTab stepKey="closeLoginAsCustomerTab"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml index d448f51a00406..c174517375779 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml @@ -27,6 +27,8 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> + <!-- Customer Log Out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> From a07160eba32e4bd0431901f0b7c8171de2a663de Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Wed, 25 Nov 2020 00:15:56 +0200 Subject: [PATCH 283/490] MC-37500: Create automated test for "Shipment Sales Archive" --- app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml | 1 + .../Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename app/code/Magento/{Shipping => Sales}/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml (80%) diff --git a/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml index d35a8ab5c4538..41d58bb61942a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminShipmentPage" url="sales/shipment/" area="admin" module="Magento_Sales"> <section name="AdminShipmentGridSection"/> + <section name="AdminShipmentsGridFiltersSection"/> </page> </pages> diff --git a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml similarity index 80% rename from app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml rename to app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml index 6e5b197286bf3..ad1ec54e213ee 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml @@ -9,6 +9,6 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminShipmentsGridFiltersSection"> - <element name="orderNum" type="input" selector="input[name='order_increment_id']"/> + <element name="orderNumber" type="input" selector="input[name='order_increment_id']"/> </section> </sections> From fe9f62683ffb09611322e13751eff97e3fe9d2a2 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 24 Nov 2020 16:29:24 -0600 Subject: [PATCH 284/490] MC-38995: Customer group price is not working in product query graphql --- .../GraphQl/Catalog/ProductPriceTest.php | 214 ++++++++++++------ 1 file changed, 139 insertions(+), 75 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php index b6c4b55dc1d23..ceb52354fa6eb 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php @@ -15,6 +15,8 @@ use Magento\ConfigurableProduct\Api\LinkManagementInterface; use Magento\ConfigurableProduct\Model\LinkManagement; use Magento\Customer\Model\Group; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\GraphQl\Customer\LockCustomer; use Magento\Framework\ObjectManager\ObjectManager; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -27,11 +29,23 @@ class ProductPriceTest extends GraphQlAbstract /** @var ProductRepositoryInterface $productRepository */ private $productRepository; + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + /** + * @var LockCustomer + */ + private $lockCustomer; + protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); /** @var ProductRepositoryInterface $productRepository */ $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->customerTokenService = $this->objectManager->get(CustomerTokenServiceInterface::class); + $this->lockCustomer = $this->objectManager->get(LockCustomer::class); } /** @@ -235,10 +249,20 @@ public function testMultipleProductTypes() * Simple products with special price and tier price with % discount * * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @param int $customerGroup + * @param array $expectedPriceRange + * @param array $expectedTierPrices + * @param array $customerData + * @param bool $isTierPriceExists + * @dataProvider priceDataProvider */ - public function testSimpleProductsWithSpecialPriceAndTierPrice() - { + public function testSimpleProductsWithSpecialPriceAndTierPrice( + int $customerGroup, + array $expectedPriceRange, + array $expectedTierPrices, + array $customerData + ) { $skus = ["simple1", "simple2"]; $tierPriceFactory = $this->objectManager->get(ProductTierPriceInterfaceFactory::class); @@ -249,7 +273,7 @@ public function testSimpleProductsWithSpecialPriceAndTierPrice() $tierPrices[] = $tierPriceFactory->create( [ 'data' => [ - 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'customer_group_id' => $customerGroup, 'qty' => 2 ] ] @@ -260,97 +284,137 @@ public function testSimpleProductsWithSpecialPriceAndTierPrice() $simpleProduct->setTierPrices($tierPrices); $this->productRepository->save($simpleProduct); } + + $headerMap = []; + if (!empty($customerData)) { + $customerToken = $this->customerTokenService->createCustomerAccessToken( + $customerData['username'], + $customerData['password'] + ); + $headerMap = ['Authorization' => 'Bearer ' . $customerToken]; + } + $query = $this->getProductQuery($skus); - $result = $this->graphQlQuery($query); + $result = $this->graphQlQuery($query, [], '', $headerMap); $this->assertArrayNotHasKey('errors', $result); $this->assertCount(2, $result['products']['items']); - $expectedPriceRange = [ - "simple1" => [ - "minimum_price" => [ - "regular_price" => [ - "value" => 10 - ], - "final_price" => [ - "value" => 5.99 + foreach ($result['products']['items'] as $product) { + $this->assertNotEmpty($product['price_range']); + $this->assertNotEmpty($product['price_tiers']); + $this->assertPrices($expectedPriceRange[$product['sku']], $product['price_range']); + $this->assertResponseFields($product['price_tiers'], $expectedTierPrices[$product['sku']]); + } + } + + /** + * Data provider for prices + * + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function priceDataProvider() : array + { + return [ + [ + 'customer_group' => Group::CUST_GROUP_ALL, + 'expected_price_range' => [ + "simple1" => [ + "minimum_price" => [ + "regular_price" => ["value" => 10], + "final_price" => ["value" => 5.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 40.1] + ], + "maximum_price" => [ + "regular_price" => ["value" => 10], + "final_price" => ["value" => 5.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 40.1] + ] ], - "discount" => [ - "amount_off" => 4.01, - "percent_off" => 40.1 + "simple2" => [ + "minimum_price" => [ + "regular_price" => ["value" => 20], + "final_price" => ["value" => 15.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 20.05] + ], + "maximum_price" => [ + "regular_price" => ["value" => 20], + "final_price" => ["value" => 15.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 20.05] + ] ] ], - "maximum_price" => [ - "regular_price" => [ - "value" => 10 + 'expected_tier_prices' => [ + "simple1" => [ + 0 => [ + 'discount' =>['amount_off' => 1, 'percent_off' => 10], + 'final_price' =>['value'=> 9], + 'quantity' => 2 + ] ], - "final_price" => [ - "value" => 5.99 - ], - "discount" => [ - "amount_off" => 4.01, - "percent_off" => 40.1 + "simple2" => [ + 0 => [ + 'discount' =>['amount_off' => 2, 'percent_off' => 10], + 'final_price' =>['value'=> 18], + 'quantity' => 2 + ] ] - ] + ], + 'customer_data' => [] ], - "simple2" => [ - "minimum_price" => [ - "regular_price" => [ - "value" => 20 - ], - "final_price" => [ - "value" => 15.99 + [ + 'customer_group' => 1, + 'expected_price_range' => [ + "simple1" => [ + "minimum_price" => [ + "regular_price" => ["value" => 10], + "final_price" => ["value" => 5.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 40.1] + ], + "maximum_price" => [ + "regular_price" => ["value" => 10], + "final_price" => ["value" => 5.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 40.1] + ] ], - "discount" => [ - "amount_off" => 4.01, - "percent_off" => 20.05 + "simple2" => [ + "minimum_price" => [ + "regular_price" => ["value" => 20], + "final_price" => ["value" => 15.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 20.05] + ], + "maximum_price" => [ + "regular_price" => ["value" => 20], + "final_price" => ["value" => 15.99], + "discount" => ["amount_off" => 4.01, "percent_off" => 20.05] + ] ] ], - "maximum_price" => [ - "regular_price" => [ - "value" => 20 + 'expected_tier_prices' => [ + "simple1" => [ + 0 => [ + 'discount' =>['amount_off' => 1, 'percent_off' => 10], + 'final_price' =>['value'=> 9], + 'quantity' => 2 + ] ], - "final_price" => [ - "value" => 15.99 - ], - "discount" => [ - "amount_off" => 4.01, - "percent_off" => 20.05 + "simple2" => [ + 0 => [ + 'discount' =>['amount_off' => 2, 'percent_off' => 10], + 'final_price' =>['value'=> 18], + 'quantity' => 2 + ] ] - ] - ] - ]; - $expectedTierPrices = [ - "simple1" => [ - 0 => [ - 'discount' =>[ - 'amount_off' => 1, - 'percent_off' => 10 - ], - 'final_price' =>['value'=> 9], - 'quantity' => 2 + ], + 'customer_data' => [ + 'username' => 'customer@example.com', + 'password' => 'password' ] ], - "simple2" => [ - 0 => [ - 'discount' =>[ - 'amount_off' => 2, - 'percent_off' => 10 - ], - 'final_price' =>['value'=> 18], - 'quantity' => 2 - ] - - ] ]; - - foreach ($result['products']['items'] as $product) { - $this->assertNotEmpty($product['price_range']); - $this->assertNotEmpty($product['price_tiers']); - $this->assertPrices($expectedPriceRange[$product['sku']], $product['price_range']); - $this->assertResponseFields($product['price_tiers'], $expectedTierPrices[$product['sku']]); - } } + /** * Check the pricing for a grouped product with simple products having special price set * From e0b71b9d6e27d21f89fb689ba64b8fd1bd5ac3fd Mon Sep 17 00:00:00 2001 From: David Haecker <dhaecker@magento.com> Date: Tue, 24 Nov 2020 21:27:14 -0600 Subject: [PATCH 285/490] magento/partners-magento2b2b#244: Allow new billing address when adding PO payment detail - Cleaning up StorefrontFinalCheckoutBillingAddressPurchaseOrderTest --- ...lickUpdateAddressInCheckoutActionGroup.xml | 19 ++++++++++++++++ ...ssInCheckoutAddressDropDownActionGroup.xml | 22 +++++++++++++++++++ ...ressOnPaymentStepInCheckoutActionGroup.xml | 22 +++++++++++++++++++ .../Section/StorefrontOrderDetailsSection.xml | 2 ++ .../AdminGoToNewTaxRulePageActionGroup.xml | 18 +++++++++++++++ .../AdminSaveTaxRuleActionGroup.xml | 20 +++++++++++++++++ 6 files changed, 103 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickUpdateAddressInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectAddressInCheckoutAddressDropDownActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectCustomerAddressOnPaymentStepInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminGoToNewTaxRulePageActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminSaveTaxRuleActionGroup.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickUpdateAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickUpdateAddressInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..e83fc452b6962 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickUpdateAddressInCheckoutActionGroup.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="StorefrontClickUpdateAddressInCheckoutActionGroup"> + <annotations> + <description>Clicks the Update button on the checkout page when entering a New Address.</description> + </annotations> + <waitForElementVisible selector="{{CheckoutShippingSection.updateAddress}}" stepKey="waitForUpdateButton"/> + <click selector="{{CheckoutShippingSection.updateAddress}}" stepKey="clickUpdateButton"/> + <waitForPageLoad stepKey="waitForAddressSaved"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectAddressInCheckoutAddressDropDownActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectAddressInCheckoutAddressDropDownActionGroup.xml new file mode 100644 index 0000000000000..39338d490bc35 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectAddressInCheckoutAddressDropDownActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontSelectAddressInCheckoutAddressDropDownActionGroup"> + <annotations> + <description>Selects the specified option in the address selection drop down on the storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="address" defaultValue="New Address" type="string"/> + </arguments> + <waitForElementVisible selector="{{CheckoutPaymentSection.addressDropdown}}" stepKey="waitForAddressDropDownToBeVisible"/> + <selectOption selector="{{CheckoutPaymentSection.addressDropdown}}" userInput="{{address}}" stepKey="selectAddressOption"/> + <waitForPageLoad stepKey="waitForAddressLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectCustomerAddressOnPaymentStepInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectCustomerAddressOnPaymentStepInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..574ede3fe54d1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectCustomerAddressOnPaymentStepInCheckoutActionGroup.xml @@ -0,0 +1,22 @@ +<?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="StorefrontSelectCustomerAddressOnPaymentStepInCheckoutActionGroup"> + <annotations> + <description>Selects the specified address after 'Change Address' pop up has been opened on the Storefront Checkout page on the 'Payment' step.</description> + </annotations> + <arguments> + <argument name="address" type="string"/> + </arguments> + <waitForElementVisible selector="{{CheckoutBillingAddressSearchSection.selectButton(address)}}" stepKey="waitForAddress"/> + <click selector="{{CheckoutBillingAddressSearchSection.selectButton(address)}}" stepKey="clickSelectForAddress"/> + <waitForElementNotVisible selector="{{CheckoutShippingAddressSearchSection.popupSelectShippingAddress}}" stepKey="waitForPopupClosed"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml index d1c94965640c5..12beba19b4375 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml @@ -14,6 +14,8 @@ <element name="billingAddressBlock" type="block" selector=".box-order-billing-address > .box-content > address"/> <element name="discountSalesRule" type="text" selector="tr.discount span.price"/> <element name="shippingTotalDescription" type="text" selector="#my-orders-table tr.shipping th.mark"/> + <element name="tax" type="text" selector=".totals-tax .price"/> + <element name="grandTotalIncludingTax" type="text" selector=".grand_total_incl .amount"/> <element name="grandTotalPrice" type="text" selector="tr.grand_total span.price"/> <element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/> <element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminGoToNewTaxRulePageActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminGoToNewTaxRulePageActionGroup.xml new file mode 100644 index 0000000000000..ce16cfb73df67 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminGoToNewTaxRulePageActionGroup.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="AdminGoToNewTaxRulePageActionGroup"> + <annotations> + <description>Go to the create New Tax Rule page.</description> + </annotations> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRulePage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminSaveTaxRuleActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminSaveTaxRuleActionGroup.xml new file mode 100644 index 0000000000000..cf9f734b06f2d --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminSaveTaxRuleActionGroup.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="AdminSaveTaxRuleActionGroup"> + <annotations> + <description>Clicks the Save Rule button on the Tax Rule page.</description> + </annotations> + <waitForElementVisible selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="waitForSaveButton"/> + <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForSave"/> + <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rule." stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> From c480c4d490d1f7f65386ded1aac9473501b2a2c8 Mon Sep 17 00:00:00 2001 From: Andrii Dimov <andimov@gmail.com> Date: Tue, 24 Nov 2020 23:37:45 -0900 Subject: [PATCH 286/490] MCP-51: Update performance measurement infrastructure to work with JMeter 5 --- setup/performance-toolkit/benchmark.jmx | 2287 ++++++++++++++--------- 1 file changed, 1370 insertions(+), 917 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index 948135268b864..22f2c25135c3a 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -2389,16 +2389,21 @@ function doCache(){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -2923,16 +2928,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -3236,16 +3246,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -3303,16 +3318,21 @@ function doCache(){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -3574,16 +3594,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -3998,16 +4023,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -4319,16 +4349,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -5096,16 +5131,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -5635,16 +5675,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -6204,16 +6249,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -7345,16 +7395,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -8682,16 +8737,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -9171,16 +9231,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -10338,16 +10403,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -11078,16 +11148,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -11559,16 +11634,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -12337,16 +12417,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -13115,16 +13200,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -13594,12 +13684,12 @@ vars.put("attribute_set_filter", new String(encodedBytes)); <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); +int number1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); -number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); @@ -20041,16 +20131,21 @@ function addConfigurableMatrix(attributes) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -20420,7 +20515,7 @@ vars.put("admin_user", adminUser); if (categoryList.size() > 1) { do { int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = categoryList.get(index).parseInt(); + newCategoryId = Integer.parseInt(categoryList.get(index)); } while (categoryId == newCategoryId); vars.put("category_additional", newCategoryId.toString()); @@ -22556,16 +22651,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -23448,16 +23548,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -24226,16 +24331,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -24484,7 +24594,6 @@ vars.put("admin_user", adminUser); import java.util.Random; Random random = new Random(); -int number1 = 1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } @@ -25566,16 +25675,21 @@ catch (java.lang.Exception e) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -25669,16 +25783,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -25788,16 +25907,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -25956,16 +26080,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -26074,16 +26203,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -26605,16 +26739,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -27042,16 +27181,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -27559,16 +27703,21 @@ vars.put("adminImportFilePath", filepath); </stringProp> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -28076,16 +28225,21 @@ vars.put("adminImportFilePath", filepath); </stringProp> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -28179,16 +28333,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -28360,16 +28519,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -28624,16 +28788,21 @@ if (testLabel <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -29669,16 +29838,21 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -30354,16 +30528,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -32504,16 +32683,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -33416,16 +33600,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -33994,12 +34183,12 @@ vars.put("attribute_set_filter", new String(encodedBytes)); <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); +int number1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); -number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); @@ -39623,16 +39812,21 @@ if (name == null) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -39745,16 +39939,21 @@ vars.putObject("category", categories[number]); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -39869,16 +40068,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -39993,16 +40197,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40117,16 +40326,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40241,16 +40455,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40384,16 +40603,21 @@ if (totalCount == null) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40532,16 +40756,21 @@ function assertCategoryChildren(category, response) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40679,16 +40908,21 @@ function assertCategoryChildren(category, response) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40827,16 +41061,21 @@ if(response.data.categoryList.length !== 4){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -40975,16 +41214,21 @@ if(response.data.categories.items.length !== 4){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41071,16 +41315,21 @@ if(response.data.categories.items.length != 20){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41194,16 +41443,21 @@ vars.putObject("category", categories[number]); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41314,16 +41568,21 @@ vars.put("cms_page_id", cmsPages[number].id); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41436,16 +41695,21 @@ vars.putObject("category", categories[number]); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41548,16 +41812,21 @@ vars.putObject("randomIntGenerator", random); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41699,16 +41968,21 @@ vars.putObject("randomIntGenerator", random); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -41889,16 +42163,21 @@ vars.putObject("randomIntGenerator", random); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -42079,16 +42358,21 @@ vars.putObject("randomIntGenerator", random); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -42251,16 +42535,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -42471,16 +42760,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -42729,16 +43023,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -43035,16 +43334,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -43294,16 +43598,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -43601,16 +43910,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -43859,16 +44173,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -44165,16 +44484,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -44392,16 +44716,21 @@ vars.put("coupon_code", coupons[number].code); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -44658,16 +44987,21 @@ vars.put("coupon_code", coupons[number].code); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -45170,16 +45504,21 @@ vars.put("cms_page_id", cmsPages[number].id); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -45809,16 +46148,21 @@ function doCache(){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -46122,16 +46466,21 @@ vars.put("product_sku", product.get("sku")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -46189,16 +46538,21 @@ function doCache(){ <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -46460,16 +46814,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -46884,16 +47243,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -47205,16 +47569,21 @@ vars.put("product_url_key", product); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -47982,16 +48351,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -48521,16 +48895,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -49090,16 +49469,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -50231,16 +50615,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -51568,16 +51957,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -52291,16 +52685,21 @@ customerUserList.add(vars.get("customer_email")); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -52772,16 +53171,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -53550,16 +53954,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -54328,16 +54737,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -54807,12 +55221,12 @@ vars.put("attribute_set_filter", new String(encodedBytes)); <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; import java.util.Random; Random random = new Random(); +int number1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } number = random.nextInt(props.get("simple_products_list_for_edit").size()); -number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); simpleList = props.get("simple_products_list_for_edit").get(number); vars.put("simple_product_1_id", simpleList.get("id")); @@ -61254,16 +61668,21 @@ function addConfigurableMatrix(attributes) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -61633,7 +62052,7 @@ vars.put("admin_user", adminUser); if (categoryList.size() > 1) { do { int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = categoryList.get(index).parseInt(); + newCategoryId = Integer.parseInt(categoryList.get(index)); } while (categoryId == newCategoryId); vars.put("category_additional", newCategoryId.toString()); @@ -63752,16 +64171,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -64644,16 +65068,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -65422,16 +65851,21 @@ vars.put("grid_pages_count_filtered", pageCount); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -65680,7 +66114,6 @@ vars.put("admin_user", adminUser); import java.util.Random; Random random = new Random(); -int number1 = 1; if (${seedForRandom} > 0) { random.setSeed(${seedForRandom}); } @@ -66745,16 +67178,21 @@ catch (java.lang.Exception e) { <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -67790,16 +68228,21 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -68475,16 +68918,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> @@ -70625,16 +71073,21 @@ vars.put("admin_user", adminUser); <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> -var testLabel = "${testLabel}" ? " (${testLabel})" : ""; -if (testLabel - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } -} else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); -} +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> From db7cab675b788f3b9d55b1a6a79a2371b494ed34 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 25 Nov 2020 10:48:18 +0200 Subject: [PATCH 287/490] MC-37922: Html tag <br> visible in message --- .../ImportExport/Controller/Adminhtml/ImportResult.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php index ed0bb3a7aa09f..4092879e23622 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/ImportResult.php @@ -87,16 +87,16 @@ protected function addErrorMessages( break; } } - $message .= implode('<br>', $escapedMessages); if ($errorAggregator->hasFatalExceptions()) { foreach ($this->getSystemExceptions($errorAggregator) as $error) { - $message .= $this->escaper->escapeHtml($error->getErrorMessage()) + $escapedMessages[] = $this->escaper->escapeHtml($error->getErrorMessage()) . ' <a href="#" onclick="$(this).next().show();$(this).hide();return false;">' . __('Show more') . '</a><div style="display:none;">' . __('Additional data') . ': ' . $this->escaper->escapeHtml($error->getErrorDescription()) . '</div>'; } } try { + $message .= implode('<br>', $escapedMessages); $resultBlock->addNotice( '<strong>' . __('Following Error(s) has been occurred during importing process:') . '</strong><br>' . '<div class="import-error-wrapper">' . __('Only the first 100 errors are shown. ') From 82ad80307386d6a90a3812c21da8f397c908e07a Mon Sep 17 00:00:00 2001 From: mastiuhin-olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Wed, 25 Nov 2020 11:08:38 +0200 Subject: [PATCH 288/490] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design --- .../ResourceModel/Product/RelationTest.php | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php index 914427a024d26..20d366d05ac4a 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/RelationTest.php @@ -95,26 +95,6 @@ public function testGetRelationsByChildren(): void } } - /** - * Assert there are parent configurable products ids in result of getRelationsByChildren method - * and they are related to child ids. - */ - $result = $this->model->getRelationsByChildren($childIds); - - foreach ($childIds as $childId) { - $this->assertArrayHasKey($childId, $result); - $this->assertContains($result[$childId], $parentIdsOfChildIds[$childId]); - } - - $parentIdsOfChildIds = []; - - foreach ($childSkusOfParentSkus as $parentSku => $childSkus) { - foreach ($childSkus as $childSku) { - $childId = $configurableIdsOfSkus[$childSku]; - $parentIdsOfChildIds[$childId][] = $configurableIdsOfSkus[$parentSku]; - } - } - /** * Assert there are parent configurable products ids in result of getRelationsByChildren method * and they are related to child ids. From 945f2bd9b74eb54238217629623124a10f55fa26 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 25 Nov 2020 12:12:17 +0200 Subject: [PATCH 289/490] MC-37922: Html tag <br> visible in message --- .../_files/invalid_catalog_products.csv | 3 + .../Controller/Adminhtml/ImportResultTest.php | 87 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Import/_files/invalid_catalog_products.csv create mode 100644 dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Import/_files/invalid_catalog_products.csv b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Import/_files/invalid_catalog_products.csv new file mode 100644 index 0000000000000..f873a7c89ee53 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Import/_files/invalid_catalog_products.csv @@ -0,0 +1,3 @@ +sku,_store,_attribute_set,product_type,categories,_product_websites,color,cost,country_of_manufacture,created_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,description,gallery,gift_message_available,gift_wrapping_available,gift_wrapping_price,has_options,image,image_label,is_returnable,manufacturer,meta_description,meta_keyword,meta_title,minimal_price,msrp,msrp_display_actual_price_type,name,news_from_date,news_to_date,options_container,page_layout,price,quantity_and_stock_status,related_tgtr_position_behavior,related_tgtr_position_limit,required_options,short_description,small_image,small_image_label,special_from_date,special_price,special_to_date,status,tax_class_id,thumbnail,thumbnail_label,updated_at,upsell_tgtr_position_behavior,upsell_tgtr_position_limit,url_key,url_path,visibility,weight,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,notify_stock_qty,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_sku,_related_position,_crosssell_sku,_crosssell_position,_upsell_sku,_upsell_position,_tier_price_website,_tier_price_customer_group,_tier_price_qty,_tier_price_price,_media_attribute_id,_media_image,_media_label,_media_position,_media_is_disabled,_associated_sku,_associated_default_qty,_associated_position +"",,Default,simple,,base,,,,"2014-12-25 19:52:47",,,,,,,,,,0,,,"No",,"simple product 1 ","simple product 1","simple product 1",,,,"simple product 1",,,"Block after Info Column",,100.0000,"In Stock",,,0,,,,,,,1,2,,,"2014-12-25 19:52:47",,,simple-product-1,,"catalog, search",,123.0000,0.0000,1,0,0,1,1.0000,1,0.0000,1,1,,1,1,0,1,0.0000,1,0,0,1,,,,,,,,,,,,,,,,,, +"",,Default,simple,,base,,,,"2014-12-25 19:53:14",,,,,,,,,,0,,,"No",,"simple product 2 ","simple product 2","simple product 2",,,,"simple product 2",,,"Block after Info Column",,200.0000,"In Stock",,,0,,,,,,,1,2,,,"2014-12-25 19:53:14",,,simple-product-2,,"catalog, search",,234.0000,0.0000,1,0,0,1,1.0000,1,0.0000,1,1,,1,1,0,1,0.0000,1,0,0,1,,,,,,,,,,,,,,,,,, diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php new file mode 100644 index 0000000000000..ccd9e29e90a18 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\ImportExport\Controller\Adminhtml; + +use Magento\Framework\Filesystem\DirectoryList; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Controller\Adminhtml\Import\HttpFactoryMock; + +/** + * @magentoAppArea adminhtml + */ +class ImportResultTest extends \Magento\TestFramework\TestCase\AbstractBackendController +{ + /** + * @dataProvider validationDataProvider + * @param string $fileName + * @param string $mimeType + * @param string $delimiter + * @throws \Magento\Framework\Exception\FileSystemException + * @backupGlobals enabled + * @magentoDbIsolation enabled + * @SuppressWarnings(PHPMD.Superglobals) + */ + public function testAddErrorMessages(string $fileName, string $mimeType, string $delimiter): void + { + $validationStrategy = ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_STOP_ON_ERROR; + + $this->getRequest()->setParam('isAjax', true); + $this->getRequest()->setMethod('POST'); + $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; + + /** @var $formKey \Magento\Framework\Data\Form\FormKey */ + $formKey = $this->_objectManager->get(\Magento\Framework\Data\Form\FormKey::class); + $this->getRequest()->setPostValue('form_key', $formKey->getFormKey()); + $this->getRequest()->setPostValue('entity', 'catalog_product'); + $this->getRequest()->setPostValue('behavior', 'append'); + $this->getRequest()->setPostValue(Import::FIELD_NAME_VALIDATION_STRATEGY, $validationStrategy); + $this->getRequest()->setPostValue(Import::FIELD_NAME_ALLOWED_ERROR_COUNT, 0); + $this->getRequest()->setPostValue('_import_field_separator', $delimiter); + + /** @var \Magento\TestFramework\App\Filesystem $filesystem */ + $filesystem = $this->_objectManager->get(\Magento\Framework\Filesystem::class); + $tmpDir = $filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); + $subDir = str_replace('\\', '_', __CLASS__); + $tmpDir->create($subDir); + $target = $tmpDir->getAbsolutePath("{$subDir}/{$fileName}"); + copy(__DIR__ . "/Import/_files/{$fileName}", $target); + + $_FILES = [ + 'import_file' => [ + 'name' => $fileName, + 'type' => $mimeType, + 'tmp_name' => $target, + 'error' => 0, + 'size' => filesize($target) + ] + ]; + + $this->_objectManager->configure( + [ + 'preferences' => [FileTransferFactory::class => HttpFactoryMock::class] + ] + ); + + $this->dispatch('backend/admin/import/validate'); + $this->assertStringNotContainsString('<br>', $this->getResponse()->getBody()); + } + + /** + * @return array + */ + public function validationDataProvider(): array + { + return [ + [ + 'file_name' => 'invalid_catalog_products.csv', + 'mime-type' => 'text/csv', + 'delimiter' => ',', + ], + ]; + } +} From be7872aa9374e45ac089d732c93f50df9faaa373 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 25 Nov 2020 13:10:29 +0200 Subject: [PATCH 290/490] remove clearing cache for integration tests --- .../testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php | 3 +-- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 -- .../Magento/Catalog/Controller/Adminhtml/ProductTest.php | 3 --- .../testsuite/Magento/Catalog/Model/ConfigTest.php | 3 --- .../Product/Attribute/Source/CountryofmanufactureTest.php | 1 - .../Model/ResourceModel/Attribute/Entity/AttributeTest.php | 1 - .../DataProvider/Product/Form/Modifier/CategoriesTest.php | 1 - .../Magento/Customer/Model/AddressMetadataTest.php | 1 - .../Magento/Customer/Model/CustomerMetadataTest.php | 1 - .../testsuite/Magento/Directory/Block/DataTest.php | 2 -- .../integration/testsuite/Magento/Eav/Model/ConfigTest.php | 6 ------ .../Model/Entity/Attribute/Frontend/DefaultFrontendTest.php | 1 - .../Magento/Eav/Model/Entity/AttributeLoaderTest.php | 1 - .../testsuite/Magento/Framework/App/Config/InitialTest.php | 2 -- .../Framework/App/ObjectManager/ConfigLoaderTest.php | 1 - .../testsuite/Magento/Framework/App/Route/ConfigTest.php | 1 - .../Magento/Framework/DB/Adapter/Pdo/MysqlTest.php | 1 - .../Magento/Framework/Reflection/MethodsMapTest.php | 2 -- .../testsuite/Magento/Framework/TranslateTest.php | 1 - .../Element/UiComponent/Config/Provider/TemplateTest.php | 1 - .../testsuite/Magento/ProductAlert/Model/ObserverTest.php | 1 - .../Controller/Adminhtml/Dashboard/IndexTest.php | 3 --- .../testsuite/Magento/Store/Model/StoreResolverTest.php | 1 - .../Magento/Theme/Model/Theme/ThemeProviderTest.php | 1 - .../Magento/Translation/Model/Js/PreProcessorTest.php | 1 - 25 files changed, 1 insertion(+), 41 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 7b14fe9159c57..2d0892b78c246 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -154,7 +154,6 @@ private function compareFilterNames(array $a, array $b) */ public function testLayeredNavigationForConfigurableProducts() { - CacheCleaner::cleanAll(); $attributeCode = 'test_configurable'; /** @var Config $eavConfig */ @@ -258,7 +257,7 @@ private function getQueryProductsWithArrayOfCustomAttributes($attributeCode, $fi */ public function testFilterProductsByDropDownCustomAttribute() { - CacheCleaner::cleanAll(); + CacheCleaner::clean(['eav']); $attributeCode = 'second_test_configurable'; $optionValue = $this->getDefaultAttributeOptionValue($attributeCode); $query = <<<QUERY diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index b12630d70713a..d93f6d486c504 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -224,8 +224,6 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->cleanAll(); - //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index 7032199e9fc4c..8b18f89542494 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -138,9 +138,6 @@ public function testSaveActionAndDuplicateWithUrlPathAttribute() $urlPathAttribute = $product->getCustomAttribute('url_path'); $this->assertEquals($urlPathAttribute->getValue(), $product->getSku()); - // clean cache - CacheCleaner::cleanAll(); - // dispatch Save&Duplicate action and check it $this->assertSaveAndDuplicateAction($product); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php index 36379adcee601..8320ef979180f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php @@ -31,7 +31,6 @@ protected function setUp(): void public function testGetEntityAttributeCodes() { $entityType = 'catalog_product'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getEntityAttributeCodes($entityType), $this->config->getEntityAttributeCodes($entityType) @@ -42,7 +41,6 @@ public function testGetAttribute() { $entityType = 'catalog_product'; $attributeCode = 'color'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getAttribute($entityType, $attributeCode), $this->config->getAttribute($entityType, $attributeCode) @@ -52,7 +50,6 @@ public function testGetAttribute() public function testGetEntityType() { $entityType = 'catalog_product'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getEntityType($entityType), $this->config->getEntityType($entityType) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php index 33e82e9f6ddcc..8b8f54af2d387 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetAllOptions() { - CacheCleaner::cleanAll(); $allOptions = $this->model->getAllOptions(); $cachedAllOptions = $this->model->getAllOptions(); $this->assertEquals($allOptions, $cachedAllOptions); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php index 5b9c7b267f188..7d9e9a48093cb 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php @@ -52,7 +52,6 @@ class AttributeTest extends \PHPUnit\Framework\TestCase */ protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); $this->attributeRepository = $this->objectManager->get(AttributeRepository::class); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php index 8ad346af068b4..d5e7d94ec0cae 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php @@ -39,7 +39,6 @@ public function testModifyMeta() { $inputMeta = include __DIR__ . '/_files/input_meta_for_categories.php'; $expectedCategories = include __DIR__ . '/_files/expected_categories.php'; - CacheCleaner::cleanAll(); $this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta)); // Verify cached data $this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta)); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php index 647c386e2b784..4443d170e388a 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php @@ -19,7 +19,6 @@ class AddressMetadataTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->configure( [ diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php index c3e08b5294679..63d7019ee4f61 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php @@ -29,7 +29,6 @@ class CustomerMetadataTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->configure( [\Magento\Framework\Api\ExtensionAttribute\Config\Reader::class => [ diff --git a/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php b/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php index ea2368a35c2f2..ccc1ea3f2f0b9 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php @@ -22,7 +22,6 @@ protected function setUp(): void public function testGetCountryHtmlSelect() { - CacheCleaner::cleanAll(); $result = $this->block->getCountryHtmlSelect(); $resultTwo = $this->block->getCountryHtmlSelect(); $this->assertEquals($result, $resultTwo); @@ -30,7 +29,6 @@ public function testGetCountryHtmlSelect() public function testGetRegionHtmlSelect() { - CacheCleaner::cleanAll(); $result = $this->block->getRegionHtmlSelect(); $resultTwo = $this->block->getRegionHtmlSelect(); $this->assertEquals($result, $resultTwo); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php index a2865d52517fa..63fcfbd061877 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php @@ -33,7 +33,6 @@ protected function setUp(): void public function testGetEntityAttributeCodes() { $entityType = 'test'; - CacheCleaner::cleanAll(); $entityAttributeCodes1 = $this->config->getEntityAttributeCodes($entityType); $this->assertEquals( [ @@ -60,7 +59,6 @@ public function testGetEntityAttributeCodesWithObject() $testEntityType = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Entity\Type::class) ->loadByCode('test'); $attributeSetId = $testEntityType->getDefaultAttributeSetId(); - CacheCleaner::cleanAll(); $object = new DataObject( [ 'attribute_set_id' => $attributeSetId, @@ -86,7 +84,6 @@ public function testGetEntityAttributeCodesWithObject() public function testGetAttributes() { $entityType = 'test'; - CacheCleaner::cleanAll(); $attributes1 = $this->config->getAttributes($entityType); $expectedAttributeCodes = [ 'attribute_for_search_1', @@ -111,7 +108,6 @@ public function testGetAttributes() public function testGetAttribute() { $entityType = 'test'; - CacheCleaner::cleanAll(); $attribute1 = $this->config->getAttribute($entityType, 'attribute_for_search_1'); $this->assertEquals('attribute_for_search_1', $attribute1->getAttributeCode()); $this->assertEquals('varchar', $attribute1->getBackendType()); @@ -153,8 +149,6 @@ public function testGetAttributeWithCacheUserDefinedAttribute() $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); $updatedAttribute = $config->getAttribute($entityType, 'foo'); $this->assertEquals('foo', $updatedAttribute->getFrontendLabel()); - // Clean cache - CacheCleaner::cleanAll(); $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); // Check that attribute data has changed $updatedAttributeAfterCacheClean = $config->getAttribute($entityType, 'foo'); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php index b27e81129e1c3..cb7d288deb75a 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php @@ -55,7 +55,6 @@ class DefaultFrontendTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->defaultFrontend = $this->objectManager->get(DefaultFrontend::class); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php index 7a0c66e7e2db2..817c37bca528b 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php @@ -32,7 +32,6 @@ class AttributeLoaderTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->attributeLoader = $this->objectManager->get(AttributeLoader::class); $entityType = $this->objectManager->create(\Magento\Eav\Model\Entity\Type::class) diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php index 43203d38e308f..2b3ebc217ab7b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetMetadata() { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getMetadata(), $this->objectManager->create(Config::class)->getMetadata() @@ -37,7 +36,6 @@ public function testGetMetadata() */ public function testGetData($scope) { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getData($scope), $this->objectManager->create(Config::class)->getData($scope) diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php index 1a2b8772c2dc5..ed4e15bd78a0c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testLoad() { - CacheCleaner::cleanAll(); $data = $this->object->load('global'); $this->assertNotEmpty($data); $cachedData = $this->object->load('global'); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php index ff37b7d847921..d0c8c6083caee 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php @@ -28,7 +28,6 @@ protected function setUp(): void */ public function testGetRouteFrontName($route, $scope) { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getRouteFrontName($route, $scope), $this->objectManager->create(Config::class)->getRouteFrontName($route, $scope) diff --git a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php index 6e3391bd8959f..a93e8c198336e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php @@ -27,7 +27,6 @@ protected function setUp(): void set_error_handler(null); $this->resourceConnection = Bootstrap::getObjectManager() ->get(ResourceConnection::class); - CacheCleaner::cleanAll(); } protected function tearDown(): void diff --git a/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php b/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php index 585933422edb8..cbe3c552544d4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetMethodsMap() { - CacheCleaner::cleanAll(); $data = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class); $this->assertArrayHasKey('getMethodsMap', $data); $cachedData = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class); @@ -33,7 +32,6 @@ public function testGetMethodsMap() public function testGetMethodParams() { - CacheCleaner::cleanAll(); $data = $this->object->getMethodParams( \Magento\Framework\Reflection\MethodsMap::class, 'getMethodParams' diff --git a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php index 5b48a9169c577..b216831bde33e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php @@ -94,7 +94,6 @@ protected function setUp(): void public function testLoadData() { $data = $this->translate->loadData(null, true)->getData(); - CacheCleaner::cleanAll(); $this->translate->loadData()->getData(); $dataCached = $this->translate->loadData()->getData(); $this->assertEquals($data, $dataCached); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php index f58882ee51493..92a51b85c8c4b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php @@ -49,7 +49,6 @@ public function testGetTemplate() \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); $this->objectManager->get(\Magento\Framework\View\DesignInterface::class) ->setDesignTheme('FrameworkViewUiComponent/default'); - CacheCleaner::cleanAll(); $resultOne = $this->model->getTemplate('test.xml'); $resultTwo = $this->model->getTemplate('test.xml'); diff --git a/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php index 287564722ced6..b28788bc649a1 100644 --- a/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php @@ -93,7 +93,6 @@ public function testProcessPortuguese() $secondStore = $storeRepository->get('fixture_second_store'); // check if Portuguese language is specified for the second store - CacheCleaner::cleanAll(); $storeResolver = $this->_objectManager->get(Resolver::class); $storeResolver->emulate($secondStore->getId()); $this->assertEquals('pt_BR', $storeResolver->getLocale()); diff --git a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php index 9358d761b28b2..63c5e04bac84a 100644 --- a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php @@ -44,7 +44,6 @@ public function testExecute() { $content = include __DIR__ . '/../../../_files/validContent.php'; - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn($content); @@ -62,7 +61,6 @@ public function testExecute() public function testExecuteEmptyContent() { - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn('[]'); @@ -77,7 +75,6 @@ public function testExecuteEmptyContent() public function testExecuteFalseContent() { - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn(false); diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php index 53c58cc693a6e..c20b0ed27bf52 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php @@ -28,7 +28,6 @@ public function testGetStoreData() $storeResolver = $this->objectManager->get(\Magento\Store\Model\StoreResolver::class); $storesDataRead = $methodReadStoresData->invoke($storeResolver); - CacheCleaner::cleanAll(); $storesData = $methodGetStoresData->invoke($storeResolver); $storesDataCached = $methodGetStoresData->invoke($storeResolver); $this->assertEquals($storesDataRead, $storesData); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php index 2f3d7065e5339..e2895a478b8d9 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php @@ -33,7 +33,6 @@ protected function setUp(): void $this->themeProviderOne = $objectManager->create(ThemeProvider::class); $this->themeProviderTwo = clone $this->themeProviderOne; $this->themeCollection = $objectManager->create(ThemeCollection::class); - CacheCleaner::clean(); } public function testGetThemeById() diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php b/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php index 4bc1c5b55ade5..842912546ece8 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php @@ -82,7 +82,6 @@ protected function tearDown(): void */ public function testProcess(string $content, string $translation) { - CacheCleaner::cleanAll(); $this->assertEquals($translation, $this->model->translate($content)); } From 09293a587a174c463c8f3d3ff5de775bf372c97c Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Wed, 25 Nov 2020 07:21:45 -0600 Subject: [PATCH 291/490] MC-38787: Admin Product Grid Page indicator issue --- ...hProductGridByStringNoClearActionGroup.xml | 2 +- ...dPageNumberSetsToOneAfterNewSearchTest.xml | 60 +++++++++++-------- ...GridAssertCurrentPageNumberActionGroup.xml | 22 +++++++ ...minGridAssertTotalPageCountActionGroup.xml | 22 +++++++ .../AdminGridGoToNextPageActionGroup.xml | 19 ++++++ 5 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertCurrentPageNumberActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertTotalPageCountActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToNextPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml index a763f37ed153f..95ddfd37c0037 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml @@ -13,7 +13,7 @@ <description>Searches the Admin Products grid by string without clearing filters.</description> </annotations> <arguments> - <argument name="keyword" type="string"/> + <argument name="keyword" defaultValue="" type="string"/> </arguments> <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml index 0cc57ba94dac6..f833171166141 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml @@ -9,7 +9,6 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminGridPageNumberSetsToOneAfterNewSearchTest"> - <annotations> <features value="Catalog"/> <stories value="Catalog grid"/> @@ -27,27 +26,28 @@ <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProductIfTheyExist"/> - <createData stepKey="category1" entity="SimpleSubCategory"/> - <createData stepKey="simpleProduct1" entity="SimpleProduct"> + <!-- Create required prerequisites --> + <createData entity="SimpleSubCategory" stepKey="category1"/> + <createData entity="SimpleProduct" stepKey="simpleProduct1"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="simpleProduct2" entity="SimpleProduct"> + <createData entity="SimpleProduct" stepKey="simpleProduct2"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="simpleProduct3" entity="SimpleProduct"> + <createData entity="SimpleProduct" stepKey="simpleProduct3"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="simpleProduct4" entity="SimpleProduct"> + <createData entity="SimpleProduct" stepKey="simpleProduct4"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="virtualProduct1" entity="VirtualProduct"> + <createData entity="VirtualProduct" stepKey="virtualProduct1"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="virtualProduct2" entity="VirtualProduct"> + <createData entity="VirtualProduct" stepKey="virtualProduct2"> <requiredEntity createDataKey="category1"/> </createData> - <createData stepKey="virtualProduct3" entity="VirtualProduct"> + <createData entity="VirtualProduct" stepKey="virtualProduct3"> <requiredEntity createDataKey="category1"/> </createData> </before> @@ -59,39 +59,47 @@ </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> - <deleteData stepKey="deleteCategory1" createDataKey="category1"/> - - <deleteData stepKey="deleteSimpleProduct1" createDataKey="simpleProduct1"/> - <deleteData stepKey="deleteSimpleProduct2" createDataKey="simpleProduct2"/> - <deleteData stepKey="deleteSimpleProduct3" createDataKey="simpleProduct3"/> - <deleteData stepKey="deleteSimpleProduct4" createDataKey="simpleProduct4"/> - <deleteData stepKey="deleteVirtualProduct1" createDataKey="virtualProduct1"/> - <deleteData stepKey="deleteVirtualProduct2" createDataKey="virtualProduct2"/> - <deleteData stepKey="deleteVirtualProduct3" createDataKey="virtualProduct3"/> + <!-- Delete prerequisites --> + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/> + <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> + <deleteData createDataKey="virtualProduct2" stepKey="deleteVirtualProduct2"/> + <deleteData createDataKey="virtualProduct3" stepKey="deleteVirtualProduct3"/> + <deleteData createDataKey="category1" stepKey="deleteCategory1"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> + <!-- Set the product grid to display one product per page --> <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1ProductPerPage"> <argument name="perPage" value="ProductPerPage.productCount"/> </actionGroup> + <!-- Performing the first search and assertions --> <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForSimpleProduct"> <argument name="keyword" value="SimpleProduct"/> </actionGroup> + <actionGroup ref="AdminGridAssertTotalPageCountActionGroup" stepKey="waitForTotalPagesCountFourToBeVisible"> + <argument name="expectedTotalPageCount" value="4"/> + </actionGroup> + <actionGroup ref="AdminGridGoToNextPageActionGroup" stepKey="clickNextPageProductGrid"/> + <actionGroup ref="AdminGridAssertCurrentPageNumberActionGroup" stepKey="assertCurrentPageIsTwoOnProductGridFirstSearch"> + <argument name="expectedCurrentPageNumber" value="2"/> + </actionGroup> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('4')}}" stepKey="seeTotalPagesIsFourOnFirstSearch"/> - <comment userInput="Go to the next page" stepKey="nextPage"/> - <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageProductGrid"/> - <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGridOnFirstSearch"/> - + <!-- Performing the second search and assertions of successful current page number reset --> <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct"> <argument name="keyword" value="VirtualProduct"/> </actionGroup> - - <waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('3')}}" stepKey="seeTotalPagesIsThreeOnSecondSearch"/> - <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGridOnSecondSearch"/> + <actionGroup ref="AdminGridAssertTotalPageCountActionGroup" stepKey="waitForTotalPagesCountThreeToBeVisible"> + <argument name="expectedTotalPageCount" value="3"/> + </actionGroup> + <actionGroup ref="AdminGridAssertCurrentPageNumberActionGroup" stepKey="assertCurrentPageIsOneOnProductGridSecondSearch"> + <argument name="expectedCurrentPageNumber" value="1"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertCurrentPageNumberActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertCurrentPageNumberActionGroup.xml new file mode 100644 index 0000000000000..1765dbe1e7fcd --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertCurrentPageNumberActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminGridAssertCurrentPageNumberActionGroup"> + <annotations> + <description> + Assert current page number on admin grid + </description> + </annotations> + <arguments> + <argument name="expectedCurrentPageNumber" defaultValue="1" type="string"/> + </arguments> + + <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="{{expectedCurrentPageNumber}}" stepKey="seeCurrentPageNumberOnGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertTotalPageCountActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertTotalPageCountActionGroup.xml new file mode 100644 index 0000000000000..402bd077f9fbb --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridAssertTotalPageCountActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminGridAssertTotalPageCountActionGroup"> + <annotations> + <description> + Assert total page count on admin grid + </description> + </annotations> + <arguments> + <argument name="expectedTotalPageCount" defaultValue="1" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('expectedTotalPageCount')}}" stepKey="waitForTotalPagesCountToBeVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToNextPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToNextPageActionGroup.xml new file mode 100644 index 0000000000000..7da082a279688 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToNextPageActionGroup.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="AdminGridGoToNextPageActionGroup"> + <annotations> + <description> + Go to next page of the admin grid. + </description> + </annotations> + + <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOnGrid"/> + </actionGroup> +</actionGroups> From 33c7cc810972871a5067ffd7772c71368c44b668 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Wed, 25 Nov 2020 16:05:02 +0200 Subject: [PATCH 292/490] MC-35717: Admin can not add a Product with a Customizable Option (File) to Order by SKU --- .../Model/Product/Option/Type/File.php | 19 +++++++++++++++++-- .../Catalog/Test/Mftf/Data/ProductData.xml | 4 ++++ .../catalog/product/composite/configure.js | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php index 77ef8ef4853e1..de7044a41f1d3 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php @@ -6,10 +6,11 @@ namespace Magento\Catalog\Model\Product\Option\Type; +use Magento\Catalog\Model\Product\Exception as ProductException; +use Magento\Catalog\Helper\Product as ProductHelper; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\Exception\LocalizedException; -use Magento\Catalog\Model\Product\Exception as ProductException; use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\App\ObjectManager; @@ -91,6 +92,11 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType */ private $filesystem; + /** + * @var ProductHelper + */ + private $productHelper; + /** * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -103,6 +109,7 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType * @param array $data * @param Filesystem $filesystem * @param Json|null $serializer + * @param ProductHelper|null $productHelper * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -116,7 +123,8 @@ public function __construct( \Magento\Framework\Escaper $escaper, array $data = [], Filesystem $filesystem = null, - Json $serializer = null + Json $serializer = null, + ProductHelper $productHelper = null ) { $this->_itemOptionFactory = $itemOptionFactory; $this->_urlBuilder = $urlBuilder; @@ -129,6 +137,7 @@ public function __construct( $this->validatorInfo = $validatorInfo; $this->validatorFile = $validatorFile; $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->productHelper = $productHelper ?: ObjectManager::getInstance()->get(ProductHelper::class); parent::__construct($checkoutSession, $scopeConfig, $data); } @@ -223,6 +232,12 @@ public function validateUserValue($values) $this->setIsValid(true); $option = $this->getOption(); + if (isset($values['files_prefix'])) { + $processingParams = ['files_prefix' => $values['files_prefix']]; + $processingParams = array_merge($this->_getProcessingParams()->getData(), $processingParams); + $this->productHelper->addParamsToBuyRequest($this->getRequest(), $processingParams); + } + /* * Check whether we receive uploaded file or restore file by: reorder/edit configuration or * previous configuration with no newly uploaded file diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 716c4b07d2f1d..be09f999f97fb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -581,6 +581,10 @@ <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionValueDropdown</requiredEntity> </entity> + <entity name="productWithFileOption" type="product"> + <var key="sku" entityType="product" entityKey="sku" /> + <requiredEntity type="product_option">ProductOptionFile</requiredEntity> + </entity> <entity name="productWithDropdownAndFieldOptions" type="product"> <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionValueDropdown</requiredEntity> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 1ac2a4ffadaae..fcb193b9565ef 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -607,6 +607,7 @@ define([ * @param method can be 'item_confirm', 'item_restore', 'current_confirmed_to_form', 'form_confirmed_to_confirmed' */ _processFieldsData: function (method) { + var self = this; /** * Internal function for rename fields names of some list type @@ -652,6 +653,11 @@ define([ for (var i = 0; i < elms.length; i++) { if (elms[i].name && elms[i].type == 'file') { elms[i].name = elms[i].name.replace(patternFlat, replacementFlat); + self.blockFormFields.insert(new Element('input', { + type: 'hidden', + name: 'options[files_prefix]'.replace(pattern, replacement), + value: 'item_' + itemId + '_' + })); } else if (elms[i].name) { elms[i].name = elms[i].name.replace(pattern, replacement); } From 90bc5df2b7d7de91c98603a5f9e720b02ba4d348 Mon Sep 17 00:00:00 2001 From: engcom-Kilo <mikola.malevanec@transoftgroup.com> Date: Wed, 18 Nov 2020 10:14:02 +0200 Subject: [PATCH 293/490] MC-33687: Fatal error if admin enters wrong values for some customer attribute and uploads file. --- .../Controller/Adminhtml/Index/Save.php | 33 +++--- .../DataProviderWithDefaultAddresses.php | 15 ++- .../Magento/Customer/Model/FileProcessor.php | 102 +++++++++++------- .../Customer/Model/Metadata/Form/Image.php | 14 +-- .../AdminFillCustomerMainDataActionGroup.xml | 26 +++++ .../Controller/Adminhtml/Index/SaveTest.php | 69 +++++++----- .../Test/Unit/Model/FileProcessorTest.php | 47 ++++---- 7 files changed, 189 insertions(+), 117 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php index 192a0f1362ecd..cc8531214c7da 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Customer\Controller\Adminhtml\Index; use Magento\Backend\App\Action\Context; @@ -40,6 +41,7 @@ use Magento\Framework\Math\Random; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\Registry; +use Magento\Framework\Validator\Exception; use Magento\Framework\View\Result\LayoutFactory; use Magento\Framework\View\Result\PageFactory; use Magento\Newsletter\Model\SubscriberFactory; @@ -243,10 +245,10 @@ protected function _extractData( /** * Saves default_billing and default_shipping flags for customer address * - * @deprecated 102.0.1 must be removed because addresses are save separately for now * @param array $addressIdList * @param array $extractedCustomerData * @return array + * @deprecated 102.0.1 must be removed because addresses are save separately for now */ protected function saveDefaultFlags(array $addressIdList, array &$extractedCustomerData) { @@ -286,9 +288,9 @@ protected function saveDefaultFlags(array $addressIdList, array &$extractedCusto /** * Reformat customer addresses data to be compatible with customer service interface * - * @deprecated 102.0.1 addresses are saved separately for now * @param array $extractedCustomerData * @return array + * @deprecated 102.0.1 addresses are saved separately for now */ protected function _extractCustomerAddressData(array &$extractedCustomerData) { @@ -318,6 +320,7 @@ public function execute() { $returnToEdit = false; $customerId = $this->getCurrentCustomerId(); + $customer = $this->customerDataFactory->create(); if ($this->getRequest()->getPostValue()) { try { @@ -335,8 +338,6 @@ public function execute() $customerData['id'] = $customerId; } - /** @var CustomerInterface $customer */ - $customer = $this->customerDataFactory->create(); $this->dataObjectHelper->populateWithArray( $customer, $customerData, @@ -353,7 +354,7 @@ public function execute() try { $this->customerAccountManagement->validateCustomerStoreIdByWebsiteId($customer); } catch (LocalizedException $exception) { - throw new LocalizedException(__("The Store View selected for sending Welcome email from". + throw new LocalizedException(__("The Store View selected for sending Welcome email from" . " is not related to the customer's associated website.")); } } @@ -361,7 +362,6 @@ public function execute() // Save customer if ($customerId) { $this->_customerRepository->save($customer); - $this->getEmailNotification()->credentialsChanged($customer, $currentCustomer->getEmail()); } else { $customer = $this->customerAccountManagement->createAccount($customer); @@ -386,13 +386,13 @@ public function execute() __('Something went wrong while saving the customer.') ); $returnToEdit = false; - } catch (\Magento\Framework\Validator\Exception $exception) { + } catch (Exception $exception) { $messages = $exception->getMessages(); if (empty($messages)) { $messages = $exception->getMessage(); } $this->_addSessionErrorMessages($messages); - $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); + $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData($customer)); $returnToEdit = true; } catch (AbstractAggregateException $exception) { $errors = $exception->getErrors(); @@ -401,18 +401,18 @@ public function execute() $messages[] = $error->getMessage(); } $this->_addSessionErrorMessages($messages); - $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); + $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData($customer)); $returnToEdit = true; } catch (LocalizedException $exception) { $this->_addSessionErrorMessages($exception->getMessage()); - $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); + $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData($customer)); $returnToEdit = true; } catch (\Exception $exception) { $this->messageManager->addExceptionMessage( $exception, __('Something went wrong while saving the customer.') ); - $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); + $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData($customer)); $returnToEdit = true; } } @@ -553,21 +553,16 @@ private function disableAddressValidation($customer) /** * Retrieve formatted form data * + * @param CustomerInterface $customer * @return array */ - private function retrieveFormattedFormData(): array + private function retrieveFormattedFormData(CustomerInterface $customer): array { $originalRequestData = $this->getRequest()->getPostValue(); + $customerData = $this->customerMapper->toFlatArray($customer); /* Customer data filtration */ if (isset($originalRequestData['customer'])) { - $customerData = $this->_extractData( - 'adminhtml_customer', - CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, - [], - 'customer' - ); - $customerData = array_intersect_key($customerData, $originalRequestData['customer']); $originalRequestData['customer'] = array_merge($originalRequestData['customer'], $customerData); } diff --git a/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php b/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php index 604295cc0c078..a82af07342abb 100644 --- a/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php +++ b/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php @@ -8,11 +8,13 @@ use Magento\Customer\Model\Address; use Magento\Customer\Model\Customer; +use Magento\Customer\Model\CustomerFactory; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory as CustomerCollectionFactory; use Magento\Directory\Model\CountryFactory; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Eav\Model\Entity\Type; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Session\SessionManagerInterface; use Magento\Customer\Model\FileUploaderDataResolver; @@ -66,6 +68,11 @@ class DataProviderWithDefaultAddresses extends AbstractDataProvider */ private $attributeMetadataResolver; + /** + * @var CustomerFactory + */ + private $customerFactory; + /** * @param string $name * @param string $primaryFieldName @@ -79,6 +86,7 @@ class DataProviderWithDefaultAddresses extends AbstractDataProvider * @param bool $allowToShowHiddenAttributes * @param array $meta * @param array $data + * @param CustomerFactory $customerFactory * @throws LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -94,7 +102,8 @@ public function __construct( AttributeMetadataResolver $attributeMetadataResolver, $allowToShowHiddenAttributes = true, array $meta = [], - array $data = [] + array $data = [], + CustomerFactory $customerFactory = null ) { parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data); $this->collection = $customerCollectionFactory->create(); @@ -107,6 +116,7 @@ public function __construct( $this->meta['customer']['children'] = $this->getAttributesMeta( $eavConfig->getEntityType('customer') ); + $this->customerFactory = $customerFactory ?: ObjectManager::getInstance()->get(CustomerFactory::class); } /** @@ -142,9 +152,10 @@ public function getData(): array $this->loadedData[$customer->getId()] = $result; } - $data = $this->session->getCustomerFormData(); if (!empty($data)) { + $customer = $this->customerFactory->create(); + $this->fileUploaderDataResolver->overrideFileUploaderData($customer, $data['customer']); $customerId = $data['customer']['entity_id'] ?? null; $this->loadedData[$customerId] = $data; $this->session->unsCustomerFormData(); diff --git a/app/code/Magento/Customer/Model/FileProcessor.php b/app/code/Magento/Customer/Model/FileProcessor.php index c596f8c313ab3..02bfe78be535c 100644 --- a/app/code/Magento/Customer/Model/FileProcessor.php +++ b/app/code/Magento/Customer/Model/FileProcessor.php @@ -7,6 +7,18 @@ namespace Magento\Customer\Model; +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\File\Mime; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Url\EncoderInterface; +use Magento\Framework\UrlInterface; +use Magento\MediaStorage\Model\File\Uploader; +use Magento\MediaStorage\Model\File\UploaderFactory; + /** * Processor class for work with uploaded files */ @@ -18,22 +30,22 @@ class FileProcessor const TMP_DIR = 'tmp'; /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface + * @var WriteInterface */ private $mediaDirectory; /** - * @var \Magento\MediaStorage\Model\File\UploaderFactory + * @var UploaderFactory */ private $uploaderFactory; /** - * @var \Magento\Framework\UrlInterface + * @var UrlInterface */ private $urlBuilder; /** - * @var \Magento\Framework\Url\EncoderInterface + * @var EncoderInterface */ private $urlEncoder; @@ -48,29 +60,29 @@ class FileProcessor private $allowedExtensions = []; /** - * @var \Magento\Framework\File\Mime + * @var Mime */ private $mime; /** - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory - * @param \Magento\Framework\UrlInterface $urlBuilder - * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param Filesystem $filesystem + * @param UploaderFactory $uploaderFactory + * @param UrlInterface $urlBuilder + * @param EncoderInterface $urlEncoder * @param string $entityTypeCode - * @param \Magento\Framework\File\Mime $mime + * @param Mime $mime * @param array $allowedExtensions */ public function __construct( - \Magento\Framework\Filesystem $filesystem, - \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory, - \Magento\Framework\UrlInterface $urlBuilder, - \Magento\Framework\Url\EncoderInterface $urlEncoder, + Filesystem $filesystem, + UploaderFactory $uploaderFactory, + UrlInterface $urlBuilder, + EncoderInterface $urlEncoder, $entityTypeCode, - \Magento\Framework\File\Mime $mime, + Mime $mime, array $allowedExtensions = [] ) { - $this->mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA); + $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->uploaderFactory = $uploaderFactory; $this->urlBuilder = $urlBuilder; $this->urlEncoder = $urlEncoder; @@ -91,8 +103,7 @@ public function getBase64EncodedData($fileName) $fileContent = $this->mediaDirectory->readFile($filePath); - $encodedContent = base64_encode($fileContent); - return $encodedContent; + return base64_encode($fileContent); } /** @@ -105,8 +116,7 @@ public function getStat($fileName) { $filePath = $this->entityTypeCode . '/' . ltrim($fileName, '/'); - $result = $this->mediaDirectory->stat($filePath); - return $result; + return $this->mediaDirectory->stat($filePath); } /** @@ -120,8 +130,7 @@ public function getMimeType($fileName) $filePath = $this->entityTypeCode . '/' . ltrim($fileName, '/'); $absoluteFilePath = $this->mediaDirectory->getAbsolutePath($filePath); - $result = $this->mime->getMimeType($absoluteFilePath); - return $result; + return $this->mime->getMimeType($absoluteFilePath); } /** @@ -134,8 +143,7 @@ public function isExist($fileName) { $filePath = $this->entityTypeCode . '/' . ltrim($fileName, '/'); - $result = $this->mediaDirectory->isExist($filePath); - return $result; + return $this->mediaDirectory->isExist($filePath); } /** @@ -149,13 +157,13 @@ public function getViewUrl($filePath, $type) { $viewUrl = ''; - if ($this->entityTypeCode == \Magento\Customer\Api\AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { + if ($this->entityTypeCode == AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { $filePath = $this->entityTypeCode . '/' . ltrim($filePath, '/'); - $viewUrl = $this->urlBuilder->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA]) + $viewUrl = $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]) . $this->mediaDirectory->getRelativePath($filePath); } - if ($this->entityTypeCode == \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { + if ($this->entityTypeCode == CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { $viewUrl = $this->urlBuilder->getUrl( 'customer/index/viewfile', [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] @@ -170,11 +178,11 @@ public function getViewUrl($filePath, $type) * * @param string $fileId * @return \string[] - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ public function saveTemporaryFile($fileId) { - /** @var \Magento\MediaStorage\Model\File\Uploader $uploader */ + /** @var Uploader $uploader */ $uploader = $this->uploaderFactory->create(['fileId' => $fileId]); $uploader->setFilesDispersion(false); $uploader->setFilenamesCaseSensitivity(false); @@ -188,7 +196,7 @@ public function saveTemporaryFile($fileId) $result = $uploader->save($path); unset($result['path']); if (!$result) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('File can not be saved to the destination folder.') ); } @@ -201,28 +209,32 @@ public function saveTemporaryFile($fileId) * * @param string $fileName * @return string - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ public function moveTemporaryFile($fileName) { + if (!$this->isFileTemporary($fileName)) { + return $fileName; + } + $fileName = ltrim($fileName, '/'); - $dispersionPath = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName); + $dispersionPath = Uploader::getDispersionPath($fileName); $destinationPath = $this->entityTypeCode . $dispersionPath; if (!$this->mediaDirectory->create($destinationPath)) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('Unable to create directory %1.', $destinationPath) ); } if (!$this->mediaDirectory->isWritable($destinationPath)) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('Destination folder is not writable or does not exists.') ); } - $destinationFileName = \Magento\MediaStorage\Model\File\Uploader::getNewFileName( + $destinationFileName = Uploader::getNewFileName( $this->mediaDirectory->getAbsolutePath($destinationPath) . '/' . $fileName ); @@ -238,8 +250,7 @@ public function moveTemporaryFile($fileName) ); } - $fileName = $dispersionPath . '/' . $destinationFileName; - return $fileName; + return $dispersionPath . '/' . $destinationFileName; } /** @@ -252,7 +263,20 @@ public function removeUploadedFile($fileName) { $filePath = $this->entityTypeCode . '/' . ltrim($fileName, '/'); - $result = $this->mediaDirectory->delete($filePath); - return $result; + return $this->mediaDirectory->delete($filePath); + } + + /** + * Verify if given file temporary. + * + * @param string $fileName + * @return bool + */ + private function isFileTemporary(string $fileName): bool + { + $tmpFile = $this->entityTypeCode . '/' . self::TMP_DIR . '/' . ltrim($fileName, '/'); + $destinationFile = $this->entityTypeCode . '/' . ltrim($fileName, '/'); + + return $this->mediaDirectory->isExist($tmpFile) && !$this->mediaDirectory->isExist($destinationFile); } } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Image.php b/app/code/Magento/Customer/Model/Metadata/Form/Image.php index d023db1454906..b5bfe00c23384 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Image.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Image.php @@ -16,15 +16,15 @@ use Magento\Framework\Api\ArrayObjectSearch; use Magento\Framework\Api\Data\ImageContentInterface; use Magento\Framework\Api\Data\ImageContentInterfaceFactory; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteFactory; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\Filesystem\Io\File as IoFileSystem; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem\Directory\WriteFactory; use Magento\Framework\Locale\ResolverInterface; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\Url\EncoderInterface; @@ -54,8 +54,6 @@ class Image extends File private $mediaEntityTmpDirectory; /** - * Constructor - * * @param TimezoneInterface $localeDate * @param LoggerInterface $logger * @param AttributeMetadataInterface $attribute @@ -207,13 +205,11 @@ protected function _validateByRules($value) protected function processUiComponentValue(array $value) { if ($this->_entityTypeCode == AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { - $result = $this->processCustomerAddressValue($value); - return $result; + return $this->processCustomerAddressValue($value); } if ($this->_entityTypeCode == CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { - $result = $this->processCustomerValue($value); - return $result; + return $this->processCustomerValue($value); } return $this->_value; @@ -267,6 +263,6 @@ protected function processCustomerValue(array $value) return $imageContentDataObject; } - return $this->_value; + return $this->_value ?: $value['file']; } } diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml new file mode 100644 index 0000000000000..dc7d68faf362d --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminFillCustomerMainDataActionGroup"> + <annotations> + <description>Fill customer main required data. Starts on customer creation/edit page.</description> + </annotations> + + <arguments> + <argument name="firstName" type="string" defaultValue="{{Simple_US_Customer.firstname}}"/> + <argument name="lastName" type="string" defaultValue="{{Simple_US_Customer.lastname}}"/> + <argument name="email" type="string" defaultValue="{{Simple_US_Customer.email}}"/> + </arguments> + <waitForElementVisible selector="{{AdminCustomerAccountInformationSection.firstName}}" stepKey="waitForCustomerPageLoad"/> + <fillField selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{firstName}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{lastName}}" stepKey="fillLastName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{email}}" stepKey="fillEmail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php index 8e9cce7390831..0e586d0c424a5 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php @@ -722,7 +722,7 @@ public function testExecuteWithNewCustomerAndValidationException() ]; $extractedData = [ 'coolness' => false, - 'disable_auto_group_change' => 'false', + 'disable_auto_group_change' => 0, 'dob' => '1996-03-12', ]; @@ -731,10 +731,10 @@ public function testExecuteWithNewCustomerAndValidationException() AttributeMetadataInterface::class )->disableOriginalConstructor() ->getMock(); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getAttributeCode') ->willReturn('coolness'); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getFrontendInput') ->willReturn('int'); $attributes = [$attributeMock]; @@ -759,12 +759,12 @@ public function testExecuteWithNewCustomerAndValidationException() $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); - $objectMock->expects($this->exactly(2)) + $objectMock->expects($this->once()) ->method('getData') ->with('customer') ->willReturn($postValue['customer']); - $this->objectFactoryMock->expects($this->exactly(2)) + $this->objectFactoryMock->expects($this->once()) ->method('create') ->with(['data' => $postValue]) ->willReturn($objectMock); @@ -773,19 +773,19 @@ public function testExecuteWithNewCustomerAndValidationException() Form::class )->disableOriginalConstructor() ->getMock(); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('extractData') ->with($this->requestMock, 'customer') ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('compactData') ->with($extractedData) ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('getAttributes') ->willReturn($attributes); - $this->formFactoryMock->expects($this->exactly(2)) + $this->formFactoryMock->expects($this->once()) ->method('create') ->with( CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, @@ -809,7 +809,10 @@ public function testExecuteWithNewCustomerAndValidationException() ->method('createAccount') ->with($customerMock, null, '') ->willThrowException(new \Magento\Framework\Validator\Exception(__('Validator Exception'))); - + $this->customerMapperMock->expects($this->once()) + ->method('toFlatArray') + ->with($customerMock) + ->willReturn($extractedData); $customerMock->expects($this->never()) ->method('getId'); @@ -876,7 +879,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() ]; $extractedData = [ 'coolness' => false, - 'disable_auto_group_change' => 'false', + 'disable_auto_group_change' => 0, 'dob' => '1996-03-12', ]; @@ -885,10 +888,10 @@ public function testExecuteWithNewCustomerAndLocalizedException() AttributeMetadataInterface::class )->disableOriginalConstructor() ->getMock(); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getAttributeCode') ->willReturn('coolness'); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getFrontendInput') ->willReturn('int'); $attributes = [$attributeMock]; @@ -913,12 +916,12 @@ public function testExecuteWithNewCustomerAndLocalizedException() $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); - $objectMock->expects($this->exactly(2)) + $objectMock->expects($this->once()) ->method('getData') ->with('customer') ->willReturn($postValue['customer']); - $this->objectFactoryMock->expects($this->exactly(2)) + $this->objectFactoryMock->expects($this->once()) ->method('create') ->with(['data' => $postValue]) ->willReturn($objectMock); @@ -928,19 +931,19 @@ public function testExecuteWithNewCustomerAndLocalizedException() Form::class )->disableOriginalConstructor() ->getMock(); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('extractData') ->with($this->requestMock, 'customer') ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('compactData') ->with($extractedData) ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('getAttributes') ->willReturn($attributes); - $this->formFactoryMock->expects($this->exactly(2)) + $this->formFactoryMock->expects($this->once()) ->method('create') ->with( CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, @@ -986,6 +989,11 @@ public function testExecuteWithNewCustomerAndLocalizedException() ->method('addMessage') ->with(new Error('Localized Exception')); + $this->customerMapperMock->expects($this->once()) + ->method('toFlatArray') + ->with($customerMock) + ->willReturn($extractedData); + $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') ->with( @@ -1030,7 +1038,7 @@ public function testExecuteWithNewCustomerAndException() ]; $extractedData = [ 'coolness' => false, - 'disable_auto_group_change' => 'false', + 'disable_auto_group_change' => 0, 'dob' => '1996-03-12', ]; @@ -1039,10 +1047,10 @@ public function testExecuteWithNewCustomerAndException() AttributeMetadataInterface::class )->disableOriginalConstructor() ->getMock(); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getAttributeCode') ->willReturn('coolness'); - $attributeMock->expects($this->exactly(2)) + $attributeMock->expects($this->once()) ->method('getFrontendInput') ->willReturn('int'); $attributes = [$attributeMock]; @@ -1067,12 +1075,12 @@ public function testExecuteWithNewCustomerAndException() $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); - $objectMock->expects($this->exactly(2)) + $objectMock->expects($this->once()) ->method('getData') ->with('customer') ->willReturn($postValue['customer']); - $this->objectFactoryMock->expects($this->exactly(2)) + $this->objectFactoryMock->expects($this->once()) ->method('create') ->with(['data' => $postValue]) ->willReturn($objectMock); @@ -1081,19 +1089,19 @@ public function testExecuteWithNewCustomerAndException() Form::class )->disableOriginalConstructor() ->getMock(); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('extractData') ->with($this->requestMock, 'customer') ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('compactData') ->with($extractedData) ->willReturn($extractedData); - $customerFormMock->expects($this->exactly(2)) + $customerFormMock->expects($this->once()) ->method('getAttributes') ->willReturn($attributes); - $this->formFactoryMock->expects($this->exactly(2)) + $this->formFactoryMock->expects($this->once()) ->method('create') ->with( CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, @@ -1141,6 +1149,11 @@ public function testExecuteWithNewCustomerAndException() ->method('addExceptionMessage') ->with($exception, __('Something went wrong while saving the customer.')); + $this->customerMapperMock->expects($this->once()) + ->method('toFlatArray') + ->with($customerMock) + ->willReturn($extractedData); + $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') ->with( diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index e1c771d79694e..7a0522f6476f2 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -313,10 +313,7 @@ public function testMoveTemporaryFileUnableToCreateDirectory() $destinationPath = 'customer/f/i'; - $this->mediaDirectory->expects($this->once()) - ->method('create') - ->with($destinationPath) - ->willReturn(false); + $this->configureMediaDirectoryMock($destinationPath, false); $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); $model->moveTemporaryFile($filePath); @@ -331,10 +328,7 @@ public function testMoveTemporaryFileDestinationFolderDoesNotExists() $destinationPath = 'customer/f/i'; - $this->mediaDirectory->expects($this->once()) - ->method('create') - ->with($destinationPath) - ->willReturn(true); + $this->configureMediaDirectoryMock($destinationPath, true); $this->mediaDirectory->expects($this->once()) ->method('isWritable') ->with($destinationPath) @@ -350,10 +344,7 @@ public function testMoveTemporaryFile() $destinationPath = 'customer/f/i'; - $this->mediaDirectory->expects($this->once()) - ->method('create') - ->with($destinationPath) - ->willReturn(true); + $this->configureMediaDirectoryMock($destinationPath, true); $this->mediaDirectory->expects($this->once()) ->method('isWritable') ->with($destinationPath) @@ -390,10 +381,7 @@ public function testMoveTemporaryFileNewFileName() $destinationPath = 'customer/f/i'; - $this->mediaDirectory->expects($this->once()) - ->method('create') - ->with($destinationPath) - ->willReturn(true); + $this->configureMediaDirectoryMock($destinationPath, true); $this->mediaDirectory->expects($this->once()) ->method('isWritable') ->with($destinationPath) @@ -440,10 +428,7 @@ public function testMoveTemporaryFileWithException() $destinationPath = 'customer/f/i'; - $this->mediaDirectory->expects($this->once()) - ->method('create') - ->with($destinationPath) - ->willReturn(true); + $this->configureMediaDirectoryMock($destinationPath, true); $this->mediaDirectory->expects($this->once()) ->method('isWritable') ->with($destinationPath) @@ -486,4 +471,26 @@ public function testGetMimeType() $this->assertEquals($expected, $model->getMimeType($fileName)); } + + /** + * Configure media directory mock to create media directory. + * + * @param string $destinationPath + * @param bool $directoryCreated + */ + private function configureMediaDirectoryMock(string $destinationPath, bool $directoryCreated): void + { + $this->mediaDirectory->expects($this->at(0)) + ->method('isExist') + ->with('customer/tmp/filename.ext1') + ->willReturn(true); + $this->mediaDirectory->expects($this->at(1)) + ->method('isExist') + ->with('customer/filename.ext1') + ->willReturn(false); + $this->mediaDirectory->expects($this->once()) + ->method('create') + ->with($destinationPath) + ->willReturn($directoryCreated); + } } From c3cfd8abf8ee32be94303011288b5b2e4e487850 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 24 Nov 2020 17:01:38 -0600 Subject: [PATCH 294/490] MC-36787: Cannot mass update Enable Qty Increments & Qty Increments attributes - Fix column not found: 1054 Unknown column 'use_config_enable_qty_increments' in 'field list' --- ...MassUpdateProductAttributesActionGroup.xml | 3 +- ...sUpdateProductQtyIncrementsActionGroup.xml | 27 +++++++ ...dateAttributesAdvancedInventorySection.xml | 6 ++ ...dminMassUpdateProductQtyIncrementsTest.xml | 81 +++++++++++++++++++ .../product/edit/action/inventory.phtml | 2 +- .../Plugin/MassUpdateProductAttribute.php | 12 ++- 6 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductQtyIncrementsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductQtyIncrementsTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickMassUpdateProductAttributesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickMassUpdateProductAttributesActionGroup.xml index 90cc7666eb92f..ec3d26e8a3f36 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickMassUpdateProductAttributesActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickMassUpdateProductAttributesActionGroup.xml @@ -14,6 +14,7 @@ </annotations> <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/> <click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/> - <seeInCurrentUrl url="catalog/product_action_attribute/edit/" stepKey="seeInUrl"/> + <waitForPageLoad stepKey="waitForBulkUpdatePage"/> + <seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeInUrl"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductQtyIncrementsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductQtyIncrementsActionGroup.xml new file mode 100644 index 0000000000000..a39ac8c3f5d2b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductQtyIncrementsActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminMassUpdateProductQtyIncrementsActionGroup"> + <arguments> + <argument name="enableQtyIncrements" type="string" defaultValue="Yes"/> + <argument name="qtyIncrements" type="string" defaultValue="2"/> + </arguments> + <click selector="{{AdminUpdateAttributesAdvancedInventorySection.inventory}}" stepKey="openInventoryTab"/> + <checkOption selector="{{AdminUpdateAttributesAdvancedInventorySection.changeEnableQtyIncrements}}" stepKey="changeEnableQtyIncrements"/> + <uncheckOption selector="{{AdminUpdateAttributesAdvancedInventorySection.useConfigEnableQtyIncrements}}" stepKey="uncheckUseConfigEnableQtyIncrements"/> + <selectOption selector="{{AdminUpdateAttributesAdvancedInventorySection.enableQtyIncrements}}" userInput="{{enableQtyIncrements}}" stepKey="setEnableQtyIncrements"/> + <checkOption selector="{{AdminUpdateAttributesAdvancedInventorySection.changeQtyIncrements}}" stepKey="changeQtyIncrements"/> + <uncheckOption selector="{{AdminUpdateAttributesAdvancedInventorySection.useConfigQtyIncrements}}" stepKey="uncheckUseConfigQtyIncrements"/> + <fillField selector="{{AdminUpdateAttributesAdvancedInventorySection.qtyIncrements}}" userInput="{{qtyIncrements}}" stepKey="setQtyIncrements"/> + <click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitVisibleSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection/AdminUpdateAttributesAdvancedInventorySection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection/AdminUpdateAttributesAdvancedInventorySection.xml index 92dadbdd26c2d..9881545fac9cd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection/AdminUpdateAttributesAdvancedInventorySection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection/AdminUpdateAttributesAdvancedInventorySection.xml @@ -13,5 +13,11 @@ <element name="qty" type="input" selector="#inventory_qty"/> <element name="changeStockAvailability" type="checkbox" selector="#inventory_stock_availability_checkbox"/> <element name="stockAvailability" type="select" selector="//select[@name='inventory[is_in_stock]']"/> + <element name="enableQtyIncrements" type="select" selector="#inventory_enable_qty_increments"/> + <element name="useConfigEnableQtyIncrements" type="checkbox" selector="#inventory_use_config_enable_qty_increments"/> + <element name="changeEnableQtyIncrements" type="checkbox" selector="#inventory_enable_qty_increments_checkbox"/> + <element name="qtyIncrements" type="input" selector="#inventory_qty_increments"/> + <element name="useConfigQtyIncrements" type="checkbox" selector="#inventory_use_config_qty_increments"/> + <element name="changeQtyIncrements" type="checkbox" selector="#inventory_qty_increments_checkbox"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductQtyIncrementsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductQtyIncrementsTest.xml new file mode 100644 index 0000000000000..aa82b092a0a98 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductQtyIncrementsTest.xml @@ -0,0 +1,81 @@ +<?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="AdminMassUpdateProductQtyIncrementsTest"> + <annotations> + <features value="Catalog"/> + <stories value="Mass update advanced inventory attributes"/> + <title value="Admin should be able to mass update product qty increments"/> + <description value="Admin should be able to mass update product qty increments"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-39359"/> + <useCaseId value="MC-36787"/> + <group value="catalog"/> + <group value="CatalogInventory"/> + <group value="product_attributes"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProduct" stepKey="createProductOne"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ApiSimpleProduct" stepKey="createProductTwo"> + <requiredEntity createDataKey="createCategory"/> + </createData> + </before> + <after> + <deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/> + <deleteData createDataKey="createProductTwo" stepKey="deleteProductTwo"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + <!-- Navigate to products list page and select created products --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> + <argument name="keyword" value="api-simple-product"/> + </actionGroup> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> + <!-- Mass update qty increments --> + <actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickMassUpdateProductAttributes"/> + <actionGroup ref="AdminMassUpdateProductQtyIncrementsActionGroup" stepKey="updateQtyIncrements"> + <argument name="enableQtyIncrements" value="Yes"/> + <argument name="qtyIncrements" value="2"/> + </actionGroup> + <!-- Start message queue for product attribute consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> + </actionGroup> + <!-- Open first product for edit and assert that qty increment is updated --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createProductOne.id$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/> + <seeOptionIsSelected selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" userInput="Yes" stepKey="assertEnableQtyIncrementsValue"/> + <dontSeeCheckboxIsChecked selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsUseConfigSettings}}" stepKey="assertEnableQtyIncrementsUseConfigSettings"/> + <seeInField selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" userInput="2" stepKey="assertQtyIncrementsValue"/> + <dontSeeCheckboxIsChecked selector="{{AdminProductFormAdvancedInventorySection.qtyIncrementsUseConfigSettings}}" stepKey="assertQtyIncrementsUseConfigSettings"/> + <!-- Open second product for edit and assert that qty increment is updated --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage2"> + <argument name="productId" value="$createProductTwo.id$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink2"/> + <seeOptionIsSelected selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" userInput="Yes" stepKey="assertEnableQtyIncrementsValue2"/> + <dontSeeCheckboxIsChecked selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsUseConfigSettings}}" stepKey="assertEnableQtyIncrementsUseConfigSettings2"/> + <seeInField selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" userInput="2" stepKey="assertQtyIncrementsValue2"/> + <dontSeeCheckboxIsChecked selector="{{AdminProductFormAdvancedInventorySection.qtyIncrementsUseConfigSettings}}" stepKey="assertQtyIncrementsUseConfigSettings2"/> + </test> +</tests> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml index 344123cbe5640..646512d98582e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml @@ -334,7 +334,7 @@ if (!is_numeric($defaultMinSaleQty)) { </div> <div class="field choice"> <input type="checkbox" id="inventory_use_config_enable_qty_increments" - name="<?= /* @noEscape */ $block->getFieldSuffix() ?>[use_config_enable_qty_increments]" + name="<?= /* @noEscape */ $block->getFieldSuffix() ?>[use_config_enable_qty_inc]" value="1" data-role="toggle-editability" checked="checked" diff --git a/app/code/Magento/CatalogInventory/Plugin/MassUpdateProductAttribute.php b/app/code/Magento/CatalogInventory/Plugin/MassUpdateProductAttribute.php index 2dd47eae16959..9351abf0ead3d 100644 --- a/app/code/Magento/CatalogInventory/Plugin/MassUpdateProductAttribute.php +++ b/app/code/Magento/CatalogInventory/Plugin/MassUpdateProductAttribute.php @@ -64,6 +64,14 @@ class MassUpdateProductAttribute * @var ProductRepositoryInterface */ private $productRepository; + + /** + * @var array + */ + private $useConfigFieldMap = [ + 'enable_qty_increments' => 'use_config_enable_qty_inc' + ]; + /** * @param \Magento\CatalogInventory\Model\Indexer\Stock\Processor $stockIndexerProcessor * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper @@ -146,7 +154,9 @@ private function addConfigSettings($inventoryData) { $options = $this->stockConfiguration->getConfigItemOptions(); foreach ($options as $option) { - $useConfig = 'use_config_' . $option; + $useConfig = isset($this->useConfigFieldMap[$option]) + ? $this->useConfigFieldMap[$option] + : 'use_config_' . $option; if (isset($inventoryData[$option]) && !isset($inventoryData[$useConfig])) { $inventoryData[$useConfig] = 0; } From cfb94813519d66791d8cc3db0b91e4690e77fab1 Mon Sep 17 00:00:00 2001 From: Dan Mooney <dmooney@adobe.com> Date: Wed, 25 Nov 2020 12:23:24 -0600 Subject: [PATCH 295/490] magento/partners-magento2b2b#459: Automate MC-37569 Custom Customer Address Attribute --- ...tedShippingAddressInCheckoutActionGroup.xml | 13 ++++++------- ...gAddressInCheckoutWithSearchActionGroup.xml | 15 +++++++-------- ...eckoutClickSaveAddressButtonActionGroup.xml | 5 +++-- ...ssButtonFromCheckoutShippingActionGroup.xml | 4 +++- ...ontClickSaveOnNewAddressFormActionGroup.xml | 18 ------------------ .../Mftf/Section/CheckoutShippingSection.xml | 1 + ...ustomerAddressAttributeValueActionGroup.xml | 2 +- 7 files changed, 21 insertions(+), 37 deletions(-) delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml index 0c952af6d53fa..ab588bd49436f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml @@ -16,13 +16,12 @@ <argument name="customerVar"/> <argument name="customerAddressVar"/> </arguments> - <waitForElement selector="{{CheckoutShippingSection.shippingTab}}" time="30" stepKey="waitForShippingSectionLoaded"/> - <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}"/> - <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}"/> - <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}"/> - <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}"/> - <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}"/> - <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}" stepKey="VerifyFirstNameInSelectedAddress"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}" stepKey="VerifyLastNameInSelectedAddress"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}" stepKey="VerifyStreetInSelectedAddress"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}" stepKey="VerifyCityInSelectedAddress"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}" stepKey="VerifyZipInSelectedAddress"/> + <see selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}" stepKey="VerifyPhoneInSelectedAddress"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml index 9ea1d38e16531..8b1d9665fbdf8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup.xml @@ -8,21 +8,20 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Check selected Billing address information on Review Section step --> <actionGroup name="StorefrontCheckSelectedBillingAddressInCheckoutWithSearchActionGroup"> <annotations> - <description value="Verify customer billing address values on storefront checkout."/> + <description>Validates that the provided Customer and Address details are listed on the Storefront Checkout page under the 'Billing Address' section when multiple Addresses are present for a Customer.</description> </annotations> <arguments> <argument name="customerVar"/> <argument name="customerAddressVar"/> </arguments> <waitForElement selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" time="30" stepKey="waitForBillingSectionLoaded"/> - <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.firstname}}" /> - <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.lastname}}" /> - <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.street[0]}}" /> - <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.city}}" /> - <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.postcode}}" /> - <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.telephone}}" /> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.firstname}}" stepKey="verifyFirstNameInSelectedAddress"/> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerVar.lastname}}" stepKey="verifyLastNameInSelectedAddress"/> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.street[0]}}" stepKey="verifyStreetInSelectedAddress"/> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.city}}" stepKey="verifyCityInSelectedAddress"/> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.postcode}}" stepKey="verifyZipInSelectedAddress"/> + <see selector="{{CheckoutBillingAddressSection.selectedBillingAddress}}" userInput="{{customerAddressVar.telephone}}" stepKey="verifyPhoneInSelectedAddress"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutClickSaveAddressButtonActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutClickSaveAddressButtonActionGroup.xml index a1e7497aa9d43..3e72f5e78a101 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutClickSaveAddressButtonActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutClickSaveAddressButtonActionGroup.xml @@ -12,8 +12,9 @@ <annotations> <description>Click Save Address button on checkout.</description> </annotations> - - <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="saveAddress"/> + <waitForElementVisible selector="{{CheckoutShippingSection.saveAddress}}" stepKey="waitForSaveButton"/> + <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="clickSaveButton"/> <waitForPageLoad stepKey="waitForAddressSaved"/> + <waitForElementNotVisible selector="{{CheckoutShippingSection.newAddressForm}}" stepKey="waitForNewAddressFormGone"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml index 8fbec0a0b4851..34a120d111d0b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup.xml @@ -12,7 +12,9 @@ <annotations> <description>Clicks the New Address button on the storefront Checkout Shipping page</description> </annotations> - <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="ClickOnAddNewAddressButton"/> + <waitForElementVisible selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="waitForAddNewAddressButton"/> + <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="clickAddNewAddressButton"/> <waitForPageLoad stepKey="waitForPageToLoad"/> + <waitForElementVisible selector="{{CheckoutShippingSection.newAddressForm}}" stepKey="waitForNewAddressForm"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.xml deleted file mode 100644 index e8e0782fbd1e1..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontClickSaveOnNewAddressFormActionGroup.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="StorefrontClickSaveOnNewAddressFormActionGroup"> - <annotations> - <description>Clicks the save button on the storefront new address form</description> - </annotations> - <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="saveNewAddress"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index 59d46e8cca696..a5eba8835e354 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -15,6 +15,7 @@ <element name="editAddressButton" type="button" selector=".action-edit-address" timeout="30"/> <element name="addressDropdown" type="select" selector="[name=billing_address_id]"/> <element name="newAddressButton" type="button" selector=".action-show-popup" timeout="30"/> + <element name="newAddressForm" type="text" selector="#co-shipping-form"/> <element name="email" type="input" selector="input[id*=customer-email]"/> <element name="password" type="input" selector="#customer-password"/> <element name="firstName" type="input" selector="input[name=firstname]"/> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SelectDropdownCustomerAddressAttributeValueActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SelectDropdownCustomerAddressAttributeValueActionGroup.xml index 5d0fb2e7b5c8d..659f0ea5b2640 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SelectDropdownCustomerAddressAttributeValueActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SelectDropdownCustomerAddressAttributeValueActionGroup.xml @@ -16,7 +16,7 @@ <argument name="customerAddressAttribute"/> <argument name="optionValue" type="string"/> </arguments> - + <waitForElementVisible selector="{{AdminEditCustomerAddressesSection.dropDownAttribute(customerAddressAttribute.code)}}" stepKey="waitForSelectOption"/> <selectOption selector="{{AdminEditCustomerAddressesSection.dropDownAttribute(customerAddressAttribute.code)}}" userInput="{{optionValue}}" stepKey="selectOptionValue"/> <click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="saveAddress"/> <waitForPageLoad stepKey="waitForAddressSaved"/> From 917e4135dafa26ae59e67be1ad719d28875442e2 Mon Sep 17 00:00:00 2001 From: Dan Mooney <dmooney@adobe.com> Date: Wed, 25 Nov 2020 12:44:27 -0600 Subject: [PATCH 296/490] magento/partners-magento2b2b#459: Automate MC-37569 Custom Customer Address Attribute --- ...ssesTabFromCustomerEditPageActionGroup.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenAddressesTabFromCustomerEditPageActionGroup.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenAddressesTabFromCustomerEditPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenAddressesTabFromCustomerEditPageActionGroup.xml new file mode 100644 index 0000000000000..5c9d314ca728a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenAddressesTabFromCustomerEditPageActionGroup.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="AdminOpenAddressesTabFromCustomerEditPageActionGroup"> + <annotations> + <description>Open the Addresses tab from a Customer's edit page in admin</description> + </annotations> + <waitForElementVisible selector="{{AdminCustomerInformationSection.addresses}}" stepKey="waitForAddressesTab"/> + <click selector="{{AdminCustomerInformationSection.addresses}}" stepKey="clickAddressesTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" stepKey="waitForCustomerAddressesGrid"/> + </actionGroup> +</actionGroups> From 878f950aad82ddf2af9fbd2bf225b1a3455ad221 Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Wed, 25 Nov 2020 15:19:15 -0600 Subject: [PATCH 297/490] MC-38765: Ensure there are no split db specific tests - add back methods and mark them as deprecated --- .../TestFramework/Deploy/CliCommand.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php index a6522abde04f6..6c7fc0017d3da 100644 --- a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php +++ b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php @@ -111,6 +111,54 @@ public function disableModule($moduleName) return $this->shell->execute($disableModuleCommand); } + /** + * Split quote db configuration. + * + * @return void + * @throws LocalizedException + * @deprecated split database solution is deprecated and will be removed + */ + public function splitQuote() + { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + trigger_error('Method is deprecated', E_USER_DEPRECATED); + + $initParams = $this->parametersHolder->getInitParams(); + $installParams = $this->toCliArguments( + $this->parametersHolder->getDbData('checkout') + ); + $command = $this->getCliScriptCommand() . ' setup:db-schema:split-quote ' . + implode(" ", array_keys($installParams)) . + ' -vvv --no-interaction --magento-init-params="' . + $initParams['magento-init-params'] . '"'; + + $this->shell->execute($command, array_values($installParams)); + } + + /** + * Split sales db configuration. + * + * @return void + * @throws LocalizedException + * @deprecated split database solution is deprecated and will be removed + */ + public function splitSales() + { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + trigger_error('Method is deprecated', E_USER_DEPRECATED); + + $initParams = $this->parametersHolder->getInitParams(); + $installParams = $this->toCliArguments( + $this->parametersHolder->getDbData('sales') + ); + $command = $this->getCliScriptCommand() . ' setup:db-schema:split-sales ' . + implode(" ", array_keys($installParams)) . + ' -vvv --magento-init-params="' . + $initParams['magento-init-params'] . '"'; + + $this->shell->execute($command, array_values($installParams)); + } + /** * Clean all types of cache */ From 6300c0907d7b5d041efc84b84caf1601fc56babd Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Thu, 26 Nov 2020 09:53:42 +0200 Subject: [PATCH 298/490] MC-37922: Html tag <br> visible in message --- .../Controller/Adminhtml/ImportResultTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php index ccd9e29e90a18..37b5bcd81f68d 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ImportResultTest.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ImportExport\Controller\Adminhtml; use Magento\Framework\Filesystem\DirectoryList; @@ -12,18 +14,19 @@ use Magento\ImportExport\Controller\Adminhtml\Import\HttpFactoryMock; /** + * Test for \Magento\ImportExport\Controller\Adminhtml\ImportResult class. + * * @magentoAppArea adminhtml */ class ImportResultTest extends \Magento\TestFramework\TestCase\AbstractBackendController { /** - * @dataProvider validationDataProvider * @param string $fileName * @param string $mimeType * @param string $delimiter - * @throws \Magento\Framework\Exception\FileSystemException * @backupGlobals enabled * @magentoDbIsolation enabled + * @dataProvider validationDataProvider * @SuppressWarnings(PHPMD.Superglobals) */ public function testAddErrorMessages(string $fileName, string $mimeType, string $delimiter): void @@ -48,8 +51,9 @@ public function testAddErrorMessages(string $fileName, string $mimeType, string $tmpDir = $filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); $subDir = str_replace('\\', '_', __CLASS__); $tmpDir->create($subDir); - $target = $tmpDir->getAbsolutePath("{$subDir}/{$fileName}"); - copy(__DIR__ . "/Import/_files/{$fileName}", $target); + $target = $tmpDir->getAbsolutePath("{$subDir}" . DIRECTORY_SEPARATOR . "{$fileName}"); + copy(__DIR__ . DIRECTORY_SEPARATOR . 'Import' . DIRECTORY_SEPARATOR . '_files' + . DIRECTORY_SEPARATOR . "{$fileName}", $target); $_FILES = [ 'import_file' => [ From f13958e4570cf1bbd2976c1a037a043b4c4962ae Mon Sep 17 00:00:00 2001 From: engcom-Echo <engcom-vendorworker-echo@adobe.com> Date: Thu, 26 Nov 2020 11:19:12 +0200 Subject: [PATCH 299/490] MC-37807: Link to a file of a Product with Customizable Option(File) is not available throughout a multishipping checkout process --- .../view/frontend/templates/checkout/item/default.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml index a696a693fa002..5d7f06475af28 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml @@ -13,7 +13,7 @@ <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?> <dt><?= $block->escapeHtml($_option['label']) ?></dt> <dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>> - <?= $block->escapeHtml($_formatedOptionValue['value'], ['span']) ?> + <?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?> <?php if (isset($_formatedOptionValue['full_view'])) : ?> <dl class="item options tooltip content"> <dt><?= $block->escapeHtml($_option['label']) ?></dt> From a8c72b00d7d30a60499e0aea085fade9df480b82 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Thu, 26 Nov 2020 11:55:55 +0200 Subject: [PATCH 300/490] flaky test has been updated (MC-12599) --- ...ConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index df229c4b6ed78..ffbd6152af80b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -58,6 +58,11 @@ <argument name="address" value="US_Address_TX"/> </actionGroup> + <!-- Select Free Shipping --> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping"> + <argument name="shippingMethodName" value="Free Shipping"/> + </actionGroup> + <!-- Assert Free Shipping checkbox --> <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> From 66a0607d8d781b2ae84c90e8afc3ad949706cf7a Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Thu, 26 Nov 2020 13:12:52 +0100 Subject: [PATCH 301/490] int type for price indexer --- .../Model/Indexer/ProductPriceIndexFilter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index 2ad7ca9f14963..2b37c9099a0e6 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -105,7 +105,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } if (!empty($entityIds)) { - $select->where('stock_item.product_id in (?)', $entityIds, \Zend_Db::INT_TYPE); + $select->where('stock_item.product_id IN (?)', $entityIds, \Zend_Db::INT_TYPE); } $select->group('stock_item.product_id'); @@ -121,7 +121,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = foreach ($batchSelectIterator as $select) { $productIds = null; foreach ($connection->query($select)->fetchAll() as $row) { - $productIds[] = $row['product_id']; + $productIds[] = (int) $row['product_id']; } if ($productIds !== null) { $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; From 768b3051e6fadddc544edbac1e2877d3c165d0f6 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Thu, 26 Nov 2020 14:19:39 +0200 Subject: [PATCH 302/490] improve fix Allow customer to specify associated product qtys when adding grouped product to cart via RESTful API --- .../Api/Data/GroupedOptionsInterface.php | 4 +- .../Model/Quote/Item/CartItemProcessor.php | 45 +++++-------------- .../Model/Quote/Item/GroupedOptions.php | 8 ++-- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php index e7ea3a60359ea..e1f1d33a28654 100644 --- a/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php @@ -24,9 +24,9 @@ public function getId(): int; /** * Get associated product qty * - * @return float + * @return int */ - public function getQty(): float; + public function getQty(): int; /** * Set extension attributes diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index 574805c5c12c8..c7e9989d849d5 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -9,9 +9,6 @@ use Magento\Framework\DataObject; use Magento\Framework\DataObject\Factory as ObjectFactory; -use Magento\Framework\Serialize\Serializer\Json; -use Magento\GroupedProduct\Api\Data\GroupedOptionsInterface; -use Magento\GroupedProduct\Api\Data\GroupedOptionsInterfaceFactory; use Magento\GroupedProduct\Model\Product\Type\Grouped; use Magento\Quote\Api\Data as QuoteApi; use Magento\Quote\Api\Data\CartItemInterface; @@ -29,16 +26,6 @@ class CartItemProcessor implements CartItemProcessorInterface */ private $objectFactory; - /** - * @var GroupedOptionsInterface - */ - private $groupedOptionFactory; - - /** - * @var Json - */ - private $jsonSerializer; - /** * @var QuoteApi\ProductOptionExtensionFactory */ @@ -56,21 +43,15 @@ class CartItemProcessor implements CartItemProcessorInterface /** * @param ObjectFactory $objectFactory - * @param GroupedOptionsInterfaceFactory $groupedOptionFactory - * @param Json $jsonSerializer * @param QuoteApi\ProductOptionExtensionFactory $productOptionExtensionFactory * @param QuoteApi\ProductOptionInterfaceFactory $productOptionFactory */ public function __construct( ObjectFactory $objectFactory, - GroupedOptionsInterfaceFactory $groupedOptionFactory, - Json $jsonSerializer, QuoteApi\ProductOptionExtensionFactory $productOptionExtensionFactory, QuoteApi\ProductOptionInterfaceFactory $productOptionFactory ) { $this->objectFactory = $objectFactory; - $this->groupedOptionFactory = $groupedOptionFactory; - $this->jsonSerializer = $jsonSerializer; $this->productOptionExtensionFactory = $productOptionExtensionFactory; $this->productOptionFactory = $productOptionFactory; } @@ -83,21 +64,19 @@ public function __construct( */ public function convertToBuyRequest(CartItemInterface $cartItem): ?DataObject { - $extensionAttributes = $cartItem->getProductOption() - ? $cartItem->getProductOption()->getExtensionAttributes() - : null; - if ($extensionAttributes) { - $groupedOptions = $extensionAttributes->getGroupedOptions(); - if ($groupedOptions) { - $this->groupedOptions = $groupedOptions; - $requestData = []; - - foreach ($groupedOptions as $item) { - $requestData[self::SUPER_GROUP_CODE][$item->getId()] = $item->getQty(); - } - - return $this->objectFactory->create($requestData); + if ($cartItem->getProductOption() + && $cartItem->getProductOption()->getExtensionAttributes() + && $cartItem->getProductOption()->getExtensionAttributes()->getGroupedOptions() + ) { + $groupedOptions = $cartItem->getProductOption()->getExtensionAttributes()->getGroupedOptions(); + $this->groupedOptions = $groupedOptions; + + $requestData = []; + foreach ($groupedOptions as $item) { + $requestData[self::SUPER_GROUP_CODE][$item->getId()] = $item->getQty(); } + + return $this->objectFactory->create($requestData); } return null; diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php index 70acba28db325..76dfc74806df1 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php @@ -16,7 +16,7 @@ class GroupedOptions implements GroupedOptionsInterface { /** - * @var float + * @var int */ private $qty; @@ -32,10 +32,10 @@ class GroupedOptions implements GroupedOptionsInterface /** * @param int $id - * @param float $qty + * @param int $qty * @param GroupedOptionsExtensionInterface|null $extensionAttributes */ - public function __construct(int $id, float $qty, $extensionAttributes = null) + public function __construct(int $id, int $qty, $extensionAttributes = null) { $this->id = $id; $this->qty = $qty; @@ -53,7 +53,7 @@ public function getId(): int /** * @inheritDoc */ - public function getQty(): float + public function getQty(): int { return $this->qty; } From 1e26bd94f7293877f7d71b57eb559f8e2718c7fb Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Thu, 26 Nov 2020 15:29:13 +0200 Subject: [PATCH 303/490] MC-23545: Customer attribute of type file doesn't display in Account Information after created --- .../Customer/Controller/Account/EditPost.php | 55 +++- .../Customer/Controller/Address/FormPost.php | 45 ++- .../Magento/Customer/Model/FileUploader.php | 55 +++- .../Customer/Model/Metadata/Form/File.php | 53 ++- .../AdminFillCustomerMainDataActionGroup.xml | 26 ++ ...torefrontCreateCustomerSaveActionGroup.xml | 16 + .../StorefrontCustomerSaveActionGroup.xml | 20 ++ .../Customer/Test/Mftf/Data/ImageData.xml | 16 + ...FrontCustomerAdvancedAttributesSection.xml | 2 + .../Unit/Controller/Address/FormPostTest.php | 2 +- .../Unit/Model/Metadata/Form/FileTest.php | 307 ++++++++++-------- .../Magento/Sales/Model/AdminOrder/Create.php | 5 +- .../Test/Unit/Model/AdminOrder/CreateTest.php | 9 +- 13 files changed, 444 insertions(+), 167 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCreateCustomerSaveActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerSaveActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Data/ImageData.xml diff --git a/app/code/Magento/Customer/Controller/Account/EditPost.php b/app/code/Magento/Customer/Controller/Account/EditPost.php index 6b59986f8ec5f..d2cc385b5793f 100644 --- a/app/code/Magento/Customer/Controller/Account/EditPost.php +++ b/app/code/Magento/Customer/Controller/Account/EditPost.php @@ -31,6 +31,8 @@ use Magento\Framework\Exception\State\UserLockedException; use Magento\Customer\Controller\AbstractAccount; use Magento\Framework\Phrase; +use Magento\Framework\Filesystem; +use Magento\Framework\App\Filesystem\DirectoryList; /** * Customer edit account information controller @@ -94,6 +96,11 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http */ private $addressRegistry; + /** + * @var Filesystem + */ + private $filesystem; + /** * @param Context $context * @param Session $customerSession @@ -103,6 +110,7 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http * @param CustomerExtractor $customerExtractor * @param Escaper|null $escaper * @param AddressRegistry|null $addressRegistry + * @param Filesystem $filesystem */ public function __construct( Context $context, @@ -112,7 +120,8 @@ public function __construct( Validator $formKeyValidator, CustomerExtractor $customerExtractor, ?Escaper $escaper = null, - AddressRegistry $addressRegistry = null + AddressRegistry $addressRegistry = null, + Filesystem $filesystem = null ) { parent::__construct($context); $this->session = $customerSession; @@ -122,6 +131,7 @@ public function __construct( $this->customerExtractor = $customerExtractor; $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); $this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class); + $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(Filesystem::class); } /** @@ -201,6 +211,12 @@ public function execute() $currentCustomerDataObject ); + $attributeToDelete = $this->_request->getParam('delete_attribute_value'); + $this->deleteCustomerFileAttribute( + $customerCandidateDataObject, + $attributeToDelete + ); + try { // whether a customer enabled change email option $this->processChangeEmailRequest($currentCustomerDataObject); @@ -388,4 +404,41 @@ private function disableAddressValidation($customer) $addressModel->setShouldIgnoreValidation(true); } } + + /** + * Removes file attribute from customer entity and file from filesystem + * + * @param CustomerInterface $customerCandidateDataObject + * @param string $attributeToDelete + * @return void + */ + private function deleteCustomerFileAttribute( + CustomerInterface $customerCandidateDataObject, + string $attributeToDelete + ) : void { + if ($attributeToDelete !== '') { + if (strpos($attributeToDelete, ',') !== false) { + $attributes = explode(',', $attributeToDelete); + } else { + $attributes[] = $attributeToDelete; + } + foreach ($attributes as $attr) { + $attributeValue = $customerCandidateDataObject->getCustomAttribute($attr); + if ($attributeValue!== null) { + if ($attributeValue->getValue() !== '') { + $mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $fileName = $attributeValue->getValue(); + $path = $mediaDirectory->getAbsolutePath('customer' . $fileName); + if ($fileName && $mediaDirectory->isFile($path)) { + $mediaDirectory->delete($path); + } + $customerCandidateDataObject->setCustomAttribute( + $attr, + '' + ); + } + } + } + } + } } diff --git a/app/code/Magento/Customer/Controller/Address/FormPost.php b/app/code/Magento/Customer/Controller/Address/FormPost.php index 25618e3129160..cae039ea975b8 100644 --- a/app/code/Magento/Customer/Controller/Address/FormPost.php +++ b/app/code/Magento/Customer/Controller/Address/FormPost.php @@ -24,6 +24,9 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\View\Result\PageFactory; +use Magento\Framework\Filesystem; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\NotFoundException; /** * Customer Address Form Post Controller @@ -47,6 +50,11 @@ class FormPost extends \Magento\Customer\Controller\Address implements HttpPostA */ private $customerAddressMapper; + /** + * @var Filesystem + */ + private $filesystem; + /** * @param Context $context * @param Session $customerSession @@ -61,6 +69,7 @@ class FormPost extends \Magento\Customer\Controller\Address implements HttpPostA * @param PageFactory $resultPageFactory * @param RegionFactory $regionFactory * @param HelperData $helperData + * @param Filesystem $filesystem * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -76,10 +85,12 @@ public function __construct( ForwardFactory $resultForwardFactory, PageFactory $resultPageFactory, RegionFactory $regionFactory, - HelperData $helperData + HelperData $helperData, + Filesystem $filesystem = null ) { $this->regionFactory = $regionFactory; $this->helperData = $helperData; + $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(Filesystem::class); parent::__construct( $context, $customerSession, @@ -150,7 +161,7 @@ protected function getExistingAddressData() if ($addressId = $this->getRequest()->getParam('id')) { $existingAddress = $this->_addressRepository->getById($addressId); if ($existingAddress->getCustomerId() !== $this->_getSession()->getCustomerId()) { - throw new \Exception(); + throw new NotFoundException(__('Address not found.')); } $existingAddressData = $this->getCustomerAddressMapper()->toFlatArray($existingAddress); } @@ -210,6 +221,9 @@ public function execute() try { $address = $this->_extractAddress(); + if ($this->_request->getParam('delete_attribute_value')) { + $address = $this->deleteAddressFileAttribute($address); + } $this->_addressRepository->save($address); $this->messageManager->addSuccessMessage(__('You saved the address.')); $url = $this->_buildUrl('*/*/index', ['_secure' => true]); @@ -249,4 +263,31 @@ private function getCustomerAddressMapper() } return $this->customerAddressMapper; } + + /** + * Removes file attribute from customer address and file from filesystem + * + * @param \Magento\Customer\Api\Data\AddressInterface $address + * @return mixed + */ + private function deleteAddressFileAttribute($address) + { + $attributeValue = $address->getCustomAttribute($this->_request->getParam('delete_attribute_value')); + if ($attributeValue!== null) { + if ($attributeValue->getValue() !== '') { + $mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $fileName = $attributeValue->getValue(); + $path = $mediaDirectory->getAbsolutePath('customer_address' . $fileName); + if ($fileName && $mediaDirectory->isFile($path)) { + $mediaDirectory->delete($path); + } + $address->setCustomAttribute( + $this->_request->getParam('delete_attribute_value'), + '' + ); + } + } + + return $address; + } } diff --git a/app/code/Magento/Customer/Model/FileUploader.php b/app/code/Magento/Customer/Model/FileUploader.php index c425ac06666c5..411ab37a1d740 100644 --- a/app/code/Magento/Customer/Model/FileUploader.php +++ b/app/code/Magento/Customer/Model/FileUploader.php @@ -100,14 +100,33 @@ public function validate() * @throws LocalizedException */ public function upload() + { + return $this->uploadFile(); + } + + /** + * File uploading process + * + * @param bool $useScope + * @return string[] + * @throws LocalizedException + */ + public function uploadFile($useScope = true) { /** @var FileProcessor $fileProcessor */ - $fileProcessor = $this->fileProcessorFactory->create([ - 'entityTypeCode' => $this->entityTypeCode, - 'allowedExtensions' => $this->getAllowedExtensions(), - ]); + $fileProcessor = $this->fileProcessorFactory->create( + [ + 'entityTypeCode' => $this->entityTypeCode, + 'allowedExtensions' => $this->getAllowedExtensions(), + ] + ); - $result = $fileProcessor->saveTemporaryFile($this->scope . '[' . $this->getAttributeCode() . ']'); + if ($useScope === true) { + $fileId = $this->scope . '[' . $this->getAttributeCode() . ']'; + } else { + $fileId = $this->getAttributeCode(); + } + $result = $fileProcessor->saveTemporaryFile($fileId); // Update tmp_name param. Required for attribute validation! $result['tmp_name'] = ltrim($result['file'], '/'); @@ -127,7 +146,14 @@ public function upload() */ private function getAttributeCode() { - return key($_FILES[$this->scope]['name']); + // phpcs:disable Magento2.Security.Superglobal + if (is_array($_FILES[$this->scope]['name'])) { + $code = key($_FILES[$this->scope]['name']); + } else { + $code = $this->scope; + } + // phpcs:enable Magento2.Security.Superglobal + return $code; } /** @@ -139,10 +165,16 @@ private function getData() { $data = []; + // phpcs:disable Magento2.Security.Superglobal $fileAttributes = $_FILES[$this->scope]; foreach ($fileAttributes as $attributeName => $attributeValue) { - $data[$attributeName] = $attributeValue[$this->getAttributeCode()]; + if (is_array($attributeValue)) { + $data[$attributeName] = $attributeValue[$this->getAttributeCode()]; + } else { + $data[$attributeName] = $attributeValue; + } } + // phpcs:enable Magento2.Security.Superglobal return $data; } @@ -160,9 +192,12 @@ private function getAllowedExtensions() foreach ($validationRules as $validationRule) { if ($validationRule->getName() == 'file_extensions') { $allowedExtensions = explode(',', $validationRule->getValue()); - array_walk($allowedExtensions, function (&$value) { - $value = strtolower(trim($value)); - }); + array_walk( + $allowedExtensions, + function (&$value) { + $value = strtolower(trim($value)); + } + ); break; } } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index 1a1c48075fce5..17cfc0325ef41 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -13,6 +13,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Io\File as IoFile; /** * Processes files that are save for customer. @@ -61,6 +62,11 @@ class File extends AbstractData */ protected $fileProcessorFactory; + /** + * @var IoFile|null + */ + private $ioFile; + /** * Constructor * @@ -76,6 +82,7 @@ class File extends AbstractData * @param Filesystem $fileSystem * @param UploaderFactory $uploaderFactory * @param \Magento\Customer\Model\FileProcessorFactory|null $fileProcessorFactory + * @param IoFile|null $ioFile * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -90,7 +97,8 @@ public function __construct( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $fileValidator, Filesystem $fileSystem, UploaderFactory $uploaderFactory, - \Magento\Customer\Model\FileProcessorFactory $fileProcessorFactory = null + FileProcessorFactory $fileProcessorFactory = null, + IoFile $ioFile = null ) { parent::__construct($localeDate, $logger, $attribute, $localeResolver, $value, $entityTypeCode, $isAjax); $this->urlEncoder = $urlEncoder; @@ -98,8 +106,10 @@ public function __construct( $this->_fileSystem = $fileSystem; $this->uploaderFactory = $uploaderFactory; $this->fileProcessorFactory = $fileProcessorFactory ?: ObjectManager::getInstance() - ->get(\Magento\Customer\Model\FileProcessorFactory::class); + ->get(FileProcessorFactory::class); $this->fileProcessor = $this->fileProcessorFactory->create(['entityTypeCode' => $this->_entityTypeCode]); + $this->ioFile = $ioFile ?: ObjectManager::getInstance() + ->get(IoFile::class); } /** @@ -110,11 +120,17 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) { $extend = $this->_getRequestValue($request); + // phpcs:disable Magento2.Security.Superglobal $attrCode = $this->getAttribute()->getAttributeCode(); - if ($this->_requestScope || !isset($_FILES[$attrCode])) { + + // phpcs:disable Magento2.Security.Superglobal + $uploadedFile = $request->getParam($attrCode . '_uploaded'); + if ($uploadedFile) { + $value = $uploadedFile; + } elseif ($this->_requestScope || !isset($_FILES[$attrCode])) { $value = []; - if (strpos($this->_requestScope, '/') !== false) { - $scopes = explode('/', $this->_requestScope); + if (strpos($this->_requestScope, DIRECTORY_SEPARATOR) !== false) { + $scopes = explode(DIRECTORY_SEPARATOR, $this->_requestScope); $mainScope = array_shift($scopes); } else { $mainScope = $this->_requestScope; @@ -153,6 +169,7 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $value = []; } } + // phpcs:enable Magento2.Security.Superglobal if (!empty($extend['delete'])) { $value['delete'] = true; @@ -171,7 +188,9 @@ protected function _validateByRules($value) { $label = $value['name']; $rules = $this->getAttribute()->getValidationRules(); - $extension = pathinfo($value['name'], PATHINFO_EXTENSION); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $pathInfo = $this->ioFile->getPathInfo($label); + $extension = $pathInfo['extension'] ?? null; $fileExtensions = ArrayObjectSearch::getArrayElementByName( $rules, 'file_extensions' @@ -219,12 +238,14 @@ protected function _validateByRules($value) */ protected function _isUploadedFile($filename) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction if (is_uploaded_file($filename)) { return true; } // This case is required for file uploader UI component - $temporaryFile = FileProcessor::TMP_DIR . '/' . pathinfo($filename)['basename']; + $temporaryFile = FileProcessor::TMP_DIR . DIRECTORY_SEPARATOR . + $this->ioFile->getPathInfo($filename)['basename']; if ($this->fileProcessor->isExist($temporaryFile)) { return true; } @@ -290,10 +311,9 @@ public function compactValue($value) return $value; } - if (isset($value['file']) && !empty($value['file'])) { - if ($value['file'] == $this->_value) { - return $this->_value; - } + if ($value && is_string($value) && $this->fileProcessor->isExist($value)) { + $result = $value; + } elseif (isset($value['file']) && !empty($value['file'])) { $result = $this->processUiComponentValue($value); } else { $result = $this->processInputFieldValue($value); @@ -310,6 +330,9 @@ public function compactValue($value) */ protected function processUiComponentValue(array $value) { + if ($value['file'] == $this->_value) { + return $this->_value; + } $result = $this->fileProcessor->moveTemporaryFile($value['file']); return $result; } @@ -338,7 +361,8 @@ protected function processInputFieldValue($value) $result = $this->_value; if ($toDelete) { - $mediaDir->delete($this->_entityTypeCode . '/' . ltrim($this->_value, '/')); + $mediaDir->delete($this->_entityTypeCode . DIRECTORY_SEPARATOR . + ltrim($this->_value, DIRECTORY_SEPARATOR)); $result = ''; } @@ -363,7 +387,10 @@ protected function processInputFieldValue($value) */ public function restoreValue($value) { - return $this->_value; + if (!empty($this->_value)) { + return $this->_value; + } + return $this->compactValue($value); } /** diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml new file mode 100644 index 0000000000000..dc7d68faf362d --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFillCustomerMainDataActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminFillCustomerMainDataActionGroup"> + <annotations> + <description>Fill customer main required data. Starts on customer creation/edit page.</description> + </annotations> + + <arguments> + <argument name="firstName" type="string" defaultValue="{{Simple_US_Customer.firstname}}"/> + <argument name="lastName" type="string" defaultValue="{{Simple_US_Customer.lastname}}"/> + <argument name="email" type="string" defaultValue="{{Simple_US_Customer.email}}"/> + </arguments> + <waitForElementVisible selector="{{AdminCustomerAccountInformationSection.firstName}}" stepKey="waitForCustomerPageLoad"/> + <fillField selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{firstName}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{lastName}}" stepKey="fillLastName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{email}}" stepKey="fillEmail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCreateCustomerSaveActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCreateCustomerSaveActionGroup.xml new file mode 100644 index 0000000000000..d4ac7edffd47a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCreateCustomerSaveActionGroup.xml @@ -0,0 +1,16 @@ +<?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="StorefrontCreateCustomerSaveActionGroup"> + <click selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}" stepKey="clickCreateAccountButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="Thank you for registering with " stepKey="verifySuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerSaveActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerSaveActionGroup.xml new file mode 100644 index 0000000000000..88c1d70bb9abb --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerSaveActionGroup.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="StorefrontCustomerSaveActionGroup"> + <annotations> + <description>Clicks on customer save button in dashboard, asserts success message</description> + </annotations> + <scrollToTopOfPage stepKey="scrollToTopOfThePage"/> + <click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveCustomerOnStoreFront"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You saved the account information." stepKey="verifySuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/ImageData.xml b/app/code/Magento/Customer/Test/Mftf/Data/ImageData.xml new file mode 100644 index 0000000000000..3abd51883434b --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/ImageData.xml @@ -0,0 +1,16 @@ +<?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="SmallImage" type="imageFile"> + <data key="file">small.jpg</data> + <data key="name">small</data> + <data key="extension">jpg</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml index b2f96eb539c08..d03e088104807 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml @@ -20,5 +20,7 @@ <element name="yesNoOptionAttribute" type="select" selector="//select[@id='{{var}}']/option[2]" parameterized="true"/> <element name="selectedOption" type="text" selector="//select[@id='{{var}}']/option[@selected='selected']" parameterized="true"/> <element name="attributeLabel" type="text" selector="//span[text()='{{attributeLabel}}']" parameterized="true"/> + <element name="fileAttribute" type="file" selector="//input[@type='file' and @name='{{attributeCode}}']" parameterized="true" timeout="30"/> + <element name="customFileAttributeUploadButton" type="input" selector=".file-uploader-area input[name='{{attributeCode}}'] ~ .file-uploader-button" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php index a10cfe207b822..37239884aeb4f 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php @@ -495,7 +495,7 @@ public function testExecute( $this->request->expects($this->once()) ->method('isPost') ->willReturn(true); - $this->request->expects($this->exactly(3)) + $this->request->expects($this->exactly(4)) ->method('getParam') ->willReturnMap([ ['id', null, $addressId], 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 d3a6e797c7d5c..3c5016df230f9 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 @@ -103,29 +103,31 @@ public function testExtractValueNoRequestScope($expected, $attributeCode = '', $ $value = 'value'; $this->requestMock->expects( - $this->any() + $this->at(0) )->method( 'getParam' - )->willReturn( - ['delete' => $delete] + )->will( + $this->returnValue(['delete' => $delete]) ); $this->attributeMetadataMock->expects( $this->any() )->method( 'getAttributeCode' - )->willReturn( - $attributeCode + )->will( + $this->returnValue($attributeCode) ); if (!empty($attributeCode)) { $_FILES[$attributeCode] = ['attributeCodeValue']; } - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($expected, $model->extractValue($this->requestMock)); if (!empty($attributeCode)) { @@ -157,33 +159,35 @@ public function testExtractValueWithRequestScope($expected, $requestScope, $main $value = 'value'; $this->requestMock->expects( - $this->any() + $this->at(0) )->method( 'getParam' - )->willReturn( - ['delete' => true] + )->will( + $this->returnValue(['delete' => true]) ); $this->requestMock->expects( $this->any() )->method( 'getParams' - )->willReturn( - ['delete' => true] + )->will( + $this->returnValue(['delete' => true]) ); $this->attributeMetadataMock->expects( $this->any() )->method( 'getAttributeCode' - )->willReturn( - 'attributeCode' + )->will( + $this->returnValue('attributeCode') ); - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $model->setRequestScope($requestScope); @@ -229,22 +233,24 @@ public function testValidateValueNotToUpload($expected, $value, $isAjax = false, $this->any() )->method( 'isRequired' - )->willReturn( - $isRequired + )->will( + $this->returnValue($isRequired) ); $this->attributeMetadataMock->expects( $this->any() )->method( 'getStoreLabel' - )->willReturn( - 'attributeLabel' + )->will( + $this->returnValue('attributeLabel') ); - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => $isAjax, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => $isAjax, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($expected, $model->validateValue($value)); } @@ -272,39 +278,41 @@ public function testValidateValueToUpload($expected, $value, $parameters = []) { $parameters = array_merge(['uploaded' => true, 'valid' => true], $parameters); - $this->attributeMetadataMock->expects($this->any())->method('isRequired')->willReturn(false); + $this->attributeMetadataMock->expects($this->any())->method('isRequired')->will($this->returnValue(false)); $this->attributeMetadataMock->expects( $this->any() )->method( 'getStoreLabel' - )->willReturn( - 'File Input Field Label' + )->will( + $this->returnValue('File Input Field Label') ); $this->fileValidatorMock->expects( $this->any() )->method( 'getMessages' - )->willReturn( - ['Validation error message.'] + )->will( + $this->returnValue(['Validation error message.']) ); $this->fileValidatorMock->expects( $this->any() )->method( 'isValid' - )->willReturn( - $parameters['valid'] + )->will( + $this->returnValue($parameters['valid']) ); $this->fileProcessorMock->expects($this->any()) ->method('isExist') ->willReturn($parameters['uploaded']); - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($expected, $model->validateValue($value)); } @@ -331,24 +339,28 @@ public function validateValueToUploadDataProvider() public function testCompactValueIsAjax() { - $model = $this->initialize([ - 'value' => 'value', - 'isAjax' => true, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => 'value', + 'isAjax' => true, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertSame($model, $model->compactValue('aValue')); } public function testCompactValueNoDelete() { - $this->attributeMetadataMock->expects($this->any())->method('isRequired')->willReturn(false); + $this->attributeMetadataMock->expects($this->any())->method('isRequired')->will($this->returnValue(false)); - $model = $this->initialize([ - 'value' => 'value', - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => 'value', + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->fileProcessorMock->expects($this->once()) ->method('removeUploadedFile') @@ -360,10 +372,10 @@ public function testCompactValueNoDelete() public function testCompactValueDelete() { - $this->attributeMetadataMock->expects($this->any())->method('isRequired')->willReturn(false); + $this->attributeMetadataMock->expects($this->any())->method('isRequired')->will($this->returnValue(false)); $mediaDirMock = $this->getMockForAbstractClass( - WriteInterface::class + \Magento\Framework\Filesystem\Directory\WriteInterface::class ); $mediaDirMock->expects($this->once()) ->method('delete') @@ -372,13 +384,15 @@ public function testCompactValueDelete() $this->fileSystemMock->expects($this->once()) ->method('getDirectoryWrite') ->with(DirectoryList::MEDIA) - ->willReturn($mediaDirMock); + ->will($this->returnValue($mediaDirMock)); - $model = $this->initialize([ - 'value' => 'value', - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => 'value', + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertSame('', $model->compactValue(['delete' => true])); } @@ -389,20 +403,20 @@ public function testCompactValueTmpFile() $expected = 'saved.file'; $mediaDirMock = $this->getMockForAbstractClass( - WriteInterface::class + \Magento\Framework\Filesystem\Directory\WriteInterface::class ); $this->fileSystemMock->expects($this->once()) ->method('getDirectoryWrite') ->with(DirectoryList::MEDIA) - ->willReturn($mediaDirMock); + ->will($this->returnValue($mediaDirMock)); $mediaDirMock->expects($this->any()) ->method('getAbsolutePath') - ->willReturnArgument(0); - $uploaderMock = $this->createMock(Uploader::class); + ->will($this->returnArgument(0)); + $uploaderMock = $this->createMock(\Magento\Framework\File\Uploader::class); $this->uploaderFactoryMock->expects($this->once()) ->method('create') ->with(['fileId' => $value]) - ->willReturn($uploaderMock); + ->will($this->returnValue($uploaderMock)); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true); @@ -417,13 +431,15 @@ public function testCompactValueTmpFile() ->with(self::ENTITY_TYPE, 'new.file'); $uploaderMock->expects($this->once()) ->method('getUploadedFileName') - ->willReturn($expected); + ->will($this->returnValue($expected)); - $model = $this->initialize([ - 'value' => null, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => null, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertSame($expected, $model->compactValue($value)); } @@ -432,11 +448,13 @@ public function testRestoreValue() { $value = 'value'; - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($value, $model->restoreValue('aValue')); } @@ -447,11 +465,13 @@ public function testRestoreValue() */ public function testOutputValueNonJson($format) { - $model = $this->initialize([ - 'value' => 'value', - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => 'value', + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertSame('', $model->outputValue($format)); } @@ -480,29 +500,31 @@ public function testOutputValueJson() )->method( 'encode' )->with( - $value - )->willReturn( - $urlKey + $this->equalTo($value) + )->will( + $this->returnValue($urlKey) ); $expected = ['value' => $value, 'url_key' => $urlKey]; - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertSame($expected, $model->outputValue(ElementFactory::OUTPUT_FORMAT_JSON)); } /** * @param array $data - * @return File + * @return \Magento\Customer\Model\Metadata\Form\File */ private function initialize(array $data) { - return new File( + return new \Magento\Customer\Model\Metadata\Form\File( $this->localeMock, $this->loggerMock, $this->attributeMetadataMock, @@ -528,22 +550,26 @@ public function testExtractValueFileUploaderUIComponent() ->method('getAttributeCode') ->willReturn($attributeCode); - $this->requestMock->expects($this->once()) + $this->requestMock->expects($this->at(0)) ->method('getParam') ->with($requestScope) - ->willReturn([ - $attributeCode => [ - [ - 'file' => $fileName, + ->willReturn( + [ + $attributeCode => [ + [ + 'file' => $fileName, + ], ], - ], - ]); - - $model = $this->initialize([ - 'value' => 'value', - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + ] + ); + + $model = $this->initialize( + [ + 'value' => 'value', + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $model->setRequestScope($requestScope); $result = $model->extractValue($this->requestMock); @@ -555,11 +581,13 @@ public function testCompactValueRemoveUiComponentValue() { $value = 'value'; - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->fileProcessorMock->expects($this->once()) ->method('removeUploadedFile') @@ -573,11 +601,13 @@ public function testCompactValueNoAction() { $value = 'value'; - $model = $this->initialize([ - 'value' => $value, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $value, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($value, $model->compactValue($value)); } @@ -588,11 +618,13 @@ public function testCompactValueUiComponent() 'file' => 'filename', ]; - $model = $this->initialize([ - 'value' => null, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => null, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->fileProcessorMock->expects($this->once()) ->method('moveTemporaryFile') @@ -613,7 +645,7 @@ public function testCompactValueInputField() $uploadedFilename = 'filename.ext1'; $mediaDirectoryMock = $this->getMockBuilder( - WriteInterface::class + \Magento\Framework\Filesystem\Directory\WriteInterface::class ) ->getMockForAbstractClass(); $mediaDirectoryMock->expects($this->once()) @@ -627,9 +659,8 @@ public function testCompactValueInputField() ->willReturn($mediaDirectoryMock); $uploaderMock = $this->getMockBuilder( - Uploader::class - )->disableOriginalConstructor() - ->getMock(); + \Magento\Framework\File\Uploader::class + )->disableOriginalConstructor()->getMock(); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true) @@ -655,11 +686,13 @@ public function testCompactValueInputField() ->with(['fileId' => $value]) ->willReturn($uploaderMock); - $model = $this->initialize([ - 'value' => null, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => null, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals($uploadedFilename, $model->compactValue($value)); } @@ -674,7 +707,7 @@ public function testCompactValueInputFieldWithException() $originValue = 'origin'; $mediaDirectoryMock = $this->getMockBuilder( - WriteInterface::class + \Magento\Framework\Filesystem\Directory\WriteInterface::class )->getMockForAbstractClass(); $mediaDirectoryMock->expects($this->once()) ->method('delete') @@ -697,11 +730,13 @@ public function testCompactValueInputFieldWithException() ->with($exception) ->willReturnSelf(); - $model = $this->initialize([ - 'value' => $originValue, - 'isAjax' => false, - 'entityTypeCode' => self::ENTITY_TYPE, - ]); + $model = $this->initialize( + [ + 'value' => $originValue, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ] + ); $this->assertEquals('', $model->compactValue($value)); } diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 1f23e4480ec1c..3e708d1a0df02 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -674,7 +674,7 @@ public function initFromOrderItem(\Magento\Sales\Model\Order\Item $orderItem, $q if (in_array($option['option_type'], ['date', 'date_time', 'time', 'file'])) { $product->setSkipCheckRequiredOption(false); $formattedOptions[$option['option_id']] = - $buyRequest->getDataByKey('options')[$option['option_id']]; + $buyRequest->getDataByKey('options')[$option['option_id']]; continue; } @@ -1661,7 +1661,8 @@ public function setAccountData($accountData) // emulate request $request = $form->prepareRequest($accountData); - $data = $form->extractData($request); + $requestScope = $request->getPostValue() ? 'order/account' : null; + $data = $form->extractData($request, $requestScope); $data = $form->restoreData($data); $customer = $this->customerFactory->create(); $this->dataObjectHelper->populateWithArray( diff --git a/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php b/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php index c587d2322c298..36f5b7c9f4cdd 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php @@ -212,10 +212,15 @@ public function testSetAccountData() ->method('restoreData') ->willReturn(['group_id' => 1]); + $requestMock = $this->getMockBuilder(RequestInterface::class) + ->setMethods(['getPostValue']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $requestMock->expects($this->atLeastOnce())->method('getPostValue')->willReturn(null); $customerForm->method('prepareRequest') - ->willReturn($this->getMockForAbstractClass(RequestInterface::class)); + ->willReturn($requestMock); - $customer = $this->getMockForAbstractClass(CustomerInterface::class); + $customer = $this->createMock(CustomerInterface::class); $this->customerMapper->expects(self::atLeastOnce()) ->method('toFlatArray') ->willReturn(['group_id' => 1]); From 95e1ecc7a8c420ee04a4c147065db09a6ee62f39 Mon Sep 17 00:00:00 2001 From: Nihar Ranjan <nsahoo@ztech.io> Date: Thu, 26 Nov 2020 19:13:38 +0530 Subject: [PATCH 304/490] Suggested changes - 26Nov2020 --- .../Model/Resolver/RequestCustomerToken.php | 8 ++++ .../GenerateLoginCustomerTokenTest.php | 6 +-- .../LoginAsCustomer/_files/customer.php | 48 +++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) rename dev/tests/api-functional/testsuite/Magento/GraphQl/{LoginAsCustomer => LoginAsCustomerGraphQl}/GenerateLoginCustomerTokenTest.php (96%) create mode 100644 dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/customer.php diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php index d3e0aab3d4b02..6889f79fd1270 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php @@ -76,6 +76,7 @@ public function resolve( array $args = null ) { $isAllowedLogin = $this->authorization->isAllowed('Magento_LoginAsCustomer::login'); + $isAlllowedShoppingAssistance = $this->authorization->isAllowed('Magento_LoginAsCustomer::allow_shopping_assistance'); $isEnabled = $this->config->isEnabled(); /* Get input params */ @@ -96,6 +97,13 @@ public function resolve( __('Login as Customer is disabled.') ); } + + if (!$isAlllowedShoppingAssistance) { + throw new GraphQlAuthorizationException( + __('Allow remote shopping assistance is disabled.') + ); + } + return $this->createCustomerToken->execute( $args['customer_email'], $context->getExtensionAttributes()->getStore() diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php similarity index 96% rename from dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php rename to dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php index 6b1762a73dc02..d8bae2c8e08c9 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php @@ -43,7 +43,7 @@ protected function setUp(): void * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php * @magentoConfigFixture admin_store login_as_customer/general/enabled 1 - * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/customer.php * @throws Exception */ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() @@ -67,7 +67,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled() * * @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php * @magentoConfigFixture admin_store login_as_customer/general/enabled 0 - * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/customer.php * @throws Exception */ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() @@ -89,7 +89,7 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled() /** * Verify with Customer Token in auth header * - * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/LoginAsCustomer/_files/customer.php * @magentoConfigFixture admin_store login_as_customer/general/enabled 1 * @throws Exception */ diff --git a/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/customer.php b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/customer.php new file mode 100644 index 0000000000000..dba02bc340738 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/customer.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\Customer\Model\CustomerRegistry; +use Magento\Customer\Api\Data\CustomerExtensionFactory; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $repository \Magento\Customer\Api\CustomerRepositoryInterface */ +$repository = $objectManager->create(\Magento\Customer\Api\CustomerRepositoryInterface::class); +$customer = $objectManager->create(\Magento\Customer\Model\Customer::class); + +/** @var CustomerRegistry $customerRegistry */ +$customerRegistry = $objectManager->get(CustomerRegistry::class); +/** @var Magento\Customer\Model\Customer $customer */ +$customer->setWebsiteId(1) + ->setId(1) + ->setEmail('customer@example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setPrefix('Mr.') + ->setFirstname('John') + ->setMiddlename('A') + ->setLastname('Smith') + ->setSuffix('Esq.') + ->setDefaultBilling(1) + ->setDefaultShipping(1) + ->setTaxvat('12') + ->setGender(0); + +$extension = $customer->getExtensionAttributes(); +if ($extension === null) { + $extension = $objectManager->get(CustomerExtensionFactory::class)->create(); +} + +$extension->setAssistanceAllowed(2); +$customer->setExtensionAttributes($extension); + +$customer->isObjectNew(true); +$customer->save(); + +$customerRegistry->remove($customer->getId()); From d56db5bed6424e94fb70ae116eb89360465d1762 Mon Sep 17 00:00:00 2001 From: Valentin Sandu <m.valentin.sandu@gmail.com> Date: Tue, 17 Nov 2020 16:36:32 +0200 Subject: [PATCH 305/490] set correct remaining available discount amount when applying fixed price cart rules to bundle products --- .../Model/Rule/Action/Discount/CartFixed.php | 6 +-- .../Test/Mftf/Data/SalesRuleData.xml | 3 ++ ...CartDiscountAmountForBundleProductTest.xml | 51 +++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php index 1569c9551aa46..0adeedc32f759 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php @@ -111,7 +111,7 @@ public function calculate($rule, $item, $qty) $address, $baseRuleTotals ) : $baseRuleTotals; - $availableDiscountAmount = $this->cartFixedDiscountHelper + $maximumItemDiscount = $this->cartFixedDiscountHelper ->getDiscountAmount( $ruleDiscount, $qty, @@ -119,8 +119,8 @@ public function calculate($rule, $item, $qty) $baseRuleTotals, $discountType ); - $quoteAmount = $this->priceCurrency->convert($availableDiscountAmount, $store); - $baseDiscountAmount = min($baseItemPrice * $qty, $availableDiscountAmount); + $quoteAmount = $this->priceCurrency->convert($maximumItemDiscount, $store); + $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); $this->deltaPriceRound->reset($discountType); } else { $baseRuleTotals = $shippingMethod ? diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml index 4a39e1237841d..4c1558baa767d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml @@ -261,6 +261,9 @@ <entity name="SalesRuleNoCouponWithFixedDiscount" extends="ApiCartRule"> <data key="simple_action">by_fixed</data> </entity> + <entity name="SalesRuleNoCouponWithFixedDiscountWholeCart" extends="ApiCartRule"> + <data key="simple_action">cart_fixed</data> + </entity> <entity name="ActiveSalesRuleWithPercentPriceDiscountCoupon"> <data key="name" unique="suffix">Cart Price Rule with Specific Coupon</data> <data key="description">Description for Cart Price Rule</data> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml new file mode 100644 index 0000000000000..3f7e988f34bdd --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -0,0 +1,51 @@ +<?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="StorefrontAssertFixedCartDiscountAmountForBundleProductTest"> + <annotations> + <features value="SalesRule"/> + <stories value="Fixed Amount Cart Price Rule"/> + <title value="Checking Fixed Amount Cart Price Rule is correctly applied to bundle products"/> + <description value="Checking Fixed Amount Cart Price Rule is correctly applied to bundle products"/> + <severity value="AVERAGE"/> + <group value="SalesRule"/> + </annotations> + <before> + <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> + <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> + </before> + <after> + <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> + <deleteData createDataKey="createBundleProductCreateBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="simpleProduct1CreateBundleProduct" stepKey="deleteSimpleProduct1"/> + </after> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createBundleProductCreateBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectOption0Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkOption0Product1"/> + <checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="selectOption1Product0"/> + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="checkOption1Product0"/> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '1')}}" stepKey="selectOption2Product0"/> + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '1')}}" stepKey="checkOption2Product0"/> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '2')}}" stepKey="selectOption2Product1"/> + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '1')}}" stepKey="checkOption2Product1"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> + <argument name="quantity" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/> + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert" after="openShoppingCartPage"> + <argument name="subtotal" value="60.00"/> + <argument name="shipping" value="5.00"/> + <argument name="shippingMethod" value="Flat Rate - Fixed"/> + <argument name="total" value="15.00"/> + </actionGroup> + </test> +</tests> From 306ab9d77ee76288d48907aee946eb20a314a8a9 Mon Sep 17 00:00:00 2001 From: mastiuhin-olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 26 Nov 2020 19:59:11 +0200 Subject: [PATCH 306/490] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design --- .../Magento/Catalog/Model/ResourceModel/Product/Relation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php index 9d2242b1f8283..76584ea2a65f3 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Relation.php @@ -159,7 +159,7 @@ public function getRelationsByChildren(array $childrenIds): array $parentIdsOfChildIds = []; foreach ($result as $row) { - $parentIdsOfChildIds[$row['child_id']][] = $row['parent_id']; + $parentIdsOfChildIds[$row['child_id']][] = $row['entity_id']; } return $parentIdsOfChildIds; From be06626405b02b196fd4204888742776201214b0 Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Thu, 26 Nov 2020 21:58:42 +0100 Subject: [PATCH 307/490] Add category cache tags test --- .../Controller/Catalog/ProductsCacheTest.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php index 038a8c7255815..c6315bed7de87 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php @@ -139,4 +139,33 @@ public function testDifferentProductsRequestsUseDifferentPageCacheRecords(): voi $this->assertEquals('MISS', $responseProduct1->getHeader('X-Magento-Cache-Debug')->getFieldValue()); $this->assertEquals('MISS', $responseProduct2->getHeader('X-Magento-Cache-Debug')->getFieldValue()); } + + /** + * Test response has category tags when products are filtered by category id + * + * @magentoDataFixture Magento/Catalog/_files/category_product.php + */ + public function testProductsFilterByCategoryHasCategoryTags(): void + { + $query + = <<<QUERY + { + products(filter: {category_id: {eq: "333"}}) + { + items { + name + sku + } + } + } +QUERY; + + $response = $this->dispatchGraphQlGETRequest(['query'=> $query]); + $actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue()); + $expectedCacheTags = ['cat_c', 'cat_c_333']; + + foreach ($expectedCacheTags as $cacheTag) { + $this->assertArrayHasKey($cacheTag, $actualCacheTags); + } + } } From f13157df893426f6a4d5a031b046add21c319693 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 26 Nov 2020 23:46:08 +0200 Subject: [PATCH 308/490] Update dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index d93f6d486c504..6188e67eaa393 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,7 +223,7 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - +ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), From 6c2d07c4a3b9cfd3191e2382efdbf2ef834d19cf Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 26 Nov 2020 23:46:58 +0200 Subject: [PATCH 309/490] Update dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index 6188e67eaa393..2f6fc2ee112fa 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,7 +223,7 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); -ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); + ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), From 7ccfa6624add3fdc41007f1e991cc92523bc7927 Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Thu, 26 Nov 2020 23:08:35 +0100 Subject: [PATCH 310/490] Check if category id is passed as products can be filtered by other fields too --- app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php index b148b4b20c236..eebcbfba55b1f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php @@ -79,7 +79,7 @@ public function resolve( 'layer_type' => isset($args['search']) ? Resolver::CATALOG_LAYER_SEARCH : Resolver::CATALOG_LAYER_CATEGORY, ]; - if (isset($args['filter'])) { + if (isset($args['filter']['category_id'])) { $data['categories'] = $args['filter']['category_id']['eq'] ?? $args['filter']['category_id']['in']; $data['categories'] = is_array($data['categories']) ? $data['categories'] : [$data['categories']]; } From 5dfc32837e28ceec270b04631618ba2a074f5216 Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Thu, 26 Nov 2020 23:15:52 +0100 Subject: [PATCH 311/490] Fix code style --- .../GraphQlCache/Controller/Catalog/ProductsCacheTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php index c6315bed7de87..998c0863925dd 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php @@ -160,10 +160,10 @@ public function testProductsFilterByCategoryHasCategoryTags(): void } QUERY; - $response = $this->dispatchGraphQlGETRequest(['query'=> $query]); + $response = $this->dispatchGraphQlGETRequest(['query' => $query]); $actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue()); $expectedCacheTags = ['cat_c', 'cat_c_333']; - + foreach ($expectedCacheTags as $cacheTag) { $this->assertArrayHasKey($cacheTag, $actualCacheTags); } From 3067d2d9ec14e7dec195977c90ae7f3057d5728f Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Thu, 26 Nov 2020 05:25:48 -0600 Subject: [PATCH 312/490] MC-39354: Magento 2.4.1 - REST API - Shipping and Billing Address - Issues with Custom Attributes Values - Adding billing address custom customer attribute --- ...GuestShippingInformationManagementTest.php | 47 +++++++++ ...mer_address_with_custom_text_attribute.php | 96 +++++++++++++++++++ ...ss_with_custom_text_attribute_rollback.php | 33 +++++++ 3 files changed, 176 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php index 4cb4b00d08a84..e54ce16051d60 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php @@ -12,6 +12,8 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Api\Data\ShippingAssignmentInterface; use Magento\TestFramework\Helper\Bootstrap; @@ -120,6 +122,51 @@ public function testDifferentAddresses(bool $swapShipping): void $this->management->saveAddressInformation($idMask->getMaskedId(), $shippingInformation); } + /** + * Test save address information with customer custom address attribute for quote + * + * @return void + * + * @throws LocalizedException + * @throws NoSuchEntityException + * @magentoDataFixture Magento/Sales/_files/quote.php + * @magentoDataFixture Magento/Customer/_files/customer_address_with_custom_text_attribute.php + */ + public function testSaveAddressInformationWithCustomerCustomAddressAttribute(): void + { + $carts = $this->cartRepo->getList( + $this->searchCriteria->addFilter('reserved_order_id', 'test01')->create() + )->getItems(); + $currentQuote = array_pop($carts); + $guestCustomer = $this->customerRepo->get('JohnDoe@mail.com'); + + $customerCustomAddressAttribute = $guestCustomer->getCustomAttributes(); + + /** @var ShippingAssignmentInterface $shippingAssignment */ + $shippingAssignment = $currentQuote->getExtensionAttributes()->getShippingAssignments()[0]; + $shippingAddress = $shippingAssignment->getShipping()->getAddress(); + $billingAddress = $currentQuote->getBillingAddress(); + + if ($customerCustomAddressAttribute) { + $shippingAddress->setCustomAttributes($customerCustomAddressAttribute); + $billingAddress->setCustomAttributes($customerCustomAddressAttribute); + } + + /** @var ShippingInformationInterface $shippingInformation */ + $shippingInformation = $this->shippingFactory->create(); + $shippingInformation->setBillingAddress($billingAddress); + $shippingInformation->setShippingAddress($shippingAddress); + $shippingInformation->setShippingMethodCode('flatrate'); + $shippingInformation->setShippingCarrierCode('flatrate'); + /** @var QuoteIdMask $idMask */ + $idMask = $this->maskFactory->create(); + $idMask->load($currentQuote->getId(), 'quote_id'); + + $paymentDetails = $this->management->saveAddressInformation($idMask->getMaskedId(), $shippingInformation); + $this->assertNotEmpty($paymentDetails); + $this->assertEquals($currentQuote->getGrandTotal(), $paymentDetails->getTotals()->getSubtotal()); + } + /** * Different variations for addresses test. * diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute.php new file mode 100644 index 0000000000000..ebe4ad76405ef --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Model\Address; +use Magento\Customer\Model\Customer; +use Magento\Eav\Model\Config; +use Magento\Eav\Model\Entity\Type; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Customer\Model\Attribute; +use Magento\Eav\Model\Entity\Attribute\Set; + +$objectManager = Bootstrap::getObjectManager(); +/** @var $entityType Type */ +$entityType = $objectManager + ->create(Config::class) + ->getEntityType('customer'); + +/** @var $attributeSet Set */ +$attributeSet = Bootstrap::getObjectManager() + ->create(Set::class); + +$select = Bootstrap::getObjectManager()->create( + Attribute::class, + [ + 'data' => [ + 'frontend_input' => 'text', + 'frontend_label' => ['test_text_attribute'], + 'sort_order' => 1, + 'backend_type' => 'varchar', + 'is_user_defined' => 1, + 'is_system' => 0, + 'is_used_in_grid' => 1, + 'is_required' => '0', + 'is_visible' => 1, + 'used_in_forms' => [ + 'customer_address_edit', + 'adminhtml_customer_address' + ], + 'attribute_set_id' => $entityType->getDefaultAttributeSetId(), + 'attribute_group_id' => $attributeSet->getDefaultGroupId($entityType->getDefaultAttributeSetId()), + 'entity_type_id' => $entityType->getId(), + 'default_value' => '', + ], + ] +); +$select->setAttributeCode('test_text_attribute'); +$select->save(); + +$customer = $objectManager + ->create(Customer::class); +$customer->setWebsiteId(1) + ->setEntityId(1) + ->setEntityTypeId($entityType->getId()) + ->setAttributeSetId($entityType->getDefaultAttributeSetId()) + ->setEmail('JohnDoe@mail.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('John') + ->setLastname('Doe') + ->setGender(2) + ->setTestTextAttribute('123'); +$customer->isObjectNew(true); +// Create address +$address = $objectManager->create(Address::class); +// default_billing and default_shipping information would not be saved, it is needed only for simple check +$address->addData( + [ + 'firstname' => 'Charles', + 'lastname' => 'Alston', + 'street' => '3781 Neuport Lane', + 'city' => 'Panola', + 'country_id' => 'US', + 'region_id' => '51', + 'postcode' => '30058', + 'telephone' => '770-322-3514', + 'default_billing' => 1, + 'default_shipping' => 1, + ] +); +// Assign customer and address +$customer->addAddress($address); +$customer->save(); +// Mark last address as default billing and default shipping for current customer +$customer->setDefaultBilling($address->getId()); +$customer->setDefaultShipping($address->getId()); +$customer->save(); + +$objectManager->get(Registry::class)->unregister('_fixture/Magento_ImportExport_Customer'); +$objectManager->get(Registry::class)->register('_fixture/Magento_ImportExport_Customer', $customer); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute_rollback.php new file mode 100644 index 0000000000000..3b276b77fbed5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address_with_custom_text_attribute_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\Customer\Model\Customer; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Customer\Model\Attribute; + +/** @var Registry $registry */ +$registry = Bootstrap::getObjectManager()->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var $attribute Attribute */ +$attribute = Bootstrap::getObjectManager()->create( + Attribute::class +); +$attribute->loadByCode('customer', 'test_text_attribute'); +$attribute->delete(); + +/** @var Customer $customer */ +$customer = Bootstrap::getObjectManager() + ->create(Customer::class); +$customer->setWebsiteId(1); +$customer->loadByEmail('JohnDoe@mail.com'); +$customer->delete(); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From e7bd3acc0e39f94d090bf5450581016d61f2c5e5 Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Fri, 27 Nov 2020 08:36:42 +0100 Subject: [PATCH 313/490] add cast to int type in other places --- .../Model/Export/AdvancedPricing.php | 3 ++- .../Bundle/Model/ResourceModel/Selection.php | 3 ++- .../Indexer/Product/Price/AbstractAction.php | 13 ++++++----- .../Catalog/Model/ResourceModel/Attribute.php | 2 +- .../Catalog/Model/ResourceModel/Category.php | 3 ++- .../Catalog/Model/ResourceModel/Url.php | 22 ++++++++++++------- .../DataProvider/AttributeQuery.php | 2 +- .../Model/Indexer/Stock/AbstractAction.php | 4 ++-- .../Indexer/Stock/DefaultStock.php | 2 +- .../Model/ResourceModel/Stock/Status.php | 8 ++++--- .../CatalogRule/Model/ResourceModel/Rule.php | 2 +- .../Indexer/Stock/Configurable.php | 2 +- .../Product/Type/Configurable.php | 2 +- .../ResourceModel/Indexer/Stock/Grouped.php | 2 +- .../Product/Indexer/Price/Grouped.php | 2 +- .../Model/ResourceModel/Video.php | 3 ++- .../ResourceModel/Customer/Collection.php | 3 ++- 17 files changed, 47 insertions(+), 31 deletions(-) diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php index af43562984134..b63141b510b85 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php @@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array ) ->where( 'ap.' . $productEntityLinkField . ' IN (?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); if ($priceFromFilter !== null) { diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Selection.php b/app/code/Magento/Bundle/Model/ResourceModel/Selection.php index ead687faff7bc..45018406277f9 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Selection.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Selection.php @@ -145,7 +145,8 @@ public function getParentIdsByChild($childId) ['e.entity_id as parent_product_id'] )->where( $this->getMainTable() . '.product_id IN(?)', - $childId + $childId, + \Zend_Db::INT_TYPE ); return $connection->fetchCol($select); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index f3a4b322e29df..404fd27232b93 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -465,10 +465,11 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null) [] )->where( 'e.entity_id IN(?)', - $parentIds + $parentIds, + \Zend_Db::INT_TYPE ); if (!empty($excludeIds)) { - $select->where('child_id NOT IN(?)', $excludeIds); + $select->where('child_id NOT IN(?)', $excludeIds, \Zend_Db::INT_TYPE); } $children = $this->getConnection()->fetchCol($select); @@ -479,7 +480,8 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null) $this->getIndexTargetTableByDimension($dimensions) )->where( 'entity_id IN(?)', - $children + $children, + \Zend_Db::INT_TYPE ); $query = $select->insertFromSelect($this->_defaultIndexerResource->getIdxTable(), [], false); $this->getConnection()->query($query); @@ -578,13 +580,14 @@ private function getParentProductsTypes(array $productsIds) ['e.entity_id as parent_id', 'type_id'] )->where( 'l.child_id IN(?)', - $productsIds + $productsIds, + \Zend_Db::INT_TYPE ); $pairs = $this->getConnection()->fetchPairs($select); $byType = []; foreach ($pairs as $productId => $productType) { - $byType[$productType][$productId] = $productId; + $byType[$productType][$productId] = (int)$productId; } return $byType; diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php index 203126cf1fd8c..03f1edea0ea77 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php @@ -101,7 +101,7 @@ protected function _clearUselessAttributeValues(\Magento\Framework\Model\Abstrac $attributeStoreIds = array_keys($this->_storeManager->getStores()); if (!empty($attributeStoreIds)) { $delCondition = [ - 'attribute_id = ?' => $object->getId(), + 'attribute_id = ?' => (int)$object->getId(), 'store_id IN(?)' => $attributeStoreIds, ]; $this->getConnection()->delete($object->getBackendTable(), $delCondition); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index e19286efc38c0..ed2df0f10ac3b 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -575,7 +575,8 @@ public function verifyIds(array $ids) 'entity_id' )->where( 'entity_id IN(?)', - $ids + $ids, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchCol($select); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Url.php b/app/code/Magento/Catalog/Model/ResourceModel/Url.php index be95f088a2477..eceae322fbd8e 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Url.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Url.php @@ -204,7 +204,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) ['value' => $attributeCode, 'entity_id' => 'entity_id'] )->where( 'entity_id IN(?)', - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE ); } elseif ($this->_categoryAttributes[$attributeCode]['is_global'] || $storeId == 0) { $select->from( @@ -216,7 +217,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) ['value'] )->where( "t1.{$identifierFiled} IN(?)", - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE )->where( 'e.attribute_id = :attribute_id' )->where( @@ -245,7 +247,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) 't1.attribute_id = :attribute_id' )->where( "e.entity_id IN(?)", - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE )->group('e.entity_id'); $bind['attribute_id'] = $this->_categoryAttributes[$attributeCode]['attribute_id']; @@ -308,7 +311,8 @@ public function _getProductAttribute($attributeCode, $productIds, $storeId) 0 )->where( 'entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); } else { $valueExpr = $connection->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); @@ -326,7 +330,8 @@ public function _getProductAttribute($attributeCode, $productIds, $storeId) 't1.attribute_id = :attribute_id' )->where( 't1.entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); $bind['store_id'] = $storeId; } @@ -430,7 +435,7 @@ protected function _getCategories($categoryIds, $storeId = null, $path = null) // Prepare variables for checking whether categories belong to store if ($path === null) { - $select->where('main_table.entity_id IN(?)', $categoryIds); + $select->where('main_table.entity_id IN(?)', $categoryIds, \Zend_Db::INT_TYPE); } else { // Ensure that path ends with '/', otherwise we can get wrong results - e.g. $path = '1/2' will get '1/20' if (substr($path, -1) != '/') { @@ -569,7 +574,7 @@ protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId $this->_productLimit ); if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); + $select->where('e.entity_id IN(?)', $productIds, \Zend_Db::INT_TYPE); } $rowSet = $connection->fetchAll($select, $bind); @@ -591,7 +596,8 @@ protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId ['product_id', 'category_id'] )->where( 'product_id IN(?)', - array_keys($products) + array_keys($products), + \Zend_Db::INT_TYPE ); $categories = $connection->fetchAll($select); foreach ($categories as $category) { diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php b/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php index b0f085932bb8e..201c70913ca39 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php @@ -148,7 +148,7 @@ private function getAttributesFromEntityTable( ): Select { $select = $connection->select() ->from(['e' => $entityTableName], $entityTableAttributes) - ->where('e.entity_id IN (?)', $entityIds); + ->where('e.entity_id IN (?)', $entityIds, \Zend_Db::INT_TYPE); return $select; } diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php index 4ea6b6bcfde9a..0b5f248331bfd 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php @@ -167,7 +167,7 @@ public function getRelationsByChild($childIds) )->join( ['relation' => $this->_getTable('catalog_product_relation')], 'relation.parent_id = cpe.' . $linkField - )->where('child_id IN(?)', $childIds); + )->where('child_id IN(?)', $childIds, \Zend_Db::INT_TYPE); return $connection->fetchCol($select); } @@ -262,7 +262,7 @@ private function doReindex($productIds = []) // retrieve product types by processIds $select = $connection->select() ->from($this->_getTable('catalog_product_entity'), ['entity_id', 'type_id']) - ->where('entity_id IN(?)', $productIds); + ->where('entity_id IN(?)', $productIds, \Zend_Db::INT_TYPE); $pairs = $connection->fetchPairs($select); $byType = []; diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php index c151e5897abd5..dec18044b699e 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php @@ -261,7 +261,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $this->getStatusExpression($connection, true)]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php index 02e443d09b228..afb7d51335df8 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php @@ -153,7 +153,7 @@ public function getProductsStockStatuses($productIds, $websiteId, $stockId = Sto $select = $this->getConnection()->select() ->from($this->getMainTable(), ['product_id', 'stock_status']) - ->where('product_id IN(?)', $productIds) + ->where('product_id IN(?)', $productIds, \Zend_Db::INT_TYPE) ->where('stock_id=?', (int) $stockId) ->where('website_id=?', (int) $websiteId); return $this->getConnection()->fetchPairs($select); @@ -190,7 +190,8 @@ public function getProductsType($productIds) ['entity_id', 'type_id'] )->where( 'entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchPairs($select); } @@ -360,7 +361,8 @@ public function getProductStatus($productIds, $storeId = null) $attribute->getAttributeId() )->where( "t1.{$linkField} IN(?)", - $productIds + $productIds, + \Zend_Db::INT_TYPE ); $rows = $connection->fetchPairs($select); diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php index 662cdede84ede..dd4f3306b8603 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php @@ -187,7 +187,7 @@ public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGro ->where('rule_date = ?', $date->format('Y-m-d')) ->where('website_id = ?', $websiteId) ->where('customer_group_id = ?', $customerGroupId) - ->where('product_id IN(?)', $productIds); + ->where('product_id IN(?)', $productIds, \Zend_Db::INT_TYPE); return $connection->fetchPairs($select); } diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php index 39fcdf86fdcf4..29c4812cc7b96 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php @@ -101,7 +101,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $stockStatusExpr]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php index 9d779d9704c29..0dd38062e5a65 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php @@ -203,7 +203,7 @@ public function getParentIdsByChild($childId) ['e' => $this->getTable('catalog_product_entity')], 'e.' . $this->optionProvider->getProductEntityLinkField() . ' = l.parent_id', ['e.entity_id'] - )->where('l.product_id IN(?)', $childId); + )->where('l.product_id IN(?)', $childId, \Zend_Db::INT_TYPE); $parentIds = $this->getConnection()->fetchCol($select); return $parentIds; diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php index 9d29b02f68bf1..b2a8a361564e0 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php @@ -94,7 +94,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $stockStatusExpr]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php index c5f0316feb126..4c24cdb752d3c 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php @@ -166,7 +166,7 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ ); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php b/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php index 68b593f335797..42fdf8265ee83 100644 --- a/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php +++ b/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php @@ -39,7 +39,8 @@ public function loadByIds(array $ids) $this->getMainTable() )->where( 'value_id IN(?)', - $ids + $ids, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchAll($select); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php index b6e55af96f4c1..a346ad4ede29b 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php @@ -213,7 +213,8 @@ protected function _addOrdersStatistics() \Magento\Sales\Model\Order::STATE_CANCELED )->where( 'orders.customer_id IN(?)', - $customerIds + $customerIds, + \Zend_Db::INT_TYPE )->group( 'orders.customer_id' ); From c323afc418d1f3389feabe70e62c004c47d4fc0a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 27 Nov 2020 10:30:14 +0200 Subject: [PATCH 314/490] MC-23545: Customer attribute of type file doesn't display in Account Information after created --- .../Magento/Customer/Controller/Account/EditPost.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Account/EditPost.php b/app/code/Magento/Customer/Controller/Account/EditPost.php index d2cc385b5793f..c2137f1b40019 100644 --- a/app/code/Magento/Customer/Controller/Account/EditPost.php +++ b/app/code/Magento/Customer/Controller/Account/EditPost.php @@ -212,10 +212,12 @@ public function execute() ); $attributeToDelete = $this->_request->getParam('delete_attribute_value'); - $this->deleteCustomerFileAttribute( - $customerCandidateDataObject, - $attributeToDelete - ); + if ($attributeToDelete !== null) { + $this->deleteCustomerFileAttribute( + $customerCandidateDataObject, + $attributeToDelete + ); + } try { // whether a customer enabled change email option From 6f68dc560f4318efec57430fe3903dd308ac83d9 Mon Sep 17 00:00:00 2001 From: Viktor Kopin <viktor.kopin@transoftgroup.com> Date: Mon, 23 Nov 2020 14:43:40 +0200 Subject: [PATCH 315/490] MC-30171: Add to Cart Form wrong Form Key in FPC --- .../StorefrontProductActionSection.xml | 1 + ...gRecalculationAfterCouponCodeAddedTest.xml | 2 +- ...CartFormKeyValueIsNotCachedActionGroup.xml | 32 +++++++ ...rontCachedInputFormKeyValueUpdatedTest.xml | 46 +++++++++ .../PageCache/ViewModel/FormKeyProvider.php | 41 ++++++++ .../view/frontend/layout/default.xml | 7 ++ .../view/frontend/requirejs-config.js | 3 +- .../templates/form_key_provider.phtml | 14 +++ .../view/frontend/web/js/form-key-provider.js | 93 +++++++++++++++++++ .../view/frontend/web/js/page-cache.js | 7 +- .../frontend/js/form-key-provider.test.js | 46 +++++++++ .../PageCache/frontend/js/page-cache.test.js | 7 -- 12 files changed, 287 insertions(+), 12 deletions(-) create mode 100644 app/code/Magento/PageCache/Test/Mftf/ActionGroup/AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup.xml create mode 100644 app/code/Magento/PageCache/Test/Mftf/Test/StorefrontCachedInputFormKeyValueUpdatedTest.xml create mode 100644 app/code/Magento/PageCache/ViewModel/FormKeyProvider.php create mode 100644 app/code/Magento/PageCache/view/frontend/templates/form_key_provider.phtml create mode 100644 app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js create mode 100644 dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/form-key-provider.test.js diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml index 13ced1c0263e0..64f365217d7e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml @@ -14,5 +14,6 @@ <element name="addToCartButtonTitleIsAdding" type="text" selector="//button/span[text()='Adding...']"/> <element name="addToCartButtonTitleIsAdded" type="text" selector="//button/span[text()='Added']"/> <element name="addToCartButtonTitleIsAddToCart" type="text" selector="//button/span[text()='Add to Cart']"/> + <element name="inputFormKey" type="text" selector="input[name='form_key']"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 20b94d0f4ec8a..40bdcff6ec937 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -88,7 +88,7 @@ <see userInput="Your coupon was successfully applied." stepKey="seeSuccessMessage"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/> <waitForPageLoad stepKey="waitForError"/> - <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> + <seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText('The shipping method is missing. Select the shipping method and try again.')}}" stepKey="seeShippingMethodError"/> <amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/> <waitForPageLoad stepKey="waitForShippingPageLoad"/> <click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/> diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup.xml new file mode 100644 index 0000000000000..6ef5f878023a1 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup"> + <annotations> + <description>Assert that product page add to cart form key is different from cached value.</description> + </annotations> + <arguments> + <argument name="cachedValue" type="string"/> + </arguments> + + <grabValueFrom selector="{{StorefrontProductActionSection.inputFormKey}}" stepKey="grabUpdatedValue"/> + <assertRegExp stepKey="validateCachedFormKey"> + <expectedResult type="string">/\w{16}/</expectedResult> + <actualResult type="string">{{cachedValue}}</actualResult> + </assertRegExp> + <assertRegExp stepKey="validateUpdatedFormKey"> + <expectedResult type="string">/\w{16}/</expectedResult> + <actualResult type="variable">grabUpdatedValue</actualResult> + </assertRegExp> + <assertNotEquals stepKey="assertFormKeyUpdated"> + <expectedResult type="string">{{cachedValue}}</expectedResult> + <actualResult type="variable">grabUpdatedValue</actualResult> + </assertNotEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/StorefrontCachedInputFormKeyValueUpdatedTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/StorefrontCachedInputFormKeyValueUpdatedTest.xml new file mode 100644 index 0000000000000..a9d77429e3248 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Mftf/Test/StorefrontCachedInputFormKeyValueUpdatedTest.xml @@ -0,0 +1,46 @@ +<?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="StorefrontCachedInputFormKeyValueUpdatedTest"> + <annotations> + <features value="PageCache"/> + <stories value="FormKey"/> + <title value="Form Key value should be updated by js script"/> + <description value="Form Key value should be updated by js script"/> + <testCaseId value="MC-39300"/> + <useCaseId value="MC-30171"/> + <severity value="AVERAGE"/> + <group value="pageCache"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="full_page"/> + </actionGroup> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <grabValueFrom selector="{{StorefrontProductActionSection.inputFormKey}}" stepKey="grabCachedValue"/> + <resetCookie userInput="PHPSESSID" stepKey="resetSessionCookie"/> + <resetCookie userInput="form_key" stepKey="resetFormKeyCookie"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="reopenProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup" stepKey="assertValueIsUpdatedByScript"> + <argument name="cachedValue" value="{$grabCachedValue}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/PageCache/ViewModel/FormKeyProvider.php b/app/code/Magento/PageCache/ViewModel/FormKeyProvider.php new file mode 100644 index 0000000000000..26f6be43c627a --- /dev/null +++ b/app/code/Magento/PageCache/ViewModel/FormKeyProvider.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\PageCache\ViewModel; + +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\PageCache\Model\Config; + +/** + * Adds script to update form key from cookie after script rendering + */ +class FormKeyProvider implements ArgumentInterface +{ + /** + * @var Config + */ + private $config; + + /** + * @param Config $config + */ + public function __construct( + Config $config + ) { + $this->config = $config; + } + + /** + * Is full page cache enabled + * + * @return bool + */ + public function isFullPageCacheEnabled(): bool + { + return $this->config->isEnabled(); + } +} diff --git a/app/code/Magento/PageCache/view/frontend/layout/default.xml b/app/code/Magento/PageCache/view/frontend/layout/default.xml index 7e1fc9d31b864..3db4b1c4ae52e 100644 --- a/app/code/Magento/PageCache/view/frontend/layout/default.xml +++ b/app/code/Magento/PageCache/view/frontend/layout/default.xml @@ -10,6 +10,13 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="pagecache_page_head_components" template="Magento_PageCache::js/components.phtml"/> </referenceBlock> + <referenceBlock name="head.additional"> + <block name="form_key_provider" template="Magento_PageCache::form_key_provider.phtml"> + <arguments> + <argument name="form_key_provider" xsi:type="object">Magento\PageCache\ViewModel\FormKeyProvider</argument> + </arguments> + </block> + </referenceBlock> <referenceContainer name="content"> <block class="Magento\PageCache\Block\Javascript" template="Magento_PageCache::javascript.phtml" name="pageCache" as="pageCache"/> </referenceContainer> diff --git a/app/code/Magento/PageCache/view/frontend/requirejs-config.js b/app/code/Magento/PageCache/view/frontend/requirejs-config.js index 7a33e2748b916..59d4499092965 100644 --- a/app/code/Magento/PageCache/view/frontend/requirejs-config.js +++ b/app/code/Magento/PageCache/view/frontend/requirejs-config.js @@ -8,5 +8,6 @@ var config = { '*': { pageCache: 'Magento_PageCache/js/page-cache' } - } + }, + deps: ['Magento_PageCache/js/form-key-provider'] }; diff --git a/app/code/Magento/PageCache/view/frontend/templates/form_key_provider.phtml b/app/code/Magento/PageCache/view/frontend/templates/form_key_provider.phtml new file mode 100644 index 0000000000000..4f952002e458f --- /dev/null +++ b/app/code/Magento/PageCache/view/frontend/templates/form_key_provider.phtml @@ -0,0 +1,14 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +if ($block->getFormKeyProvider()->isFullPageCacheEnabled()): ?> + <script type="text/x-magento-init"> + { + "*": { + "Magento_PageCache/js/form-key-provider": {} + } + } + </script> +<?php endif; ?> diff --git a/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js new file mode 100644 index 0000000000000..c63d97840e946 --- /dev/null +++ b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js @@ -0,0 +1,93 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define(function () { + 'use strict'; + + return function () { + var formKey, + inputElements, + inputSelector = 'input[name="form_key"]'; + + /** + * Set form_key cookie + * @private + */ + function setFormKeyCookie(value) { + var expires, + secure, + date = new Date(), + isSecure = !!window.cookiesConfig && window.cookiesConfig.secure; + + date.setTime(date.getTime() + 86400000); + expires = '; expires=' + date.toUTCString(); + secure = isSecure ? '; secure' : ''; + + document.cookie = 'form_key=' + (value || '') + expires + secure + '; path=/'; + } + + /** + * Retrieves form key from cookie + * @private + */ + function getFormKeyCookie() { + var cookie, + i, + nameEQ = 'form_key=', + cookieArr = document.cookie.split(';'); + + for (i = 0; i < cookieArr.length; i++) { + cookie = cookieArr[i]; + + while (cookie.charAt(0) === ' ') { + cookie = cookie.substring(1, cookie.length); + } + + if (cookie.indexOf(nameEQ) === 0) { + return cookie.substring(nameEQ.length, cookie.length); + } + } + + return null; + } + + /** + * Generate form key string + * @private + */ + function generateFormKeyString() { + var result = '', + length = 16, + chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + while (length--) { + result += chars[Math.round(Math.random() * (chars.length - 1))]; + } + + return result; + } + + /** + * Init form_key inputs with value + * @private + */ + function initFormKey() { + formKey = getFormKeyCookie(); + + if (!formKey) { + formKey = generateFormKeyString(); + setFormKeyCookie(formKey); + } + inputElements = document.querySelectorAll(inputSelector); + + if (inputElements.length) { + Array.prototype.forEach.call(inputElements, function (element) { + element.setAttribute('value', formKey); + }); + } + } + + initFormKey(); + }; +}); diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index 41a32ab8a49c8..d7214918c530d 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -7,9 +7,10 @@ define([ 'jquery', 'domReady', 'consoleLogger', + 'Magento_PageCache/js/form-key-provider', 'jquery-ui-modules/widget', 'mage/cookies' -], function ($, domReady, consoleLogger) { +], function ($, domReady, consoleLogger, formKeyInit) { 'use strict'; /** @@ -99,6 +100,7 @@ define([ /** * FormKey Widget - this widget is generating from key, saves it to cookie and + * @deprecated see Magento/PageCache/view/frontend/web/js/form-key-provider.js */ $.widget('mage.formKey', { options: { @@ -298,8 +300,7 @@ define([ }); domReady(function () { - $('body') - .formKey(); + formKeyInit(); }); return { diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/form-key-provider.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/form-key-provider.test.js new file mode 100644 index 0000000000000..162c00a9c0cca --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/form-key-provider.test.js @@ -0,0 +1,46 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint-disable max-nested-callbacks */ +define([ + 'jquery', + 'Magento_PageCache/js/form-key-provider' +], function ($, formKeyInit) { + 'use strict'; + + describe('Testing FormKey Provider', function () { + var inputContainer; + + beforeEach(function () { + inputContainer = document.createElement('input'); + inputContainer.setAttribute('value', ''); + inputContainer.setAttribute('name', 'form_key'); + document.querySelector('body').appendChild(inputContainer); + }); + + afterEach(function () { + $(inputContainer).remove(); + document.cookie = 'form_key= ; expires = Thu, 01 Jan 1970 00:00:00 GMT'; + }); + + it('sets value of input[form_key]', function () { + var expires, + date = new Date(); + + date.setTime(date.getTime() + 86400000); + expires = '; expires=' + date.toUTCString(); + document.cookie = 'form_key=FAKE_COOKIE' + expires + '; path=/'; + formKeyInit(); + expect($(inputContainer).val()).toEqual('FAKE_COOKIE'); + }); + + it('widget sets value to input[form_key] in case it empty', function () { + document.cookie = 'form_key= ; expires = Thu, 01 Jan 1970 00:00:00 GMT'; + formKeyInit(); + expect($(inputContainer).val()).toEqual(jasmine.any(String)); + expect($(inputContainer).val().length).toEqual(16); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/page-cache.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/page-cache.test.js index 14e0523fd5151..f12d36e888f22 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/page-cache.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/page-cache.test.js @@ -106,13 +106,6 @@ define([ expect($.mage.cookies.set).toHaveBeenCalled(); expect(inputContainer.val()).toEqual(jasmine.any(String)); }); - - it('widget exists on load on body', function (done) { - $(function () { - expect($('body').data('mageFormKey')).toBeDefined(); - done(); - }); - }); }); describe('Testing PageCache Widget', function () { From 3eb35534049555fa7730a54d996c4ba2afa4975f Mon Sep 17 00:00:00 2001 From: Chandresh Chauhan <47473360+Chandresh22@users.noreply.github.com> Date: Fri, 27 Nov 2020 15:28:11 +0530 Subject: [PATCH 316/490] Update ReviewDataProvider.php --- .../Review/Ui/DataProvider/Product/ReviewDataProvider.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php index e79ef14b3e3e0..315739e94fc0c 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/ReviewDataProvider.php @@ -110,7 +110,6 @@ public function addOrder($field, $direction) /** * @inheritdoc * @since 100.1.0 - * @return void */ public function addFilter(Filter $filter) { From 9bd13e403a7d21bea3e0c819cd7f546de153f815 Mon Sep 17 00:00:00 2001 From: engcom-Echo <engcom-vendorworker-echo@adobe.com> Date: Fri, 27 Nov 2020 12:58:01 +0200 Subject: [PATCH 317/490] MC-37807: Link to a file of a Product with Customizable Option(File) is not available throughout a multishipping checkout process --- .../templates/checkout/item/default.phtml | 15 ++- .../Block/Checkout/OverviewTest.php | 91 ++++++++++++++----- 2 files changed, 77 insertions(+), 29 deletions(-) diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml index 5d7f06475af28..d5ef7e3d5c448 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml @@ -6,18 +6,23 @@ // phpcs:disable Magento2.Files.LineLength ?> -<strong class="product name product-item-name"><a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"><?= $block->escapeHtml($block->getProductName()) ?></a></strong> +<?php +/** @var \Magento\Checkout\Block\Cart\Item\Renderer\ $block */ +/** @var \Magento\Framework\Escaper $escaper */ +?> + +<strong class="product name product-item-name"><a href="<?= $escaper->escapeUrl($block->getProductUrl()) ?>"><?= $escaper->escapeHtml($block->getProductName()) ?></a></strong> <?php if ($_options = $block->getOptionList()) : ?> <dl class="item-options"> <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?> - <dt><?= $block->escapeHtml($_option['label']) ?></dt> + <dt><?= $escaper->escapeHtml($_option['label']) ?></dt> <dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>> - <?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?> + <?= $escaper->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?> <?php if (isset($_formatedOptionValue['full_view'])) : ?> <dl class="item options tooltip content"> - <dt><?= $block->escapeHtml($_option['label']) ?></dt> - <dd><?= $block->escapeHtml($_formatedOptionValue['full_view'], ['span']) ?></dd> + <dt><?= $escaper->escapeHtml($_option['label']) ?></dt> + <dd><?= $escaper->escapeHtml($_formatedOptionValue['full_view'], ['span']) ?></dd> </dl> <?php endif; ?> </dd> diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php index 5009f210404d0..f4829cb614234 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php @@ -6,28 +6,55 @@ namespace Magento\Multishipping\Block\Checkout; +use Magento\Catalog\Model\Product; +use Magento\Checkout\Block\Cart\Item\Renderer; +use Magento\Framework\App\Area; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\Element\RendererList; +use Magento\Framework\View\LayoutInterface; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Item; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\Xpath; +use PHPUnit\Framework\TestCase; + /** - * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * Verify default items template */ -class OverviewTest extends \PHPUnit\Framework\TestCase +class OverviewTest extends TestCase { /** - * @var \Magento\Multishipping\Block\Checkout\Overview + * @var Overview + */ + protected $block; + + /** + * @var ObjectManagerInterface */ - protected $_block; + protected $objectManager; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var Quote */ - protected $_objectManager; + private $quote; + + /** + * @var Product + */ + private $product; + + /** + * @var Item + */ + private $item; protected function setUp(): void { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND); - $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->_block = $this->_objectManager->get(\Magento\Framework\View\LayoutInterface::class) + Bootstrap::getInstance()->loadArea(Area::AREA_FRONTEND); + $this->objectManager = Bootstrap::getObjectManager(); + $this->block = $this->objectManager->get(LayoutInterface::class) ->createBlock( - \Magento\Multishipping\Block\Checkout\Overview::class, + Overview::class, 'checkout_overview', [ 'data' => [ @@ -37,33 +64,49 @@ protected function setUp(): void ] ); - $this->_block->addChild('renderer.list', \Magento\Framework\View\Element\RendererList::class); - $this->_block->getChildBlock( + $this->block->addChild('renderer.list', RendererList::class); + $this->block->getChildBlock( 'renderer.list' )->addChild( 'default', - \Magento\Checkout\Block\Cart\Item\Renderer::class, + Renderer::class, ['template' => 'cart/item/default.phtml'] ); + $this->quote = $this->objectManager->get(Quote::class); + $this->product = $this->objectManager->get(Product::class); + $this->item = $this->objectManager->get(Item::class); } + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ public function testGetRowItemHtml() { - /** @var $item \Magento\Quote\Model\Quote\Item */ - $item = $this->_objectManager->create(\Magento\Quote\Model\Quote\Item::class); - /** @var $product \Magento\Catalog\Model\Product */ - $product = $this->_objectManager->create(\Magento\Catalog\Model\Product::class); - $product->load(1); - $item->setProduct($product); - /** @var $quote \Magento\Quote\Model\Quote */ - $quote = $this->_objectManager->create(\Magento\Quote\Model\Quote::class); - $item->setQuote($quote); + $product = $this->product->load('1'); + $item = $this->item->setProduct($product); + $item->setQuote($this->quote); // assure that default renderer was obtained $this->assertEquals( 1, - \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( + Xpath::getElementsCountForXpath( '//*[contains(@class,"product") and contains(@class,"name")]/a', - $this->_block->getRowItemHtml($item) + $this->block->getRowItemHtml($item) + ) + ); + } + + /** + * @magentoDataFixture Magento/Checkout/_files/customer_quote_with_items_simple_product_options.php + */ + public function testLinkOptionalProductFileItemHtml() + { + $quote = $this->quote->load('customer_quote_product_custom_options', 'reserved_order_id'); + $item = current($quote->getAllItems()); + $this->assertEquals( + 1, + Xpath::getElementsCountForXpath( + '//dd/a[contains(text(), "test.jpg")]', + $this->block->getRowItemHtml($item) ) ); } From 8626a361ea0aa7ef27b59608b321a996504b2e58 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 27 Nov 2020 16:08:40 +0200 Subject: [PATCH 318/490] adding action group itself --- .../AdminSetStockStatusActionGroup.xml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetStockStatusActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetStockStatusActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetStockStatusActionGroup.xml new file mode 100644 index 0000000000000..05f5a90cc97a7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetStockStatusActionGroup.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="AdminSetStockStatusActionGroup"> + <annotations> + <description>Set Stock Status of product.</description> + </annotations> + + <arguments> + <argument name="stockStatus" type="string" defaultValue="In Stock"/> + </arguments> + + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}" stepKey="setStockStatus"/> + + </actionGroup> +</actionGroups> From 0ace0c314266ef112f8c0c860fb537a0ca64c8df Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 27 Nov 2020 16:35:13 +0200 Subject: [PATCH 319/490] 27845 fix when qty or id not specified in grouped_options --- .../Api/Data/GroupedOptionsInterface.php | 8 ++--- .../Model/Quote/Item/CartItemProcessor.php | 30 +++++++++++++++---- .../Model/Quote/Item/GroupedOptions.php | 19 +++++++----- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php index e1f1d33a28654..9278ef168eb0d 100644 --- a/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php +++ b/app/code/Magento/GroupedProduct/Api/Data/GroupedOptionsInterface.php @@ -17,16 +17,16 @@ interface GroupedOptionsInterface extends ExtensibleDataInterface /** * Get associated product id * - * @return int + * @return int|null */ - public function getId(): int; + public function getId(): ?int; /** * Get associated product qty * - * @return int + * @return int|null */ - public function getQty(): int; + public function getQty(): ?int; /** * Set extension attributes diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php index c7e9989d849d5..78ab91194992e 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/CartItemProcessor.php @@ -9,6 +9,8 @@ use Magento\Framework\DataObject; use Magento\Framework\DataObject\Factory as ObjectFactory; +use Magento\Framework\Exception\LocalizedException; +use Magento\GroupedProduct\Api\Data\GroupedOptionsInterface; use Magento\GroupedProduct\Model\Product\Type\Grouped; use Magento\Quote\Api\Data as QuoteApi; use Magento\Quote\Api\Data\CartItemInterface; @@ -71,17 +73,33 @@ public function convertToBuyRequest(CartItemInterface $cartItem): ?DataObject $groupedOptions = $cartItem->getProductOption()->getExtensionAttributes()->getGroupedOptions(); $this->groupedOptions = $groupedOptions; - $requestData = []; - foreach ($groupedOptions as $item) { - $requestData[self::SUPER_GROUP_CODE][$item->getId()] = $item->getQty(); - } - - return $this->objectFactory->create($requestData); + return $this->objectFactory->create($this->getConvertedData($groupedOptions)); } return null; } + /** + * Returns grouped_options converted to super_group data + * + * @param GroupedOptionsInterface[] $groupedOptions + * @return array + * @throws LocalizedException + */ + private function getConvertedData(array $groupedOptions): array + { + $requestData = []; + foreach ($groupedOptions as $item) { + /** @var GroupedOptionsInterface $item */ + if ($item->getQty() === null || $item->getId() === null) { + throw new LocalizedException(__('Please specify id and qty for grouped options.')); + } + $requestData[self::SUPER_GROUP_CODE][$item->getId()] = $item->getQty(); + } + + return $requestData; + } + /** * Option processor * diff --git a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php index 76dfc74806df1..3b249a7b5d548 100644 --- a/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php +++ b/app/code/Magento/GroupedProduct/Model/Quote/Item/GroupedOptions.php @@ -16,12 +16,12 @@ class GroupedOptions implements GroupedOptionsInterface { /** - * @var int + * @var int|null */ private $qty; /** - * @var int + * @var int|null */ private $id; @@ -31,12 +31,15 @@ class GroupedOptions implements GroupedOptionsInterface private $extensionAttributes; /** - * @param int $id - * @param int $qty + * @param int|null $id + * @param int|null $qty * @param GroupedOptionsExtensionInterface|null $extensionAttributes */ - public function __construct(int $id, int $qty, $extensionAttributes = null) - { + public function __construct( + ?int $id = null, + ?int $qty = null, + ?GroupedOptionsExtensionInterface $extensionAttributes = null + ) { $this->id = $id; $this->qty = $qty; $this->extensionAttributes = $extensionAttributes; @@ -45,7 +48,7 @@ public function __construct(int $id, int $qty, $extensionAttributes = null) /** * @inheritDoc */ - public function getId(): int + public function getId(): ?int { return $this->id; } @@ -53,7 +56,7 @@ public function getId(): int /** * @inheritDoc */ - public function getQty(): int + public function getQty(): ?int { return $this->qty; } From c6aaabc206c335ca9235ff84a403f9d6ac937ebc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 27 Nov 2020 16:36:52 +0200 Subject: [PATCH 320/490] MC-38822: Attributes position doesn't affect the ranking in graphql response --- .../Plugin/Search/Request/ConfigReader.php | 3 + .../CategoryAggregationsTest.php | 56 ++++++ ...cts_with_layered_navigation_attributes.php | 165 ++++++++++++++++++ ...layered_navigation_attributes_rollback.php | 63 +++++++ 4 files changed, 287 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php diff --git a/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php b/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php index 992ab50467c72..b61ecfff4e3f1 100644 --- a/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php +++ b/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php @@ -106,6 +106,9 @@ private function getSearchableAttributes(): array $productAttributes->addFieldToFilter( ['is_searchable', 'is_visible_in_advanced_search', 'is_filterable', 'is_filterable_in_search'], [1, 1, [1, 2], 1] + )->setOrder( + 'position', + 'ASC' ); /** @var Attribute $attribute */ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php new file mode 100644 index 0000000000000..a0f184507a9aa --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Catalog\CategoriesQuery; + +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test to return category aggregations + */ +class CategoryAggregationsTest extends GraphQlAbstract +{ + /** + * Test to return category aggregations in sorting by position + * + * @magentoApiDataFixture Magento/Catalog/_files/products_with_layered_navigation_attributes.php + */ + public function testCategoryAggregationSorting(): void + { + $categoryId = 3334; + $query = <<<QUERY +{ + products(filter: {category_id: {eq: "{$categoryId}"}}) { + aggregations{ + label + attribute_code + count + options{ + label + value + count + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertArrayNotHasKey('errors', $response); + $this->assertArrayHasKey('products', $response); + $this->assertArrayHasKey('aggregations', $response['products']); + + $customAggregation = array_values(array_filter( + $response['products']['aggregations'], + function ($a) { + return in_array($a['attribute_code'], ['test_attribute_1', 'test_attribute_2']); + } + )); + $this->assertCount(2, $customAggregation); + $this->assertEquals('test_attribute_2', $customAggregation[0]['attribute_code']); + $this->assertEquals('test_attribute_1', $customAggregation[1]['attribute_code']); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php new file mode 100644 index 0000000000000..8764e12916d8b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php @@ -0,0 +1,165 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\CategoryInterfaceFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterfaceFactory; +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +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\Eav\Model\Config; +use Magento\Eav\Setup\EavSetup; +use Magento\Indexer\Model\Indexer; +use Magento\Indexer\Model\Indexer\Collection; +use Magento\Msrp\Model\Product\Attribute\Source\Type as SourceType; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\CacheCleaner; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Config $eavConfig */ +$eavConfig = $objectManager->get(Config::class); + +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +/** @var ProductAttributeInterfaceFactory $attributeFactory */ +$attributeFactory = $objectManager->get(ProductAttributeInterfaceFactory::class); + +/** @var $installer EavSetup */ +$installer = $objectManager->get(EavSetup::class); +$attributeSetId = $installer->getAttributeSetId(Product::ENTITY, 'Default'); +$groupId = $installer->getDefaultAttributeGroupId(Product::ENTITY, $attributeSetId); + +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsite = $websiteRepository->get('base'); + +for ($i = 1; $i <= 2; $i++) { + $attributeModel = $attributeFactory->create(); + $attributeModel->setData( + [ + 'attribute_code' => 'test_attribute_' . $i, + 'entity_type_id' => $installer->getEntityTypeId(Product::ENTITY), + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 1, + 'is_visible_in_advanced_search' => 1, + 'is_comparable' => 1, + 'is_filterable' => 1, + 'is_filterable_in_search' => 1, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 1, + 'used_in_product_listing' => 1, + 'used_for_sort_by' => 1, + 'frontend_label' => ['Test Attribute ' . $i], + 'backend_type' => 'int', + 'option' => [ + 'value' => ['option_0' => ['Option 1'], 'option_1' => ['Option 2']], + 'order' => ['option_0' => 1, 'option_1' => 2], + ], + 'default' => ['option_0'], + 'position' => 3 - $i + ] + ); + $attribute = $attributeRepository->save($attributeModel); + $installer->addAttributeToGroup(Product::ENTITY, $attributeSetId, $groupId, $attribute->getId()); +} + +CacheCleaner::cleanAll(); +$eavConfig->clear(); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductInterfaceFactory $productInterfaceFactory */ +$productInterfaceFactory = $objectManager->get(ProductInterfaceFactory::class); + +/** @var Product $product */ +$product = $productInterfaceFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setName('Simple Product1') + ->setSku('simple1') + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setOptionsContainer('container1') + ->setMsrpDisplayActualPriceType(SourceType::TYPE_IN_CART) + ->setPrice(10) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setCategoryIds([]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setSpecialPrice('5.99'); +$simple1 = $productRepository->save($product); + +/** @var Product $product */ +$product = $productInterfaceFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setName('Simple Product2') + ->setSku('simple2') + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setOptionsContainer('container1') + ->setMsrpDisplayActualPriceType(SourceType::TYPE_ON_GESTURE) + ->setPrice(20) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setCategoryIds([]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 50, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setSpecialPrice('15.99'); +$simple2 = $productRepository->save($product); + +/** @var CategoryInterfaceFactory $categoryInterfaceFactory */ +$categoryInterfaceFactory = $objectManager->get(CategoryInterfaceFactory::class); + +$category = $categoryInterfaceFactory->create(); +$category->isObjectNew(true); +$category->setId(3334) + ->setCreatedAt('2014-06-23 09:50:07') + ->setName('Category 1') + ->setParentId(2) + ->setPath('1/2/333') + ->setLevel(2) + ->setAvailableSortBy(['position', 'name']) + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1) + ->setPostedProducts( + [ + $simple1->getId() => 10, + $simple2->getId() => 11 + ] + ); +$category->save(); + +/** @var Collection $indexerCollection */ +$indexerCollection = $objectManager->get(Collection::class); +$indexerCollection->load(); +/** @var Indexer $indexer */ +foreach ($indexerCollection->getItems() as $indexer) { + $indexer->reindexAll(); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php new file mode 100644 index 0000000000000..49e2b549552e6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Eav\Model\Config; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Catalog\Model\GetCategoryByName; +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 (['simple1', 'simple2'] as $sku) { + try { + $product = $productRepository->get($sku, false, null, true); + $productRepository->delete($product); + } catch (NoSuchEntityException $exception) { + //Product already removed + } +} + +/** @var CategoryRepositoryInterface $categoryRepository */ +$categoryRepository = $objectManager->get(CategoryRepositoryInterface::class); +/** @var GetCategoryByName $getCategoryByName */ +$getCategoryByName = $objectManager->get(GetCategoryByName::class); +$category = $getCategoryByName->execute('Category 1'); +try { + if ($category->getId()) { + $categoryRepository->delete($category); + } +} catch (NoSuchEntityException $exception) { + //Category already removed +} + +$eavConfig = $objectManager->get(Config::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); + +try { + for ($i = 1; $i <= 2; $i++) { + $attribute = $attributeRepository->get('test_attribute_' . $i); + $attributeRepository->delete($attribute); + } +} catch (NoSuchEntityException $exception) { + //Attribute already removed +} +$eavConfig->clear(); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 4d1e4eafc8a5554d4114e2d892b0ecd99402a5b3 Mon Sep 17 00:00:00 2001 From: Taras Gamanov <tgamanov@gmail.com> Date: Fri, 27 Nov 2020 16:46:33 +0200 Subject: [PATCH 321/490] MAGETWO-96537 has been updated --- ...reFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 20b94d0f4ec8a..40bdcff6ec937 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -88,7 +88,7 @@ <see userInput="Your coupon was successfully applied." stepKey="seeSuccessMessage"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/> <waitForPageLoad stepKey="waitForError"/> - <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> + <seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText('The shipping method is missing. Select the shipping method and try again.')}}" stepKey="seeShippingMethodError"/> <amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/> <waitForPageLoad stepKey="waitForShippingPageLoad"/> <click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/> From 12806e0f33d748247436320a74ee6e9e1f6ac1d0 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Fri, 27 Nov 2020 16:51:08 +0200 Subject: [PATCH 322/490] MAGETWO-96537 has been updated --- ...reFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 20b94d0f4ec8a..40bdcff6ec937 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -88,7 +88,7 @@ <see userInput="Your coupon was successfully applied." stepKey="seeSuccessMessage"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/> <waitForPageLoad stepKey="waitForError"/> - <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> + <seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText('The shipping method is missing. Select the shipping method and try again.')}}" stepKey="seeShippingMethodError"/> <amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/> <waitForPageLoad stepKey="waitForShippingPageLoad"/> <click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/> From e567fd6c343cd383bc58b8b6b8b90b45844ded7d Mon Sep 17 00:00:00 2001 From: TuNa <ladiesman9x@gmail.com> Date: Fri, 27 Nov 2020 21:51:16 +0700 Subject: [PATCH 323/490] Fix minisearch not appear when disable suggestions search update up up up up up update update update up update update testCaseId --- .../Section/StorefrontQuickSearchSection.xml | 1 + ...ldVisibilityWhenSuggestionDisabledTest.xml | 54 +++++++++ .../Search/ViewModel/ConfigProvider.php | 21 +++- .../view/frontend/templates/form.mini.phtml | 44 +++---- .../Search/view/frontend/web/js/form-mini.js | 113 +++++++++--------- 5 files changed, 156 insertions(+), 77 deletions(-) create mode 100644 app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml diff --git a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml index 34379fd6d2e4a..088bd5eed4cc3 100644 --- a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml +++ b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml @@ -14,5 +14,6 @@ <element name="searchMiniForm" type="input" selector="#search_mini_form"/> <element name="searchDropDownSuggestion" type="text" selector="//div[@id='search_autocomplete']/ul/li/span"/> <element name="searchDropDownName" type="text" selector="//div[@id='search_autocomplete']//span[contains(., '{{searchQuery}}')]" parameterized="true"/> + <element name="searchMagnifierIcon" type="text" selector="//*[@id='search_mini_form']//label[@data-role='minisearch-label']"/> </section> </sections> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml new file mode 100644 index 0000000000000..cdd52bd2b524e --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml @@ -0,0 +1,54 @@ +<?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="StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest"> + <annotations> + <stories value="Search Term"/> + <title value="Mini search field appears if suggestions was disabled"/> + <description value="Mini search field appears if suggestions was disabled"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-39443"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <!-- Login as admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Disable search suggestion --> + <magentoCLI command="config:set catalog/search/search_suggestion_enabled 0" stepKey="disableSearchSuggestion"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheFirst"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + + <after> + <!-- Enable search suggestion back --> + <magentoCLI command="config:set catalog/search/search_suggestion_enabled 1" stepKey="disableSearchSuggestion"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheSecond"> + <argument name="tags" value="config full_page"/> + </actionGroup> + + <!-- Admin logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <resizeWindow width="767" height="720" stepKey="resizeWindowToMobileView"/> + + <click selector="{{StorefrontQuickSearchSection.searchMagnifierIcon}}" stepKey="clickOnMagnifierSearchIcon"/> + + <waitForElementVisible selector="{{StorefrontQuickSearchSection.searchPhrase}}" after="clickOnMagnifierSearchIcon" stepKey="seeInputSearchActive"/> + + </test> +</tests> diff --git a/app/code/Magento/Search/ViewModel/ConfigProvider.php b/app/code/Magento/Search/ViewModel/ConfigProvider.php index be3366e62e965..b1db5b57e13e0 100644 --- a/app/code/Magento/Search/ViewModel/ConfigProvider.php +++ b/app/code/Magento/Search/ViewModel/ConfigProvider.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Store\Model\ScopeInterface; +use Magento\Search\Helper\Data as SearchHelper; /** * View model for search @@ -26,13 +27,31 @@ class ConfigProvider implements ArgumentInterface */ private $scopeConfig; + /** + * @var SearchHelper + */ + private $searchHelper; + /** * @param ScopeConfigInterface $scopeConfig + * @param SearchHelper $searchHelper */ public function __construct( - ScopeConfigInterface $scopeConfig + ScopeConfigInterface $scopeConfig, + SearchHelper $searchHelper ) { $this->scopeConfig = $scopeConfig; + $this->searchHelper = $searchHelper; + } + + /** + * Retrieve search helper instance for template view + * + * @return SearchHelper + */ + public function getSearchHelperData(): SearchHelper + { + return $this->searchHelper; } /** diff --git a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml index 80e720e2c2fe2..c6b2a6a729575 100644 --- a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml +++ b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml @@ -4,40 +4,42 @@ * See COPYING.txt for license details. */ -// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis ?> <?php /** @var $block \Magento\Framework\View\Element\Template */ -/** @var $helper \Magento\Search\Helper\Data */ +/** @var $escaper \Magento\Framework\Escaper */ /** @var $configProvider \Magento\Search\ViewModel\ConfigProvider */ -$helper = $this->helper(\Magento\Search\Helper\Data::class); $configProvider = $block->getData('configProvider'); +/** @var $helper \Magento\Search\Helper\Data */ +$helper = $configProvider->getSearchHelperData(); +$allowedSuggestion = $configProvider->isSuggestionsAllowed(); +$quickSearchUrl = $allowedSuggestion ? $escaper->escapeUrl($helper->getSuggestUrl()) : ''; ?> <div class="block block-search"> - <div class="block block-title"><strong><?= $block->escapeHtml(__('Search')) ?></strong></div> + <div class="block block-title"><strong><?= $escaper->escapeHtml(__('Search')) ?></strong></div> <div class="block block-content"> <form class="form minisearch" id="search_mini_form" - action="<?= $block->escapeUrl($helper->getResultUrl()) ?>" method="get"> + action="<?= $escaper->escapeUrl($helper->getResultUrl()) ?>" method="get"> <div class="field search"> <label class="label" for="search" data-role="minisearch-label"> - <span><?= $block->escapeHtml(__('Search')) ?></span> + <span><?= $escaper->escapeHtml(__('Search')) ?></span> </label> <div class="control"> <input id="search" - <?php if ($configProvider->isSuggestionsAllowed()):?> - data-mage-init='{"quickSearch":{ - "formSelector":"#search_mini_form", - "url":"<?= $block->escapeUrl($helper->getSuggestUrl())?>", - "destinationSelector":"#search_autocomplete", - "minSearchLength":"<?= $block->escapeHtml($helper->getMinQueryLength()) ?>"} - }' - <?php endif;?> + data-mage-init='{ + "quickSearch": { + "formSelector": "#search_mini_form", + "url": "<?= /* @noEscape */ $quickSearchUrl ?>", + "destinationSelector": "#search_autocomplete", + "minSearchLength": "<?= $escaper->escapeHtml($helper->getMinQueryLength()) ?>" + } + }' type="text" - name="<?= $block->escapeHtmlAttr($helper->getQueryParamName()) ?>" + name="<?= $escaper->escapeHtmlAttr($helper->getQueryParamName()) ?>" value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>" - placeholder="<?= $block->escapeHtmlAttr(__('Search entire store here...')) ?>" + placeholder="<?= $escaper->escapeHtmlAttr(__('Search entire store here...')) ?>" class="input-text" - maxlength="<?= $block->escapeHtmlAttr($helper->getMaxQueryLength()) ?>" + maxlength="<?= $escaper->escapeHtmlAttr($helper->getMaxQueryLength()) ?>" role="combobox" aria-haspopup="false" aria-autocomplete="both" @@ -49,11 +51,11 @@ $configProvider = $block->getData('configProvider'); </div> <div class="actions"> <button type="submit" - title="<?= $block->escapeHtml(__('Search')) ?>" - class="action search" - aria-label="Search" + title="<?= $escaper->escapeHtml(__('Search')) ?>" + class="action search" + aria-label="Search" > - <span><?= $block->escapeHtml(__('Search')) ?></span> + <span><?= $escaper->escapeHtml(__('Search')) ?></span> </button> </div> </form> diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index 9b4c814f73d73..b8034fead76d0 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -35,12 +35,12 @@ define([ selectClass: 'selected', template: '<li class="<%- data.row_class %>" id="qs-option-<%- data.index %>" role="option">' + - '<span class="qs-option-name">' + - ' <%- data.title %>' + - '</span>' + - '<span aria-hidden="true" class="amount">' + - '<%- data.num_results %>' + - '</span>' + + '<span class="qs-option-name">' + + ' <%- data.title %>' + + '</span>' + + '<span aria-hidden="true" class="amount">' + + '<%- data.num_results %>' + + '</span>' + '</li>', submitBtn: 'button[type="submit"]', searchLabel: '[data-role=minisearch-label]', @@ -300,60 +300,63 @@ define([ if (value.length >= parseInt(this.options.minSearchLength, 10)) { this.submitBtn.disabled = false; - $.getJSON(this.options.url, { - q: value - }, $.proxy(function (data) { - if (data.length) { - $.each(data, function (index, element) { - var html; - - element.index = index; - html = template({ - data: element - }); - dropdown.append(html); - }); - - this._resetResponseList(true); - this.responseList.indexList = this.autoComplete.html(dropdown) - .css(clonePosition) - .show() - .find(this.options.responseFieldElements + ':visible'); - - this.element.removeAttr('aria-activedescendant'); + if (this.options.url !== '') { //eslint-disable-line eqeqeq + $.getJSON(this.options.url, { + q: value + }, $.proxy(function (data) { + if (data.length) { + $.each(data, function (index, element) { + var html; + + element.index = index; + html = template({ + data: element + }); + dropdown.append(html); + }); - if (this.responseList.indexList.length) { - this._updateAriaHasPopup(true); + this._resetResponseList(true); + + this.responseList.indexList = this.autoComplete.html(dropdown) + .css(clonePosition) + .show() + .find(this.options.responseFieldElements + ':visible'); + + this.element.removeAttr('aria-activedescendant'); + + if (this.responseList.indexList.length) { + this._updateAriaHasPopup(true); + } else { + this._updateAriaHasPopup(false); + } + + this.responseList.indexList + .on('click', function (e) { + this.responseList.selected = $(e.currentTarget); + this.searchForm.trigger('submit'); + }.bind(this)) + .on('mouseenter mouseleave', function (e) { + this.responseList.indexList.removeClass(this.options.selectClass); + $(e.target).addClass(this.options.selectClass); + this.responseList.selected = $(e.target); + this.element.attr('aria-activedescendant', $(e.target).attr('id')); + }.bind(this)) + .on('mouseout', function (e) { + if (!this._getLastElement() && + this._getLastElement().hasClass(this.options.selectClass)) { + $(e.target).removeClass(this.options.selectClass); + this._resetResponseList(false); + } + }.bind(this)); } else { + this._resetResponseList(true); + this.autoComplete.hide(); this._updateAriaHasPopup(false); + this.element.removeAttr('aria-activedescendant'); } - - this.responseList.indexList - .on('click', function (e) { - this.responseList.selected = $(e.currentTarget); - this.searchForm.trigger('submit'); - }.bind(this)) - .on('mouseenter mouseleave', function (e) { - this.responseList.indexList.removeClass(this.options.selectClass); - $(e.target).addClass(this.options.selectClass); - this.responseList.selected = $(e.target); - this.element.attr('aria-activedescendant', $(e.target).attr('id')); - }.bind(this)) - .on('mouseout', function (e) { - if (!this._getLastElement() && - this._getLastElement().hasClass(this.options.selectClass)) { - $(e.target).removeClass(this.options.selectClass); - this._resetResponseList(false); - } - }.bind(this)); - } else { - this._resetResponseList(true); - this.autoComplete.hide(); - this._updateAriaHasPopup(false); - this.element.removeAttr('aria-activedescendant'); - } - }, this)); + }, this)); + } } else { this._resetResponseList(true); this.autoComplete.hide(); From bdfe7ec4a63c88d271848b5c6963f71a7473b1ca Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 27 Nov 2020 16:52:57 +0200 Subject: [PATCH 324/490] 27845 test when not all params specified in grouped_options --- .../Magento/Quote/Api/CartAddingItemsTest.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php index ff5946186f8c8..bb2a4e68212cf 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php @@ -165,6 +165,57 @@ public function testAddToCartGroupedCustomQuantity(): void } } + /** + * Test adding grouped product when qty for grouped_options not specified. + * + * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped_with_simple.php + * @magentoApiDataFixture Magento/Customer/_files/customer_one_address.php + * @return void + */ + public function testAddToCartGroupedCustomQuantityNotAllParamsSpecified(): void + { + $this->_markTestAsRestOnly(); + + $productId = $this->productResource->getIdBySku('simple_11'); + + // Get customer ID token + /** @var CustomerTokenServiceInterface $customerTokenService */ + $customerTokenService = $this->objectManager->create(CustomerTokenServiceInterface::class); + $token = $customerTokenService->createCustomerAccessToken( + 'customer_one_address@test.com', + 'password' + ); + + // Creating empty cart for registered customer. + $serviceInfo = [ + 'rest' => ['resourcePath' => '/V1/carts/mine', 'httpMethod' => Request::HTTP_METHOD_POST, 'token' => $token] + ]; + + $quoteId = $this->_webApiCall($serviceInfo, ['customerId' => 999]); // customerId 999 will get overridden + $this->assertGreaterThan(0, $quoteId); + + // Adding item to the cart + $requestData = [ + 'cartItem' => [ + 'quote_id' => $quoteId, + 'sku' => 'grouped', + 'qty' => 1, + 'product_option' => [ + 'extension_attributes' => [ + 'grouped_options' => [ + ['id' => $productId], + ] + ] + ] + ] + ]; + + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Please specify id and qty for grouped options.'); + + $this->_webApiCall($this->getServiceInfoAddToCart($token), $requestData); + } + /** * Returns service info add to cart * From a3aa42c4846a99c547dfcd53fb714d88f9971586 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 27 Nov 2020 17:15:31 +0200 Subject: [PATCH 325/490] Refactored AdminMassUpdateProductAttributesMissingRequiredFieldTest --- ...ProductsMassAttributeUpdateActionGroup.xml | 19 +++++++++++++ ...inCheckProductOnProductGridActionGroup.xml | 22 +++++++++++++++ ...ProductsMassAttributeUpdateActionGroup.xml | 19 +++++++++++++ ...ductAttributesMissingRequiredFieldTest.xml | 27 ++++++++++++------- 4 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml new file mode 100644 index 0000000000000..f2bbc2d5b10b1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.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="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup"> + <annotations> + <description>Click the "Change" checkbox for the "Name" field on the Products Masss Attributes Update page.</description> + </annotations> + + <click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/> + + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml new file mode 100644 index 0000000000000..83c473751d266 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminCheckProductOnProductGridActionGroup"> + <annotations> + <description>Check the checkbox for the product on the Product Grid</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/> + + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml new file mode 100644 index 0000000000000..6e427c359c9a3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.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="AdminClickSaveOnProductsMassAttributesUpdateActionGroup"> + <annotations> + <description>Clicks on 'Save' button on products mass attributes update page.</description> + </annotations> + + <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> + + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml index 479c9e5e5bb19..1871c2acf66e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml @@ -36,20 +36,27 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> - <!-- Search and select products --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> - <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> - <!-- Mass update attributes --> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/> - <waitForPageLoad stepKey="waitForBulkUpdatePage"/> - <seeInCurrentUrl stepKey="seeInUrl" url="catalog/product_action_attribute/edit/"/> - <click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/> - <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> + + <actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox1"> + <argument name="product" value="$$createProductOne$$"/> + </actionGroup> + + <actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox2"> + <argument name="product" value="$$createProductTwo$$"/> + </actionGroup> + + <actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOption"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBulkUpdatePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeInUrl"/> + + <actionGroup ref="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup" stepKey="toggleToChangeName"/> + + <actionGroup ref="AdminClickSaveOnProductsMassAttributesUpdateActionGroup" stepKey="save"/> <see stepKey="seeError" selector="{{AdminEditProductAttributesSection.NameError}}" userInput="This is a required field"/> </test> </tests> From e89999511d1aee15821286aa6a072ec8d2edd435 Mon Sep 17 00:00:00 2001 From: engcom-Kilo <mikola.malevanec@transoftgroup.com> Date: Wed, 25 Nov 2020 09:45:45 +0200 Subject: [PATCH 326/490] MC-38344: Wrong date show in datepicker after saving a cart price rule, product special price date on administrator Dutch locale. --- .../Magento/Ui/view/base/web/js/form/element/date.js | 2 +- .../code/Magento/Ui/base/js/form/element/date.test.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index 1432372dd75a9..af9142745206b 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -127,7 +127,7 @@ define([ if (this.options.showsTime) { shiftedValue = moment.tz(value, 'UTC').tz(this.storeTimeZone); } else { - shiftedValue = moment(value, this.outputDateFormat); + shiftedValue = moment(value, this.outputDateFormat, true); } if (!shiftedValue.isValid()) { diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js index f9d379407fcbd..91f37e20cca87 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js @@ -40,8 +40,12 @@ define([ name: '', index: '', dataScope: dataScope, + outputDateFormat: 'DD-MM-YYYY', + inputDateFormat: 'YYYY-MM-DD', + pickerDateTimeFormat: 'DD-MM-YYYY', options: { - showsTime: true + showsTime: false, + dateFormat: 'dd-MM-y' } }); utils = mageUtils; @@ -56,5 +60,10 @@ define([ expect(utils.convertToMomentFormat).toHaveBeenCalled(); }); + it('Check date will have correct value with different locales.', function () { + model.value('2020-11-28'); + expect(model.getPreview()).toBe('28-11-2020'); + }); + }); }); From 30ac6b5bd5fba5782498aba9b59eb096eebb44c8 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Sat, 28 Nov 2020 17:32:49 -0600 Subject: [PATCH 327/490] MC-38900: GraphQL Mutation setGuestEmailOnCart doesn't update quote address --- .../Quote/Guest/SetGuestEmailOnCartTest.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php index 7a14aca72d83f..ccafe5669e526 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php @@ -8,6 +8,9 @@ namespace Magento\GraphQl\Quote\Guest; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\QuoteFactory; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -21,10 +24,22 @@ class SetGuestEmailOnCartTest extends GraphQlAbstract */ private $getMaskedQuoteIdByReservedOrderId; + /** + * @var QuoteFactory + */ + private $quoteFactory; + + /** + * @var QuoteResource + */ + private $quoteResource; + protected function setUp(): void { $objectManager = Bootstrap::getObjectManager(); $this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class); + $this->quoteFactory = $objectManager->get(QuoteFactory::class); + $this->quoteResource = $objectManager->get(QuoteResource::class); } /** @@ -43,6 +58,32 @@ public function testSetGuestEmailOnCart() $this->assertEquals($email, $response['setGuestEmailOnCart']['cart']['email']); } + /** + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + */ + public function testSetGuestEmailOnCartWithDifferentEmailAddress() + { + $reservedOrderId = 'test_quote'; + $secondEmail = 'attempt2@example.com'; + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); + + $email = 'attempt1@example.com'; + $query = $this->getQuery($maskedQuoteId, $email); + $this->graphQlMutation($query); + + $query = $this->getQuery($maskedQuoteId, $secondEmail); + $this->graphQlMutation($query); + + $quote = $this->quoteFactory->create(); + $this->quoteResource->load($quote, $reservedOrderId, 'reserved_order_id'); + $addresses = $quote->getAddressesCollection(); + foreach ($addresses as $address) { + if ($address->getAddressType() === Address::ADDRESS_TYPE_SHIPPING) { + $this->assertEquals($secondEmail, $address->getEmail()); + } + } + } + /** * _security * @magentoApiDataFixture Magento/Customer/_files/customer.php From 834793513617586d6f28ae039f5e5e8d3d63d7a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Sat, 28 Nov 2020 17:42:43 -0600 Subject: [PATCH 328/490] MC-38900: GraphQL Mutation setGuestEmailOnCart doesn't update quote address --- .../Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php index ccafe5669e526..e3c77a40a470a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php @@ -77,6 +77,7 @@ public function testSetGuestEmailOnCartWithDifferentEmailAddress() $quote = $this->quoteFactory->create(); $this->quoteResource->load($quote, $reservedOrderId, 'reserved_order_id'); $addresses = $quote->getAddressesCollection(); + $this->assertEquals(2, $addresses->count()); foreach ($addresses as $address) { if ($address->getAddressType() === Address::ADDRESS_TYPE_SHIPPING) { $this->assertEquals($secondEmail, $address->getEmail()); From eaa4b063045cdff5b062383e92ec55e8ac9fc87e Mon Sep 17 00:00:00 2001 From: engcom-Echo <engcom-vendorworker-echo@adobe.com> Date: Mon, 30 Nov 2020 10:27:29 +0200 Subject: [PATCH 329/490] MC-37807: Link to a file of a Product with Customizable Option(File) is not available throughout a multishipping checkout process --- .../Block/Checkout/OverviewTest.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php index f4829cb614234..182505cba4a61 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/OverviewTest.php @@ -6,7 +6,7 @@ namespace Magento\Multishipping\Block\Checkout; -use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ProductRepository; use Magento\Checkout\Block\Cart\Item\Renderer; use Magento\Framework\App\Area; use Magento\Framework\ObjectManagerInterface; @@ -26,12 +26,12 @@ class OverviewTest extends TestCase /** * @var Overview */ - protected $block; + private $block; /** * @var ObjectManagerInterface */ - protected $objectManager; + private $objectManager; /** * @var Quote @@ -39,7 +39,7 @@ class OverviewTest extends TestCase private $quote; /** - * @var Product + * @var ProductRepository */ private $product; @@ -48,6 +48,9 @@ class OverviewTest extends TestCase */ private $item; + /** + * @inheritdoc + */ protected function setUp(): void { Bootstrap::getInstance()->loadArea(Area::AREA_FRONTEND); @@ -72,9 +75,9 @@ protected function setUp(): void Renderer::class, ['template' => 'cart/item/default.phtml'] ); - $this->quote = $this->objectManager->get(Quote::class); - $this->product = $this->objectManager->get(Product::class); - $this->item = $this->objectManager->get(Item::class); + $this->quote = $this->objectManager->create(Quote::class); + $this->product = $this->objectManager->create(ProductRepository::class); + $this->item = $this->objectManager->create(Item::class); } /** @@ -82,7 +85,7 @@ protected function setUp(): void */ public function testGetRowItemHtml() { - $product = $this->product->load('1'); + $product = $this->product->get('simple'); $item = $this->item->setProduct($product); $item->setQuote($this->quote); // assure that default renderer was obtained From f36929ac2be6c65c6386325c8fc38d1d333d77b3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 10:59:10 +0200 Subject: [PATCH 330/490] initial commit --- .../ProductsQtyReturnAfterOrderCancelTest.xml | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 0b7bca201ec32..6bcf33e923080 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="ProductsQtyReturnAfterOrderCancelTest"> + <test name=""> <annotations> <features value="ConfigurableProduct"/> @@ -23,28 +23,44 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> + <field key="quantity">1000</field> </createData> + + + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clickClearFiltersInitial"/> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="SimpleFourCartItems" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <!-- <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> @@ -63,10 +79,10 @@ <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" /> </actionGroup> - <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> --> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> - <argument name="orderId" value="$grabOrderNumber"/> + <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> @@ -75,11 +91,16 @@ <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> - <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> - <waitForPageLoad stepKey="waitOrderDetailToLoad"/> - <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> - <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> - <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> + <!-- <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> + <waitForPageLoad stepKey="waitOrderDetailToLoad"/> --> + <!-- <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> --> + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <argument name="Qty" value="1"/> + <argument name="Number" value="111"/> + </actionGroup> + + <!-- <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> + <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> From 963b28f999b0b9e822ae89fa39dec664d8b3cada Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Mon, 30 Nov 2020 11:28:21 +0200 Subject: [PATCH 331/490] Test case id has been added. --- ...orefrontAssertFixedCartDiscountAmountForBundleProductTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 3f7e988f34bdd..65c8a4416c1a1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -15,6 +15,7 @@ <description value="Checking Fixed Amount Cart Price Rule is correctly applied to bundle products"/> <severity value="AVERAGE"/> <group value="SalesRule"/> + <testCaseId value="MC-39480"/> </annotations> <before> <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> From 7b7cf03a5fec86e4a0c79441d70929185bcccfe9 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Mon, 30 Nov 2020 13:44:23 +0200 Subject: [PATCH 332/490] MC-37085: Create automated test for "Storefront Gallery behaviour for Product with media" --- ...gingFullscreenImageByRibbonActionGroup.xml | 27 + ...ryChangingMainImageByRibbonActionGroup.xml | 27 + ...leryFullscreenThumbnailDragActionGroup.xml | 29 ++ ...tPageGalleryImageDimensionsActionGroup.xml | 34 ++ ...gePositionInThumbnailRibbonActionGroup.xml | 25 + ...PageGalleryMainImageButtonsActionGroup.xml | 28 ++ ...uctPageGalleryThumbnailDragActionGroup.xml | 32 ++ ...ageGalleryDragMainImageBackActionGroup.xml | 19 + ...GalleryDragMainImageForwardActionGroup.xml | 19 + .../Catalog/Test/Mftf/Data/ImageData.xml | 48 ++ .../Catalog/Test/Mftf/Data/ProductData.xml | 1 + .../Section/StorefrontProductMediaSection.xml | 16 +- ...ontProductWithMediaGalleryBehaviorTest.xml | 463 ++++++++++++++++++ 13 files changed, 765 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml new file mode 100644 index 0000000000000..6423bf5e319b7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup"> + <annotations> + <description>On the product page change main image by clicking on the images in the ribbon. Fullscreen</description> + </annotations> + <arguments> + <argument name="startImage" type="string" /> + <argument name="expectedImage" type="string" /> + </arguments> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartFullscreenImage"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageInThumbnail"/> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="clickOnExpectedImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(expectedImage)}}" stepKey="seeExpectedImageAfterClick"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageActiveInThumbnailAfterChange"/> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="clickOnStartImageInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartImageAfterSecondChange"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageActiveInThumbnailAfterSecondChange"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml new file mode 100644 index 0000000000000..b196956135043 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup"> + <annotations> + <description>Changing main image on product page media gallery by clicking on the images in the fotorama ribbon</description> + </annotations> + <arguments> + <argument name="startImage" type="string" /> + <argument name="expectedImage" type="string" /> + </arguments> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="waitActiveImageDefault"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageThumbnail"/> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="firstClickOnImageInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeChangedImageAfterFirstClick"/> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="secondClickOnImageInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageSelectedInRibbonAfterSecondClick"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeChangedImageAfterSecondClick"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml new file mode 100644 index 0000000000000..86803aed4cfb6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup"> + <annotations> + <description>On the product page check functional of drag actions in the fotorama ribbon during fullscreen</description> + </annotations> + <arguments> + <argument name="dragPointImage" type="string" /> + <argument name="currentImage" type="string"/> + <argument name="firstImage" type="string" /> + </arguments> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbon"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImageAfterDrag"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeMainImageAfterBackDrag"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml new file mode 100644 index 0000000000000..7b6a8e14455ca --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AssertStorefrontProductPageGalleryImageDimensionsActionGroup"> + <annotations> + <description>On the product page grab dimensions of the displayed product image, and image section. Assert that image is less or equals</description> + </annotations> + <arguments> + <argument name="imageSource" defaultValue="{{StorefrontProductMediaSection.mainImageForJsActions}}" type="string"/> + </arguments> + <executeJS function="var img=document.querySelector('{{imageSource}}'); + return img.clientHeight;" stepKey="getImageHeight"/> + <executeJS function="var img=document.querySelector('{{imageSource}}'); + return img.clientWidth;" stepKey="getImageWidth"/> + <executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}'); + return img.clientHeight;" stepKey="getSectionHeight"/> + <executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}'); + return img.clientWidth;" stepKey="getSectionWidth"/> + <assertLessThanOrEqual stepKey="checkHeightIsCorrect"> + <actualResult type="variable">getImageHeight</actualResult> + <expectedResult type="variable">getSectionHeight</expectedResult> + </assertLessThanOrEqual> + <assertLessThanOrEqual stepKey="checkWidthIsCorrect"> + <actualResult type="variable">getImageWidth</actualResult> + <expectedResult type="variable">getSectionWidth</expectedResult> + </assertLessThanOrEqual> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml new file mode 100644 index 0000000000000..6473f348648f2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup"> + <annotations> + <description>Check the expected image position in the fotorama ribbon on the product page</description> + </annotations> + <arguments> + <argument name="image" defaultValue="Magento2.filename" type="string"/> + <argument name="extension" defaultValue="Magento2.file_extension" type="string"/> + <argument name="position" defaultValue="0" type="string" /> + </arguments> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.fotoramaImageThumbnailImgByNumber(position)}}" stepKey="grabSrcFromThumbnailImageByPosition"/> + <assertRegExp stepKey="checkImagePositionInThumbnail"> + <actualResult type="variable">$grabSrcFromThumbnailImageByPosition</actualResult> + <expectedResult type="string">|{{image}}[_\d]*.{{extension}}|</expectedResult> + </assertRegExp> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml new file mode 100644 index 0000000000000..d4cc3097946be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AssertStorefrontProductPageGalleryMainImageButtonsActionGroup"> + <annotations> + <description>Assert the buttons functionality "change image" on the product media gallery on the product page</description> + </annotations> + <arguments> + <argument name="startImage" type="string" /> + <argument name="expectedImage" type="string" /> + </arguments> + <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitForButtons"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeProductImageBeforeActions"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButton"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeExpectedImageOnPreview"/> + <click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickOnPrevImageButton"/> + <seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageSelectedInRibbonAfterSecondChange"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeMainProductImageAfterSecondChange"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml new file mode 100644 index 0000000000000..2e62d973ea090 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AssertStorefrontProductPageGalleryThumbnailDragActionGroup"> + <annotations> + <description>Check functional of drag actions in the thumbnail ribbon on the product page</description> + </annotations> + <arguments> + <argument name="dragPointImage" type="string" /> + <argument name="currentImage" type="string"/> + <argument name="firstImage" type="string" /> + </arguments> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageBeforeDragActions"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonBeforeDragActions"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbonForward"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterDrag"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="waitPrevButton"/> + <seeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="seePrevButton"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterBackDrag"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonAfterBackDrag"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml new file mode 100644 index 0000000000000..4925d6627a0b3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.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="StorefrontProductPageGalleryDragMainImageBackActionGroup"> + <annotations> + <description>Drag back main image in the media gallery of product page</description> + </annotations> + <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnProductImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitNextButton"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.mainImageForJsActions}}" selector2="{{StorefrontProductMediaSection.imageNextButton}}" x="200" y="0" stepKey="dragImageBack"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml new file mode 100644 index 0000000000000..a75a25e31717b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.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="StorefrontProductPageGalleryDragMainImageForwardActionGroup"> + <annotations> + <description>Drag forward main image in the media gallery of product page</description> + </annotations> + <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnProductImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitNextButton"/> + <dragAndDrop selector1="{{StorefrontProductMediaSection.mainImageForJsActions}}" selector2="{{StorefrontProductMediaSection.imagePrevButton}}" x="-366" y="0" stepKey="dragImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml index a2391dda54809..e1072001b56e5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml @@ -25,4 +25,52 @@ <data key="name">adobe-thumb</data> <data key="extension">jpg</data> </entity> + <entity name="AdobeSmallImage" type="image"> + <data key="title" unique="suffix">magento-small</data> + <data key="file">adobe-small.jpg</data> + <data key="filename">adobe-small</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="AdobeThumbImage" type="image"> + <data key="title" unique="suffix">magento-thumb</data> + <data key="file">adobe-thumb.jpg</data> + <data key="filename">adobe-thumb</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="JpgImage" type="image"> + <data key="title" unique="suffix">jpgimage</data> + <data key="file">jpg.jpg</data> + <data key="filename">jpg</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="LargeImage" type="image"> + <data key="title" unique="suffix">largeimage</data> + <data key="file">large.jpg</data> + <data key="filename">large</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="MagentoImage" type="image"> + <data key="title" unique="suffix">magentoimage</data> + <data key="file">magento.jpg</data> + <data key="filename">magento</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="MagentoStage" type="image"> + <data key="title" unique="suffix">magentostage</data> + <data key="file">magentoStage.jpg</data> + <data key="filename">magentoStage</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="MediumImage" type="image"> + <data key="title" unique="suffix">mediumimage</data> + <data key="file">medium.jpg</data> + <data key="filename">medium</data> + <data key="file_extension">jpg</data> + </entity> + <entity name="PngImage" type="image"> + <data key="title" unique="suffix">magentoimage</data> + <data key="file">png.png</data> + <data key="filename">png</data> + <data key="file_extension">png</data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index e7760a9b90f0c..f4e468a939111 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -370,6 +370,7 @@ <data key="shareable">Yes</data> <data key="file">magento-logo.png</data> <data key="fileName">magento-logo</data> + <data key="file_extension">png</data> </entity> <entity name="MagentoLogo" type="image"> <data key="title" unique="suffix">MagentoLogo</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml index 447113ea65bb2..5efa094e2c35e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml @@ -16,11 +16,21 @@ <element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" /> <element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/> <element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/> - <element name="productImageInFotorama" type="file" selector=".fotorama__nav__shaft img[src*='{{imageName}}']" parameterized="true"/> - <element name="fotoramaPrevButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--left')]"/> - <element name="fotoramaNextButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--right')]"/> + <element name="productImageInFotorama" type="file" selector=".fotorama__nav__shaft img[src*='{{imageName}}']" parameterized="true" timeout="30"/> + <element name="fotoramaPrevButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--left')]" timeout="30"/> + <element name="fotoramaNextButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--right')]" timeout="30"/> + <element name="fotoramaNextButtonVideo" type="button" selector="div.fotorama__arr.fotorama__arr--next.fotorama__arr--shown" timeout="30"/> <element name="fotoramaAnyMedia" type="text" selector=".fotorama__nav__shaft img"/> <element name="fotoramaImageThumbnail" type="block" selector="//div[contains(@class, 'fotorama__nav__shaft')]//div[contains(@class, 'fotorama__nav__frame--thumb')][{{imageNumber}}]" parameterized="true" timeout="30"/> + <element name="fotoramaImageThumbnailImgByNumber" type="block" selector="//div[contains(@class, 'fotorama__nav__shaft')]//div[contains(@class, 'fotorama__nav__frame--thumb')][{{imageNumber}}]//img" parameterized="true" timeout="30"/> <element name="fotoramaImageThumbnailActive" type="block" selector="//div[contains(@class, 'fotorama__nav__shaft')]//div[contains(@class, 'fotorama__nav__frame--thumb') and contains(@class, 'fotorama__active')][{{imageNumber}}]" parameterized="true" timeout="30"/> + <element name="imageNextButton" type="button" selector=".product.media .fotorama-item .fotorama__wrap--toggle-arrows .fotorama__arr--next" timeout="30"/> + <element name="imageFullscreenNextButton" type="button" selector=".fotorama--fullscreen.fotorama-item .fotorama__wrap--toggle-arrows .fotorama__arr--next" timeout="30"/> + <element name="imagePrevButton" type="button" selector=".product.media .fotorama-item .fotorama__wrap--toggle-arrows .fotorama__arr--prev" timeout="30"/> + <element name="imageFullscreenPrevButton" type="button" selector=".fotorama--fullscreen.fotorama-item .fotorama__wrap--toggle-arrows .fotorama__arr--prev" timeout="30"/> + <element name="mainImageForJsActions" type="text" selector="div.fotorama div.fotorama__active img.fotorama__img" timeout="30"/> + <element name="mainImageForJsActionsFullscreen" type="text" selector="div.fotorama div.fotorama__active img.fotorama__img--full" timeout="30"/> + <element name="imageSectionForJsActions" type="text" selector=".fotorama__wrap .fotorama__stage" /> + <element name="imgSelectedInThumbnail" type="block" selector=".fotorama__nav-wrap .fotorama__active .fotorama__loaded img[src*='{{filename}}']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml new file mode 100644 index 0000000000000..0fd5a7117167c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml @@ -0,0 +1,463 @@ +<?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="StorefrontProductWithMediaGalleryBehaviorTest"> + <annotations> + <features value="Catalog"/> + <stories value="Storefront Gallery behaviour for Product with media"/> + <title value="Assert media behaviour for product with different media on storefront"/> + <description value="Assert media behaviour for product with different media on storefront"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-26305"/> + <group value="catalog"/> + <group value="productVideo"/> + <skip> + <issueId value="MC-33903"/> + </skip> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--Add images and video to product--> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> + <argument name="productId" value="$createProduct.id$"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addBaseImage"> + <argument name="image" value="TestImageAdobe"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1"> + <argument name="image" value="AdobeSmallImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage2"> + <argument name="image" value="AdobeThumbImage"/> + </actionGroup> + <actionGroup ref="AdminAddProductVideoWithPreviewActionGroup" stepKey="addVideo"> + <argument name="video" value="VimeoProductVideo"/> + <argument name="image" value="{{TestImageNew.file}}"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage4"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage5"> + <argument name="image" value="JpgImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage6"> + <argument name="image" value="LargeImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage7"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage8"> + <argument name="image" value="MagentoImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage9"> + <argument name="image" value="Magento3"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage10"> + <argument name="image" value="TestImageNew"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage11"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage12"> + <argument name="image" value="MediumImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage13"> + <argument name="image" value="MediumImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage14"> + <argument name="image" value="PngImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage15"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage16"> + <argument name="image" value="Magento3"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefrontProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <!--Assert positioning images in the ribbon Step 2.3--> + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaAnyMedia}}" stepKey="waitForThumbnailsAppear"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition1"> + <argument name="image" value="{{TestImageAdobe.filename}}"/> + <argument name="extension" value="{{TestImageAdobe.file_extension}}"/> + <argument name="position" value="1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition2"> + <argument name="image" value="{{AdobeSmallImage.filename}}"/> + <argument name="extension" value="{{AdobeSmallImage.file_extension}}"/> + <argument name="position" value="2"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition3"> + <argument name="image" value="{{AdobeThumbImage.filename}}"/> + <argument name="extension" value="{{AdobeThumbImage.file_extension}}"/> + <argument name="position" value="3"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition4"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="4"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition5"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="5"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition6"> + <argument name="image" value="{{JpgImage.filename}}"/> + <argument name="extension" value="{{JpgImage.file_extension}}"/> + <argument name="position" value="6"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition7"> + <argument name="image" value="{{LargeImage.filename}}"/> + <argument name="extension" value="{{LargeImage.file_extension}}"/> + <argument name="position" value="7"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition8"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="8"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition9"> + <argument name="image" value="{{MagentoImage.filename}}"/> + <argument name="extension" value="{{MagentoImage.file_extension}}"/> + <argument name="position" value="9"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition10"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="10"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition11"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="11"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition12"> + <argument name="image" value="{{ProductImage.filename}}"/> + <argument name="extension" value="{{ProductImage.file_extension}}"/> + <argument name="position" value="12"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition13"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="13"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition14"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="14"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition15"> + <argument name="image" value="{{PngImage.filename}}"/> + <argument name="extension" value="{{PngImage.file_extension}}"/> + <argument name="position" value="15"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition16"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="16"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition17"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="17"/> + </actionGroup> + <!--Assert fullscreen image isn't displayed. Step 2.1--> + <actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="seeActiveBaseImage"> + <argument name="fileName" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <dontSeeElement selector="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}" stepKey="dontSeeFullscreenProductImage"/> + <!--Assert thumbnail drag actions. Steps 3-4--> + <actionGroup ref="AssertStorefrontProductPageGalleryThumbnailDragActionGroup" stepKey="assertThumbnailDragAction"> + <argument name="dragPointImage" value="{{TestImageNew.filename}}"/> + <argument name="currentImage" value="{{TestImageAdobe.filename}}"/> + <argument name="firstImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Verify if looping is unavailable. Step 5--> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButton"/> + <seeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="seeNextButton"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="firstClickNextFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(MagentoImage.filename)}}" stepKey="see9thImageInRibbon"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="secondClickNextFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(MagentoImage.filename)}}" stepKey="seeLastImageInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(TestImageAdobe.filename)}}" stepKey="seeActiveImageDontChangeAfterClickNext"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="dontSeeNextButtonAfterClickNext"/> + <click selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="firstClickPrevFotorama"/> + <click selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="secondClickPrevFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(TestImageAdobe.filename)}}" stepKey="seeActiveImageDefaultStay2"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(TestImageAdobe.filename)}}" stepKey="seeFirstImageInRibbon"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonAfterClick"/> + <!--Change image by thumbnail ribbon. Step 6--> + <actionGroup ref="AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup" stepKey="assertThumbnailClicking"> + <argument name="startImage" value="{{TestImageAdobe.filename}}"/> + <argument name="expectedImage" value="{{AdobeSmallImage.filename}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageOnPreview"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change image by image buttons. Step 7--> + <actionGroup ref="AssertStorefrontProductPageGalleryMainImageButtonsActionGroup" stepKey="assertButtonActions"> + <argument name="startImage" value="{{TestImageAdobe.filename}}"/> + <argument name="expectedImage" value="{{AdobeSmallImage.filename}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterButtonActions"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Check that images <= that image section. Step 7.4--> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions0"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert0"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions1"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert1"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions2"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert2"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions3"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert3"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions4"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert4"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions5"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert5"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions6"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert6"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions7"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert7"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions8"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert8"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions9"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert9"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions10"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert10"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions11"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert11"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions12"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert12"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions13"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert13"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions14"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert14"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions15"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert15"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions16"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert16"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoop"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change image using the drag actions. Step 8--> + <actionGroup ref="StorefrontProductPageGalleryDragMainImageBackActionGroup" stepKey="dragBack"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterDragBack"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + <actionGroup ref="StorefrontProductPageGalleryDragMainImageForwardActionGroup" stepKey="dragForward"/> + <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnImageAfterDragActions"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterDragForward"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Assert the image looping by image buttons. Step 9--> + <click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="loopBack"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoopBack"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="loopForward"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoopForward"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Open the fullscreen image. Steps 10-11--> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="setNonDefaultImage"/> + <click selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="openFullscreenImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(AdobeSmallImage.filename)}}" stepKey="assertFullscreenImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaAnyMedia}}" stepKey="waitForThumbnailsFullscreen"/> + <!--Assert positioning images in the ribbon Step 11.3--> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition1"> + <argument name="image" value="{{TestImageAdobe.filename}}"/> + <argument name="extension" value="{{TestImageAdobe.file_extension}}"/> + <argument name="position" value="1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition2"> + <argument name="image" value="{{AdobeSmallImage.filename}}"/> + <argument name="extension" value="{{AdobeSmallImage.file_extension}}"/> + <argument name="position" value="2"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition3"> + <argument name="image" value="{{AdobeThumbImage.filename}}"/> + <argument name="extension" value="{{AdobeThumbImage.file_extension}}"/> + <argument name="position" value="3"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition4"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="4"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition5"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="5"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition6"> + <argument name="image" value="{{JpgImage.filename}}"/> + <argument name="extension" value="{{JpgImage.file_extension}}"/> + <argument name="position" value="6"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition7"> + <argument name="image" value="{{LargeImage.filename}}"/> + <argument name="extension" value="{{LargeImage.file_extension}}"/> + <argument name="position" value="7"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition8"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="8"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition9"> + <argument name="image" value="{{MagentoImage.filename}}"/> + <argument name="extension" value="{{MagentoImage.file_extension}}"/> + <argument name="position" value="9"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition10"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="10"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition11"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="11"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition12"> + <argument name="image" value="{{ProductImage.filename}}"/> + <argument name="extension" value="{{ProductImage.file_extension}}"/> + <argument name="position" value="12"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition13"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="13"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition14"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="14"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition15"> + <argument name="image" value="{{PngImage.filename}}"/> + <argument name="extension" value="{{PngImage.file_extension}}"/> + <argument name="position" value="15"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition16"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="16"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition17"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="17"/> + </actionGroup> + <!--Assert the fullscreen thumbnail ribbon drag actions step 12--> + <actionGroup ref="AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup" stepKey="assertFullscreenThumbnailDragAction"> + <argument name="dragPointImage" value="{{TestImageNew.filename}}"/> + <argument name="currentImage" value="{{AdobeSmallImage.filename}}"/> + <argument name="firstImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change fullscreen image by clicking on thumbnail ribbon. Step 15--> + <actionGroup ref="AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup" stepKey="assertThumbnailClickFullscreen"> + <argument name="startImage" value="{{AdobeSmallImage.filename}}"/> + <argument name="expectedImage" value="{{LargeImage.filename}}"/> + </actionGroup> + <!--Change fullscreen image using the image buttons. Steps 16 and 18--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="goToFirstImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="seeFirstFullscreenImage"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="loopToLastImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(Magento3.filename)}}" stepKey="assertLastImageAfterLoop"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="loopToFirstImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="assertFirstImageAfterLoop"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert0"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions0"> + <argument name="source" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <!-- Check that images <= that image section. Step 16.5--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert1"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions1"> + <argument name="source" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert2"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButtonVideo}}" stepKey="skipVideo"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions3"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert4"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions4"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert5"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions5"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert6"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions6"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert7"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions7"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert8"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions8"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert9"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions9"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert10"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions10"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert11"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions11"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert12"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions12"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert13"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions13"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert14"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions14"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert15"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions15"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert16"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions16"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="assertFirstImageAfterSecondLoop"/> + <!-- TODO: Change fullscreen image by drag/swipe action: after MQE-2333 implementation --> + <!--Steps 19-20--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="selectLastImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(Magento3.filename)}}" stepKey="assertLastImageFullscreen"/> + <click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeLastImageAfterFullscreen"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + </test> +</tests> From 1e6a9c62cb46b6bd1a3536f8429c8d6cd297e098 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 30 Nov 2020 14:39:17 +0200 Subject: [PATCH 333/490] MC-39474: [MFTF] Flaky StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest because of bad design --- ...gRecalculationAfterCouponCodeAddedTest.xml | 7 +- ...ecalculationAfterCouponCodeAppliedTest.xml | 104 ++++++++++++++++++ ...tForShowShippingMethodNoApplicableTest.xml | 2 +- .../AdminCreateCartPriceRuleActionGroup.xml | 4 +- ...StorefrontApplyDiscountCodeActionGroup.xml | 2 +- 5 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 20b94d0f4ec8a..bd8bcdbc5cd2d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -7,9 +7,9 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest"> + <test name="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest" deprecated="Use StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest instead"> <annotations> - <title value="Checkout Free Shipping Recalculation after Coupon Code Added"/> + <title value="DEPRECATED. Checkout Free Shipping Recalculation after Coupon Code Added"/> <stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/> <description value="User should be able to do checkout free shipping recalculation after adding coupon code"/> <features value="Checkout"/> @@ -17,6 +17,9 @@ <testCaseId value="MAGETWO-96537"/> <useCaseId value="MAGETWO-96431"/> <group value="Checkout"/> + <skip> + <issueId value="DEPRECATED">Use StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest instead</issueId> + </skip> </annotations> <before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml new file mode 100644 index 0000000000000..bc9dddf53ad03 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.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="StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest"> + <annotations> + <features value="Checkout"/> + <stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/> + <title value="Checkout Free Shipping Recalculation after Coupon Code Added"/> + <description value="User should be able to do checkout free shipping recalculation after adding coupon code"/> + <severity value="BLOCKER"/> + <testCaseId value="MC-28548"/> + <useCaseId value="MAGETWO-96431"/> + <group value="Checkout"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"> + <field key="group_id">1</field> + </createData> + <createData entity="_defaultCategory" stepKey="defaultCategory"/> + <createData entity="_defaultProduct" stepKey="simpleProduct"> + <field key="price">90</field> + <requiredEntity createDataKey="defaultCategory"/> + </createData> + <!--It is default for FlatRate--> + <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> + <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> + <argument name="ruleName" value="CatPriceRule"/> + <argument name="couponCode" value="CatPriceRule.coupon_code"/> + </actionGroup> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$simpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + </before> + + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/> + <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> + <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule"> + <argument name="product" value="$simpleProduct$"/> + <argument name="couponCode" value="{{CatPriceRule.coupon_code}}"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/> + <waitForPageLoad stepKey="waitForpageLoad1"/> + <dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCartPage"/> + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="openDiscountTabIfClosed"/> + <waitForPageLoad stepKey="waitForCouponTabOpen1"/> + <click selector="{{DiscountSection.CancelCoupon}}" stepKey="cancelCoupon"/> + <waitForPageLoad stepKey="waitForCancel"/> + <see userInput='You canceled the coupon code.' stepKey="seeCancellationMessage"/> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="chooseFreeShipping"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextAfterFreeShippingMethodSelection"/> + <waitForPageLoad stepKey="waitForReviewAndPayments"/> + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCouponCode"> + <argument name="discountCode" value="{{CatPriceRule.coupon_code}}"/> + </actionGroup> + <!-- Assert order cannot be placed and error message will shown. --> + <actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="seeShippingMethodError"> + <argument name="error" value="The shipping method is missing. Select the shipping method and try again."/> + </actionGroup> + <amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/> + <waitForPageLoad stepKey="waitForShippingPageLoad"/> + + <click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/> + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextAfterFlatRateShippingMethodSelection"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> + <!-- Place Order --> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="placeOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutForShowShippingMethodNoApplicableTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutForShowShippingMethodNoApplicableTest.xml index 22bc1260e5f33..3c06ca17cfedc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutForShowShippingMethodNoApplicableTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutForShowShippingMethodNoApplicableTest.xml @@ -58,6 +58,6 @@ <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNextButton"/> <!-- Assert order cannot be placed and error message will shown. --> <waitForPageLoad stepKey="waitForError"/> - <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> + <seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText('The shipping method is missing. Select the shipping method and try again')}}" stepKey="seeShippingMethodError"/> </test> </tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index 57a2c17419532..f6a705ee368e9 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -19,6 +19,7 @@ <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> <waitForPageLoad stepKey="waitForPriceList"/> <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleName}}" stepKey="waitRuleNameFieldAppeared"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{ruleName.websites}}" stepKey="selectWebsites"/> <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" parameterArray="[{{ruleName.customerGroups}}]" stepKey="selectCustomerGroup"/> @@ -26,6 +27,7 @@ <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{ruleName.apply}}" stepKey="selectActionType"/> <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{ruleName.discountAmount}}" stepKey="fillDiscountAmount"/> <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> - <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml index c8363a3df6221..5607512c862b3 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml @@ -12,7 +12,7 @@ <arguments> <argument name="discountCode" type="string"/> </arguments> - <click selector="{{DiscountSection.DiscountTab}}" stepKey="clickToAddDiscount"/> + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickToAddDiscount"/> <fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{discountCode}}" stepKey="fillFieldDiscountCode"/> <click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/> <waitForElementVisible selector="{{DiscountSection.DiscountVerificationMsg}}" time="30" stepKey="waitForDiscountToBeAdded"/> From ece8488ea87743e19e1b4b688e7395a11ebd50cf Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Mon, 30 Nov 2020 15:02:52 +0200 Subject: [PATCH 334/490] MC-36383: [B2B] A Product with Customizable Option (File) can not be added from a Requisition List to the Shopping Cart --- app/code/Magento/Catalog/Model/Product/Option/Type/File.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php index 77ef8ef4853e1..8d35d55282a75 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php @@ -228,7 +228,10 @@ public function validateUserValue($values) * previous configuration with no newly uploaded file */ $fileInfo = null; - if (isset($values[$option->getId()]) && is_array($values[$option->getId()])) { + if (isset($values[$option->getId()])) { + if (is_string($values[$option->getId()])) { + $values[$option->getId()] = explode(',', $values[$option->getId()]); + } // Legacy style, file info comes in array with option id index $fileInfo = $values[$option->getId()]; } else { From 65255ad661154c02748cc2761570d47ca106b7dd Mon Sep 17 00:00:00 2001 From: Alexander Turiak <oturiak@adobe.com> Date: Mon, 30 Nov 2020 15:13:56 +0100 Subject: [PATCH 335/490] Fix assertion --- .../GraphQlCache/Controller/Catalog/ProductsCacheTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php index 998c0863925dd..72a093dc48e79 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php @@ -165,7 +165,7 @@ public function testProductsFilterByCategoryHasCategoryTags(): void $expectedCacheTags = ['cat_c', 'cat_c_333']; foreach ($expectedCacheTags as $cacheTag) { - $this->assertArrayHasKey($cacheTag, $actualCacheTags); + $this->assertContains($cacheTag, $actualCacheTags); } } } From 94cdcf1827cdb4dbb04af097a668e3303bf3eede Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:38:33 +0200 Subject: [PATCH 336/490] Refactored ProductsQtyReturnAfterOrderCancelTest --- ...minCheckProductQtyAfterOrderCancelling.xml | 89 +++++++++++++++++++ ...nvoiceWIthUpdatedProductQtyActionGroup.xml | 23 +++++ 2 files changed, 112 insertions(+) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml new file mode 100644 index 0000000000000..8be37cccbb67a --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -0,0 +1,89 @@ +<?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="AdminCheckProductQtyAfterOrderCancelling"> + + <annotations> + <features value="ConfigurableProduct"/> + <stories value="Cancel order"/> + <title value="Product quantity return after order cancel"/> + <description value="Check Product quantity return after order cancel"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-97228"/> + <useCaseId value="MAGETWO-82221"/> + <group value="ConfigurableProduct"/> + </annotations> + + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="FourCartItems" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + + </before> + + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> + <argument name="orderId" value="$createGuestCart.return$"/> + </actionGroup> + + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> + + <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="ChangeQtyToInvoice"> + <argument name="qty" value="1"/> + </actionGroup> + + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <argument name="Qty" value="1"/> + <argument name="Number" value="111"/> + </actionGroup> + + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> + <argument name="orderStatus" value="Complete"/> + </actionGroup> + + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQuantity"/> + + <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> + + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> + <argument name="sku" value="$$createConfigProduct.sku$$"/> + </actionGroup> + + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductSkuInGrid"> + <argument name="row" value="1"/> + <argument name="column" value="Quantity"/> + <argument name="value" value="99"/> + </actionGroup> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> + + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml new file mode 100644 index 0000000000000..092a225c232ea --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.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="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> + <annotations> + <description>The "Create Invoice" page: Update product qty to invoice (there is one product in the Order).</description> + </annotations> + <arguments> + <argument name="qty" type="string"/> + </arguments> + + <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="changeQtyToInvoice" after="waitForInvoicePage"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity" after="changeQtyToInvoice"/> + <waitForPageLoad stepKey="waitPageToBeLoaded" after="updateQuantity"/> + </actionGroup> +</actionGroups> From 0d32349f8452d84770337eda6fba4d0cce70c6ee Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:49:58 +0200 Subject: [PATCH 337/490] refactored --- ...minCheckProductQtyAfterOrderCancelling.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 49 ++++++------------- .../Quote/Test/Mftf/Data/CartItemData.xml | 5 ++ ...nvoiceWIthUpdatedProductQtyActionGroup.xml | 5 +- 4 files changed, 25 insertions(+), 38 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 8be37cccbb67a..71eddf6667368 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCheckProductQtyAfterOrderCancelling"> + <test name="AdminCheckProductQtyAfterOrderCancellingTest"> <annotations> <features value="ConfigurableProduct"/> @@ -41,7 +41,7 @@ </updateData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> - + </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 6bcf33e923080..5270c82a7e977 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name=""> + <test name="ProductsQtyReturnAfterOrderCancelTest" deprecated="Use AdminCheckProductQtyAfterOrderCancellingTest instead"> <annotations> <features value="ConfigurableProduct"/> @@ -23,44 +23,28 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> - <field key="quantity">1000</field> </createData> - - - <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> - <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage1"/> - <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clickClearFiltersInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - - <createData entity="GuestCart" stepKey="createGuestCart"/> - <createData entity="SimpleFourCartItems" stepKey="addCartItem"> - <requiredEntity createDataKey="createGuestCart"/> - <requiredEntity createDataKey="createConfigProduct"/> - </createData> - <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> - <requiredEntity createDataKey="createGuestCart"/> - </updateData> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - <!-- <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> @@ -79,10 +63,10 @@ <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" /> </actionGroup> - <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> --> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> - <argument name="orderId" value="$createGuestCart.return$"/> + <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> @@ -91,16 +75,11 @@ <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> - <!-- <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> - <waitForPageLoad stepKey="waitOrderDetailToLoad"/> --> - <!-- <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> --> - <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> - <argument name="Qty" value="1"/> - <argument name="Number" value="111"/> - </actionGroup> - - <!-- <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> - <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> --> + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> + <waitForPageLoad stepKey="waitOrderDetailToLoad"/> + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> + <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml index a513b6747f612..d24154bcf9da2 100644 --- a/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml @@ -23,4 +23,9 @@ <var key="quote_id" entityKey="return" entityType="GuestCart"/> <var key="sku" entityKey="sku" entityType="product"/> </entity> + <entity name="FourCartItems" type="CartItem"> + <data key="qty">4</data> + <var key="quote_id" entityKey="return" entityType="GuestCart"/> + <var key="sku" entityKey="sku" entityType="product"/> + </entity> </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index 092a225c232ea..334061803bb4d 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -10,7 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> <annotations> - <description>The "Create Invoice" page: Update product qty to invoice (there is one product in the Order).</description> + <description>Start order Invoicing. + Update product qty to invoice (there is one product in the Order). + Submit the invoice. + </description> </annotations> <arguments> <argument name="qty" type="string"/> From 9bffc0892aeb17a2b7091caff07b278f987f3811 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:52:33 +0200 Subject: [PATCH 338/490] refactored --- .../Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 5270c82a7e977..899ed7f1e60ba 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -19,6 +19,9 @@ <testCaseId value="MAGETWO-97228"/> <useCaseId value="MAGETWO-82221"/> <group value="ConfigurableProduct"/> + <skip> + <issueId value="DEPRECATED">Use AdminCheckProductQtyAfterOrderCancellingTest instead</issueId> + </skip> </annotations> <before> From ad511d6c8f8c5ed8ee3458346bdef6bb378f054a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:56:40 +0200 Subject: [PATCH 339/490] refactored stepKeys --- .../AdminCheckProductQtyAfterOrderCancelling.xml | 14 +++++++------- ...dminInvoiceWIthUpdatedProductQtyActionGroup.xml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 71eddf6667368..551269945bd81 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -54,22 +54,22 @@ <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrder"/> - <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="ChangeQtyToInvoice"> + <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> <argument name="qty" value="1"/> </actionGroup> - <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="createShipment"> <argument name="Qty" value="1"/> <argument name="Number" value="111"/> </actionGroup> - <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQuantity"/> + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQty"/> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> @@ -77,13 +77,13 @@ <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> - <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductSkuInGrid"> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductDataInGrid"> <argument name="row" value="1"/> <argument name="column" value="Quantity"/> <argument name="value" value="99"/> </actionGroup> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index 334061803bb4d..cc02bdc66c18b 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -19,8 +19,8 @@ <argument name="qty" type="string"/> </arguments> - <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="changeQtyToInvoice" after="waitForInvoicePage"/> - <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity" after="changeQtyToInvoice"/> - <waitForPageLoad stepKey="waitPageToBeLoaded" after="updateQuantity"/> + <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="fillQtyField" after="waitForInvoicePage"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="changeQtyToInvoice"/> + <waitForPageLoad stepKey="waitForPageRefreshed" after="updateQuantity"/> </actionGroup> </actionGroups> From f1b6aed98ee775ae6c6d672c6befbe563483fd2e Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 30 Nov 2020 17:04:22 +0200 Subject: [PATCH 340/490] MC-39072: JS error is shown on the checkout --- .../view/frontend/web/template/billing-address/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index 23bbce48fee2c..e4000e2d120f9 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@ <div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details"> <text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/> <text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/> - <text args="_.values(currentBillingAddress().street).join(', ')"/><br/> + <text args="currentBillingAddress().street"/><br/> <text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/> <text args="getCountryName(currentBillingAddress().countryId)"/><br/> <a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/> From 6cf729fcd5226857e3599021c63d012a635f6d1c Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar.dahiwala@briteskies.com> Date: Mon, 30 Nov 2020 10:13:00 -0500 Subject: [PATCH 341/490] magento/partners-magento2b2b#501: mftf fails to rerun when logout - Updating CE test when log out performed after customer is deleted - All the test are covered --- ...tPurchaseProductCustomOptionsDifferentStoreViewsTest.xml | 1 - .../Test/StorefrontPurchaseProductWithCustomOptionsTest.xml | 6 ++---- ...efaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml | 4 ++-- .../Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml | 6 +++--- .../StorefrontCustomerCheckoutTest.xml | 2 +- ...ComparisonWishlistIsPersistedUnderLongTermCookieTest.xml | 3 +-- ...rontCustomerCanChangeProductOptionsUsingSwatchesTest.xml | 3 ++- .../StorefrontAddMultipleStoreProductsToWishlistTest.xml | 3 ++- .../Test/Mftf/Test/WishListWithDisabledProductTest.xml | 3 ++- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index 4bf7dc0e08812..43e440c645790 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -72,7 +72,6 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </after> <!-- Open Product Grid, Filter product and open --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 34af0706e30d4..7bd7b6bc8e8b4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -31,16 +31,14 @@ <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </before> <after> - <!-- Customer Log Out --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <!-- Delete product and category --> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderListingFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> - <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </after> <!-- Login Customer Storefront --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index 1b9831e7dd0bd..c0dfd90a713f5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -31,11 +31,11 @@ </actionGroup> </before> <after> + <!--Logout from customer account--> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <!--Logout from customer account--> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> </after> <!-- Add simple product to cart and go to checkout--> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index a519aac72d1b5..cbea677b61051 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -108,12 +108,12 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/> - <!-- Delete customer --> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <!-- Logout customer --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml index e97f7f0d3e8e4..cb01f2f0ad201 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml @@ -28,12 +28,12 @@ </actionGroup> </before> <after> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteUsCustomer"/> <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="resetCustomerFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> </after> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index e6fae229d29b1..28d7d4d12c7cc 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -45,6 +45,7 @@ </actionGroup> </before> <after> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromCustomer"/> <createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/> <createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/> <createData entity="DisableSynchronizeWidgetProductsWithBackendStorage" stepKey="disableSynchronizeWidgetProductsWithBackendStorage"/> @@ -52,8 +53,6 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromCustomer"/> <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteRecentlyComparedProductsWidget"> <argument name="widget" value="RecentlyComparedProductsWidget"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml index ab532538cc3f3..a02d7945a8e7d 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -22,8 +22,9 @@ <createData entity="Simple_US_Customer" after="createCategory" stepKey="createCustomer"/> </before> <after> + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> <deleteData createDataKey="createCustomer" before="goToProductAttributes" stepKey="deleteCustomer"/> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" after="deleteCustomer" stepKey="logoutFromCustomer"/> </after> <!-- Remove steps that are not used for this test --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index aafd8b0b0d4d3..ae35cc78ec88e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -36,6 +36,8 @@ </before> <after> + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> @@ -49,7 +51,6 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsFilters"/> <!--Logout everywhere--> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> </after> <!-- Change products visibility on store-view level --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index 689b76e42e6f1..06624d25ad23e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -23,9 +23,10 @@ <createData entity="Simple_US_Customer" stepKey="createCustomer"/> </before> <after> + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> From c79feeb2166867c7ad551c7a9062067e4f7759a3 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 30 Nov 2020 17:18:49 +0200 Subject: [PATCH 342/490] MC-39482: [MFTF] Flaky EndToEndB2CLoggedInUserTestCest because of bad design --- .../Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 2 ++ .../Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 3 ++- .../SalesRule/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index fbb6893e92b1e..179ac35b9d206 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -10,6 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="EndToEndB2CLoggedInUserTest"> <before> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" after="loginAsAdmin" stepKey="deleteAllProducts"/> + <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct1"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 8dcf494b3572b..824c898068342 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -21,10 +21,11 @@ </annotations> <before> <resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/> + <actionGroup ref="AdminLoginActionGroup" after="resetCookieForCart" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <comment userInput="No need this since it done in before section" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 7a995b1feeeda..d76e9edb828bd 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -10,6 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="EndToEndB2CLoggedInUserTest"> <before> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" after="loginAsAdmin" stepKey="deleteCartPriceRule"/> <createData entity="ApiSalesRule" stepKey="createSalesRule"/> <createData entity="ApiSalesRuleCoupon" stepKey="createSalesRuleCoupon"> <requiredEntity createDataKey="createSalesRule"/> From 49a536c2f9a1fe7e03b75b3423654e9adde15857 Mon Sep 17 00:00:00 2001 From: Victor Rad <vrad@magento.com> Date: Mon, 30 Nov 2020 09:20:36 -0600 Subject: [PATCH 343/490] MC-38442: Admin First Name and Last Name are not present in welcome email with new template --- .../email/new_user_notification.html | 10 +- .../email_template_new_user_notification.php | 4 +- .../testsuite/Magento/User/Model/UserTest.php | 135 ++++++++++-------- 3 files changed, 80 insertions(+), 69 deletions(-) diff --git a/app/code/Magento/User/view/adminhtml/email/new_user_notification.html b/app/code/Magento/User/view/adminhtml/email/new_user_notification.html index 87f4e4669c4b6..0b6ceeb61cb71 100644 --- a/app/code/Magento/User/view/adminhtml/email/new_user_notification.html +++ b/app/code/Magento/User/view/adminhtml/email/new_user_notification.html @@ -4,12 +4,12 @@ * See COPYING.txt for license details. */ --> -<!--@subject {{trans "New admin user '%user_name' created" user_name=$user.name}} @--> +<!--@subject {{trans "New admin user '%user_name' created" user_name=$user.username}} @--> <!--@vars { "var store.frontend_name":"Store Name", -"var user.name":"User Name", -"var user.first_name":"User First Name", -"var user.last_name":"User Last Name", +"var user.username":"User Name", +"var user.firstname":"User First Name", +"var user.lastname":"User Last Name", "var user.email":"User Email", "var store_email":"Store Email", "var store_phone":"Store Phone" @@ -17,7 +17,7 @@ {{trans "Hello,"}} -{{trans "A new admin account was created for %first_name, %last_name using %email." first_name=$user.first_name last_name=$user.last_name email=$user.email}} +{{trans "A new admin account was created for %first_name, %last_name using %email." first_name=$user.firstname last_name=$user.lastname email=$user.email}} {{trans "If you have not authorized this action, please contact us immediately at %store_email" store_email=$store_email |escape}}{{depend store_phone}} {{trans "or call us at %store_phone" store_phone=$store_phone |escape}}{{/depend}}. {{trans "Thanks,"}} diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php index d5f9ad6889bac..d742eb1a01414 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_new_user_notification.php @@ -8,9 +8,11 @@ /** @var \Magento\Email\Model\Template $template */ $template = $objectManager->create(\Magento\Email\Model\Template::class); $template->setOptions(['area' => 'test area', 'store' => 1]); +$templateText = '{{trans "New User Notification Custom Text %first_name, ' . + '%last_name" first_name=$user.firstname last_name=$user.lastname}}'; $template->setData( [ - 'template_text' => 'New User Notification Custom Text', + 'template_text' => $templateText, 'template_code' => 'New User Notification Custom Code', 'template_type' => \Magento\Email\Model\Template::TYPE_TEXT, 'orig_template_code' => 'admin_emails_new_user_notification_template' diff --git a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php index 96530baf2b888..e20c4a4b60e62 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php @@ -7,23 +7,30 @@ namespace Magento\User\Model; use Magento\Authorization\Model\Role; +use Magento\Email\Model\ResourceModel\Template\Collection as TemplateCollection; use Magento\Framework\App\CacheInterface; +use Magento\Framework\App\Config\MutableScopeConfigInterface; use Magento\Framework\Encryption\Encryptor; +use Magento\Framework\Exception\AuthenticationException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NotFoundException; +use Magento\Framework\Exception\State\UserLockedException; +use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Phrase; use Magento\Framework\Stdlib\DateTime; +use Magento\TestFramework\Bootstrap as TestFrameworkBootstrap; +use Magento\TestFramework\Entity; use Magento\TestFramework\Helper\Bootstrap; -use Magento\User\Model\User as UserModel; -use Magento\Email\Model\ResourceModel\Template\Collection as TemplateCollection; -use Magento\Framework\Exception\NotFoundException; -use Magento\Framework\Phrase; -use Magento\Framework\App\Config\MutableScopeConfigInterface; use Magento\TestFramework\Mail\Template\TransportBuilderMock; +use Magento\User\Model\User as UserModel; +use PHPUnit\Framework\TestCase; /** * @magentoAppArea adminhtml * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class UserTest extends \PHPUnit\Framework\TestCase +class UserTest extends TestCase { /** * @var UserModel @@ -79,12 +86,12 @@ public function testCRUD() )->setUsername( 'user2' )->setPassword( - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_PASSWORD )->setEmail( 'user@magento.com' ); - $crud = new \Magento\TestFramework\Entity($this->_model, ['firstname' => '_New_name_']); + $crud = new Entity($this->_model, ['firstname' => '_New_name_']); $crud->testCrud(); } @@ -108,7 +115,7 @@ public function testLoadByUsername() { $this->_model->loadByUsername('non_existing_user'); $this->assertNull($this->_model->getId(), 'The admin user has an unexpected ID'); - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->assertNotEmpty($this->_model->getId(), 'The admin user should have been loaded'); } @@ -119,8 +126,8 @@ public function testLoadByUsername() */ public function testUpdateRoleOnSave() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); - $this->assertEquals(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); + $this->assertEquals(TestFrameworkBootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); $this->_model->setRoleId(self::$_newRole->getId())->save(); $this->assertEquals('admin_role', $this->_model->getRole()->getRoleName()); } @@ -142,9 +149,9 @@ public static function roleDataFixture() */ public function testSaveExtra() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->_model->saveExtra(['test' => 'val']); - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $extra = $this->_model->getExtra(); $this->assertEquals($extra['test'], 'val'); } @@ -154,10 +161,10 @@ public function testSaveExtra() */ public function testGetRoles() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $roles = $this->_model->getRoles(); $this->assertCount(1, $roles); - $this->assertEquals(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); + $this->assertEquals(TestFrameworkBootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); $this->_model->setRoleId(self::$_newRole->getId())->save(); $roles = $this->_model->getRoles(); $this->assertCount(1, $roles); @@ -169,10 +176,10 @@ public function testGetRoles() */ public function testGetRole() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $role = $this->_model->getRole(); $this->assertInstanceOf(Role::class, $role); - $this->assertEquals(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); + $this->assertEquals(TestFrameworkBootstrap::ADMIN_ROLE_NAME, $this->_model->getRole()->getRoleName()); $this->_model->setRoleId(self::$_newRole->getId())->save(); $role = $this->_model->getRole(); $this->assertEquals(self::$_newRole->getId(), $role->getId()); @@ -183,7 +190,7 @@ public function testGetRole() */ public function testDeleteFromRole() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $roles = $this->_model->getRoles(); $this->_model->setRoleId(reset($roles))->deleteFromRole(); $role = $this->_model->getRole(); @@ -192,7 +199,7 @@ public function testDeleteFromRole() public function testRoleUserExists() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $role = $this->_model->getRole(); $this->_model->setRoleId($role->getId()); $this->assertTrue($this->_model->roleUserExists()); @@ -203,16 +210,16 @@ public function testRoleUserExists() public function testGetCollection() { $this->assertInstanceOf( - \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::class, + AbstractCollection::class, $this->_model->getCollection() ); } public function testGetName() { - $firstname = \Magento\TestFramework\Bootstrap::ADMIN_FIRSTNAME; - $lastname = \Magento\TestFramework\Bootstrap::ADMIN_LASTNAME; - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $firstname = TestFrameworkBootstrap::ADMIN_FIRSTNAME; + $lastname = TestFrameworkBootstrap::ADMIN_LASTNAME; + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->assertEquals("$firstname $lastname", $this->_model->getName()); $this->assertEquals("$firstname///$lastname", $this->_model->getName('///')); } @@ -231,11 +238,11 @@ public function testGetUninitializedAclRole() */ public function testAuthenticate() { - $this->assertFalse($this->_model->authenticate('User', \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD)); + $this->assertFalse($this->_model->authenticate('User', TestFrameworkBootstrap::ADMIN_PASSWORD)); $this->assertTrue( $this->_model->authenticate( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_NAME, + TestFrameworkBootstrap::ADMIN_PASSWORD ) ); } @@ -247,11 +254,11 @@ public function testAuthenticate() */ public function testAuthenticateCaseInsensitive() { - $this->assertTrue($this->_model->authenticate('user', \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD)); + $this->assertTrue($this->_model->authenticate('user', TestFrameworkBootstrap::ADMIN_PASSWORD)); $this->assertTrue( $this->_model->authenticate( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_NAME, + TestFrameworkBootstrap::ADMIN_PASSWORD ) ); } @@ -261,13 +268,13 @@ public function testAuthenticateCaseInsensitive() */ public function testAuthenticateInactiveUser() { - $this->expectException(\Magento\Framework\Exception\AuthenticationException::class); + $this->expectException(AuthenticationException::class); $this->_model->load(1); $this->_model->setIsActive(0)->save(); $this->_model->authenticate( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_NAME, + TestFrameworkBootstrap::ADMIN_PASSWORD ); } @@ -277,14 +284,14 @@ public function testAuthenticateInactiveUser() */ public function testAuthenticateUserWithoutRole() { - $this->expectException(\Magento\Framework\Exception\AuthenticationException::class); + $this->expectException(AuthenticationException::class); $this->_model->loadByUsername('customRoleUser'); $roles = $this->_model->getRoles(); $this->_model->setRoleId(reset($roles))->deleteFromRole(); $this->_model->authenticate( 'customRoleUser', - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_PASSWORD ); } @@ -294,13 +301,13 @@ public function testAuthenticateUserWithoutRole() */ public function testLoginsAreLogged() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $lognum = $this->_model->getLognum(); $beforeLogin = time(); $this->_model->login( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_NAME, + TestFrameworkBootstrap::ADMIN_PASSWORD )->reload(); $loginTime = strtotime($this->_model->getLogdate()); @@ -309,8 +316,8 @@ public function testLoginsAreLogged() $beforeLogin = time(); $this->_model->login( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_NAME, + TestFrameworkBootstrap::ADMIN_PASSWORD )->reload(); $loginTime = strtotime($this->_model->getLogdate()); $this->assertTrue($beforeLogin <= $loginTime && $loginTime <= time()); @@ -319,11 +326,11 @@ public function testLoginsAreLogged() public function testReload() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->_model->setFirstname('NewFirstName'); $this->assertEquals('NewFirstName', $this->_model->getFirstname()); $this->_model->reload(); - $this->assertEquals(\Magento\TestFramework\Bootstrap::ADMIN_FIRSTNAME, $this->_model->getFirstname()); + $this->assertEquals(TestFrameworkBootstrap::ADMIN_FIRSTNAME, $this->_model->getFirstname()); } /** @@ -331,7 +338,7 @@ public function testReload() */ public function testHasAssigned2Role() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $role = $this->_model->hasAssigned2Role($this->_model); $this->assertCount(1, $role); $this->assertArrayHasKey('role_id', $role[0]); @@ -353,7 +360,7 @@ public function testBeforeSaveRequiredFieldsValidation() . 'Password is required field.' . PHP_EOL . 'Invalid type given. String expected' . PHP_EOL . 'Invalid type given. String, integer or float expected'; - $this->expectException(\Magento\Framework\Exception\LocalizedException::class); + $this->expectException(LocalizedException::class); $this->expectExceptionMessage($expectedMessages); $this->_model->setSomething('some_value'); @@ -407,7 +414,7 @@ public function testBeforeSavePasswordHash() */ public function testBeforeSavePasswordsDoNotMatch() { - $this->expectException(\Magento\Framework\Exception\LocalizedException::class); + $this->expectException(LocalizedException::class); $this->expectExceptionMessage('Your password confirmation must match your password.'); $this->_model->setPassword('password2'); @@ -420,7 +427,7 @@ public function testBeforeSavePasswordsDoNotMatch() */ public function testBeforeSavePasswordTooShort() { - $this->expectException(\Magento\Framework\Exception\LocalizedException::class); + $this->expectException(LocalizedException::class); $this->expectExceptionMessage('Your password must include both numeric and alphabetic characters.'); $this->_model->setPassword('123456'); @@ -434,7 +441,7 @@ public function testBeforeSavePasswordTooShort() */ public function testBeforeSavePasswordInsecure($password) { - $this->expectException(\Magento\Framework\Exception\LocalizedException::class); + $this->expectException(LocalizedException::class); $this->expectExceptionMessage('Your password must include both numeric and alphabetic characters.'); $this->_model->setPassword($password); @@ -451,7 +458,7 @@ public function beforeSavePasswordInsecureDataProvider() */ public function testBeforeSaveUserIdentityViolation() { - $this->expectException(\Magento\Framework\Exception\LocalizedException::class); + $this->expectException(LocalizedException::class); $this->expectExceptionMessage('A user with the same user name or email already exists.'); $this->_model->setUsername('user'); @@ -484,12 +491,12 @@ public function testBeforeSaveValidationSuccess() */ public function testChangeResetPasswordLinkToken() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->_model->changeResetPasswordLinkToken('test'); $date = $this->_model->getRpTokenCreatedAt(); $this->assertNotNull($date); $this->_model->save(); - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->assertEquals('test', $this->_model->getRpToken()); $this->assertEquals(strtotime($date), strtotime($this->_model->getRpTokenCreatedAt())); } @@ -501,11 +508,11 @@ public function testChangeResetPasswordLinkToken() */ public function testIsResetPasswordLinkTokenExpired() { - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->assertTrue($this->_model->isResetPasswordLinkTokenExpired()); $this->_model->changeResetPasswordLinkToken('test'); $this->_model->save(); - $this->_model->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + $this->_model->loadByUsername(TestFrameworkBootstrap::ADMIN_NAME); $this->assertFalse($this->_model->isResetPasswordLinkTokenExpired()); $this->_model->setRpTokenCreatedAt($this->_dateTime->formatDate(time() - 60 * 60 * 2 + 2)); $this->assertFalse($this->_model->isResetPasswordLinkTokenExpired()); @@ -531,7 +538,7 @@ public function testGetSetHasAvailableResources() public function testPerformIdentityCheck() { $this->_model->loadByUsername('adminUser'); - $passwordString = \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD; + $passwordString = TestFrameworkBootstrap::ADMIN_PASSWORD; $this->_model->performIdentityCheck($passwordString); } @@ -542,7 +549,7 @@ public function testPerformIdentityCheck() */ public function testPerformIdentityCheckWrongPassword() { - $this->expectException(\Magento\Framework\Exception\AuthenticationException::class); + $this->expectException(AuthenticationException::class); $this->_model->loadByUsername('adminUser'); $passwordString = 'wrongPassword'; @@ -560,10 +567,10 @@ public function testPerformIdentityCheckWrongPassword() */ public function testPerformIdentityCheckLockExpires() { - $this->expectException(\Magento\Framework\Exception\State\UserLockedException::class); + $this->expectException(UserLockedException::class); $this->_model->loadByUsername('adminUser2'); - $this->_model->performIdentityCheck(\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); + $this->_model->performIdentityCheck(TestFrameworkBootstrap::ADMIN_PASSWORD); $this->expectExceptionMessage( 'The account sign-in was incorrect or your account is disabled temporarily. ' @@ -580,14 +587,14 @@ public function testPerformIdentityCheckLockExpires() public function testSendNotificationEmailsIfRequired() { /** @var MutableScopeConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(MutableScopeConfigInterface::class); + $config = Bootstrap::getObjectManager() + ->get(MutableScopeConfigInterface::class); $config->setValue( 'admin/emails/new_user_notification_template', $this->getCustomEmailTemplateIdForNewUserNotification() ); - $userModel = Bootstrap::getObjectManager()->create( - \Magento\User\Model\User::class - ); + $userModel = Bootstrap::getObjectManager() + ->create(User::class); $userModel->setFirstname( 'John' )->setLastname( @@ -595,17 +602,18 @@ public function testSendNotificationEmailsIfRequired() )->setUsername( 'user2' )->setPassword( - \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + TestFrameworkBootstrap::ADMIN_PASSWORD )->setEmail( 'user@magento.com' ); $userModel->save(); $userModel->sendNotificationEmailsIfRequired(); /** @var TransportBuilderMock $transportBuilderMock */ - $transportBuilderMock = Bootstrap::getObjectManager()->get(TransportBuilderMock::class); + $transportBuilderMock = Bootstrap::getObjectManager() + ->get(TransportBuilderMock::class); $sentMessage = $transportBuilderMock->getSentMessage(); $this->assertSame( - 'New User Notification Custom Text', + 'New User Notification Custom Text ' . $userModel->getFirstname() . ', ' . $userModel->getLastname(), $sentMessage->getBodyText() ); } @@ -619,7 +627,8 @@ public function testSendNotificationEmailsIfRequired() private function getCustomEmailTemplateIdForNewUserNotification(): ?int { $templateId = null; - $templateCollection = Bootstrap::getObjectManager()->get(TemplateCollection::class); + $templateCollection = Bootstrap::getObjectManager() + ->get(TemplateCollection::class); $origTemplateCode = 'admin_emails_new_user_notification_template'; foreach ($templateCollection as $template) { if ($template->getOrigTemplateCode() == $origTemplateCode) { From 08db336c483bf16fded653e0d42d1aa164db91db Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Mon, 30 Nov 2020 09:26:20 -0600 Subject: [PATCH 344/490] MC-38787: Admin Product Grid Page indicator issue --- ...roup.xml => AdminSearchGridByStringNoClearActionGroup.xml} | 4 ++-- .../Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{SearchProductGridByStringNoClearActionGroup.xml => AdminSearchGridByStringNoClearActionGroup.xml} (82%) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSearchGridByStringNoClearActionGroup.xml similarity index 82% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSearchGridByStringNoClearActionGroup.xml index 95ddfd37c0037..afaa3c28c56e8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByStringNoClearActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSearchGridByStringNoClearActionGroup.xml @@ -8,9 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="SearchProductGridByStringNoClearActionGroup"> + <actionGroup name="AdminSearchGridByStringNoClearActionGroup"> <annotations> - <description>Searches the Admin Products grid by string without clearing filters.</description> + <description>Search the Admin grid by string without clearing filters.</description> </annotations> <arguments> <argument name="keyword" defaultValue="" type="string"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml index f833171166141..9bb7064b1870b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml @@ -80,7 +80,7 @@ </actionGroup> <!-- Performing the first search and assertions --> - <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForSimpleProduct"> + <actionGroup ref="AdminSearchGridByStringNoClearActionGroup" stepKey="searchForSimpleProduct"> <argument name="keyword" value="SimpleProduct"/> </actionGroup> <actionGroup ref="AdminGridAssertTotalPageCountActionGroup" stepKey="waitForTotalPagesCountFourToBeVisible"> @@ -92,7 +92,7 @@ </actionGroup> <!-- Performing the second search and assertions of successful current page number reset --> - <actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct"> + <actionGroup ref="AdminSearchGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct"> <argument name="keyword" value="VirtualProduct"/> </actionGroup> <actionGroup ref="AdminGridAssertTotalPageCountActionGroup" stepKey="waitForTotalPagesCountThreeToBeVisible"> From 42a2d1f00da7238a38cd5951d4014e5cddb1a5ba Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 17:49:54 +0200 Subject: [PATCH 345/490] refactored/added waitForPageLoad --- ...eckNameToggleOnProductsMassAttributeUpdateActionGroup.xml | 2 +- .../AdminCheckProductOnProductGridActionGroup.xml | 2 +- ...dminClickSaveOnProductsMassAttributeUpdateActionGroup.xml | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml index f2bbc2d5b10b1..919e1bcb0dcb2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckNameToggleOnProductsMassAttributeUpdateActionGroup.xml @@ -16,4 +16,4 @@ <click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml index 83c473751d266..64fab5575e392 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml @@ -19,4 +19,4 @@ <checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml index 6e427c359c9a3..a3328c5eb115b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickSaveOnProductsMassAttributeUpdateActionGroup.xml @@ -14,6 +14,7 @@ </annotations> <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> - + <waitForPageLoad stepKey="waitForUpdateAttributesPage"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Update Attributes" stepKey="seeUpdateAttributesTitle"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> From 234c78407a5f3ab56b6b060824456d872188bd41 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:52:32 +0200 Subject: [PATCH 346/490] refactoring --- .../Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml | 2 +- .../AdminInvoiceWIthUpdatedProductQtyActionGroup.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 551269945bd81..0b9b5c98d9884 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -56,7 +56,7 @@ <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrder"/> - <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> + <actionGroup ref="AdminInvoiceWithUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> <argument name="qty" value="1"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index cc02bdc66c18b..c9c9d5bf1e573 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> + <actionGroup name="AdminInvoiceWithUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> <annotations> <description>Start order Invoicing. Update product qty to invoice (there is one product in the Order). From 56e2026e62d1d73cf91c2382bc95bee5971c1063 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:54:52 +0200 Subject: [PATCH 347/490] add "DEPRECATED" to title --- .../Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 899ed7f1e60ba..4baceead08a07 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -13,7 +13,7 @@ <annotations> <features value="ConfigurableProduct"/> <stories value="Cancel order"/> - <title value="Product quantity return after order cancel"/> + <title value="DEPRECATED. Product quantity return after order cancel"/> <description value="Check Product quantity return after order cancel"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-97228"/> From 0d93b240eeecfb16c71c35d9090160d4f0774d13 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:59:56 +0200 Subject: [PATCH 348/490] refactored --- .../AdminInvoiceWIthUpdatedProductQtyActionGroup.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index c9c9d5bf1e573..0f602c42ade25 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -20,7 +20,7 @@ </arguments> <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="fillQtyField" after="waitForInvoicePage"/> - <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="changeQtyToInvoice"/> - <waitForPageLoad stepKey="waitForPageRefreshed" after="updateQuantity"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="fillQtyField"/> + <waitForPageLoad stepKey="waitForPageRefreshed" after="clickUpdateQuantityButton"/> </actionGroup> </actionGroups> From 04bd4bda3043fd2d347da36d37f1a8234530f48b Mon Sep 17 00:00:00 2001 From: Anna Pak <58164147+AnnaAPak@users.noreply.github.com> Date: Mon, 30 Nov 2020 20:05:32 +0200 Subject: [PATCH 349/490] Rename AdminInvoiceWIthUpdatedProductQtyActionGroup.xml to AdminInvoiceWithUpdatedProductQtyActionGroup.xml --- ...Group.xml => AdminInvoiceWithUpdatedProductQtyActionGroup.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/Sales/Test/Mftf/ActionGroup/{AdminInvoiceWIthUpdatedProductQtyActionGroup.xml => AdminInvoiceWithUpdatedProductQtyActionGroup.xml} (100%) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWithUpdatedProductQtyActionGroup.xml similarity index 100% rename from app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml rename to app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWithUpdatedProductQtyActionGroup.xml From 3e88e175e7ae6609bc8e54a669b988c86ba310ad Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Mon, 30 Nov 2020 13:28:56 -0600 Subject: [PATCH 350/490] MC-38770: Exception during initialization is cacheable - moved dependency to use --- lib/internal/Magento/Framework/App/Bootstrap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 92b925836b295..83f292cfdf703 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -13,6 +13,7 @@ use Magento\Framework\Autoload\Populator; use Magento\Framework\Config\File\ConfigFilePool; use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\HTTP\PhpEnvironment\Response; use Psr\Log\LoggerInterface; /** @@ -428,8 +429,8 @@ public function isDeveloperMode() */ protected function terminate(\Throwable $e) { - /** @var \Magento\Framework\HTTP\PhpEnvironment\Response $response */ - $response = $this->objectManager->get(\Magento\Framework\HTTP\PhpEnvironment\Response::class); + /** @var Response $response */ + $response = $this->objectManager->get(Response::class); $response->clearHeaders(); $response->setHttpResponseCode(500); $response->setHeader('Content-Type', 'text/plain'); From 6f0a325cbed129a1083d0f1442dfc6dcb79d51ac Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Mon, 30 Nov 2020 13:45:00 -0600 Subject: [PATCH 351/490] MC-39071: Implement Multiple Wishlist additions and patch back minor updates - update test coverage for wishlist AddBundleProductToWishlist --- .../AddBundleProductToWishlistTest.php | 51 +++++++++++++------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddBundleProductToWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddBundleProductToWishlistTest.php index 04518fad47052..b2de595906f5b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddBundleProductToWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddBundleProductToWishlistTest.php @@ -85,17 +85,29 @@ public function testAddBundleProductWithOptions(): void $this->assertArrayHasKey('addProductsToWishlist', $response); $this->assertArrayHasKey('wishlist', $response['addProductsToWishlist']); + $this->assertEmpty($response['addProductsToWishlist']['user_errors']); $response = $response['addProductsToWishlist']['wishlist']; $this->assertEquals($wishlist->getItemsCount(), $response['items_count']); $this->assertEquals($wishlist->getSharingCode(), $response['sharing_code']); $this->assertEquals($wishlist->getUpdatedAt(), $response['updated_at']); - $this->assertEquals($item->getData('qty'), $response['items_v2'][0]['quantity']); - $this->assertEquals($item->getDescription(), $response['items_v2'][0]['description']); - $this->assertEquals($item->getAddedAt(), $response['items_v2'][0]['added_at']); - $this->assertNotEmpty($response['items_v2'][0]['bundle_options']); - $bundleOptions = $response['items_v2'][0]['bundle_options']; + $this->assertEquals($item->getData('qty'), $response['items_v2']['items'][0]['quantity']); + $this->assertEquals($item->getDescription(), $response['items_v2']['items'][0]['description']); + $this->assertEquals($item->getAddedAt(), $response['items_v2']['items'][0]['added_at']); + $this->assertNotEmpty($response['items_v2']['items'][0]['bundle_options']); + $bundleOptions = $response['items_v2']['items'][0]['bundle_options']; $this->assertEquals('Bundle Product Items', $bundleOptions[0]['label']); $this->assertEquals(Select::NAME, $bundleOptions[0]['type']); + $bundleOptionValuesResponse = $bundleOptions[0]['values'][0]; + $this->assertNotNull($bundleOptionValuesResponse['id']); + unset($bundleOptionValuesResponse['id']); + $this->assertResponseFields( + $bundleOptionValuesResponse, + [ + 'label' => 'Simple Product', + 'quantity' => 1, + 'price' => 2.75 + ] + ); } /** @@ -121,21 +133,22 @@ public function testAddingBundleItemWithCustomOptionQuantity() $this->assertArrayHasKey('addProductsToWishlist', $response); $this->assertArrayHasKey('wishlist', $response['addProductsToWishlist']); + $this->assertEmpty($response['addProductsToWishlist']['user_errors']); $response = $response['addProductsToWishlist']['wishlist']; $this->assertEquals($wishlist->getItemsCount(), $response['items_count']); $this->assertEquals($wishlist->getSharingCode(), $response['sharing_code']); $this->assertEquals($wishlist->getUpdatedAt(), $response['updated_at']); - $this->assertEquals($item->getData('qty'), $response['items_v2'][0]['quantity']); - $this->assertEquals($item->getDescription(), $response['items_v2'][0]['description']); - $this->assertEquals($item->getAddedAt(), $response['items_v2'][0]['added_at']); - $this->assertNotEmpty($response['items_v2'][0]['bundle_options']); - $bundleOptions = $response['items_v2'][0]['bundle_options']; + $this->assertEquals($item->getData('qty'), $response['items_v2']['items'][0]['quantity']); + $this->assertEquals($item->getDescription(), $response['items_v2']['items'][0]['description']); + $this->assertEquals($item->getAddedAt(), $response['items_v2']['items'][0]['added_at']); + $this->assertNotEmpty($response['items_v2']['items'][0]['bundle_options']); + $bundleOptions = $response['items_v2']['items'][0]['bundle_options']; $this->assertEquals('Option 1', $bundleOptions[0]['label']); - $bundleOptionOneValues = $bundleOptions[0]['values']; - $this->assertEquals(7, $bundleOptionOneValues[0]['quantity']); + $bundleOptionFirstValue = $bundleOptions[0]['values']; + $this->assertEquals(7, $bundleOptionFirstValue[0]['quantity']); $this->assertEquals('Option 2', $bundleOptions[1]['label']); - $bundleOptionTwoValues = $bundleOptions[1]['values']; - $this->assertEquals(1, $bundleOptionTwoValues[0]['quantity']); + $bundleOptionSecondValue = $bundleOptions[1]['values']; + $this->assertEquals(1, $bundleOptionSecondValue[0]['quantity']); } /** @@ -195,7 +208,8 @@ private function getQuery( items_count updated_at items_v2 { - id + items { + id description quantity added_at @@ -212,6 +226,8 @@ private function getQuery( } } } + } + } } } @@ -267,7 +283,8 @@ private function getQueryWithCustomOptionQuantity( items_count updated_at items_v2 { - id + items { + id description quantity added_at @@ -284,6 +301,8 @@ private function getQueryWithCustomOptionQuantity( } } } + } + } } } From b9b60277c3d967bd8d570e9491d92e3fe4800992 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 30 Nov 2020 13:49:31 -0600 Subject: [PATCH 352/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../AdminOpenCMSBlocksGridActionGroup.xml | 19 ------------------- .../AdminOpenCmsBlocksGridActionGroup.xml | 18 ------------------ 2 files changed, 37 deletions(-) delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSBlocksGridActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSBlocksGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSBlocksGridActionGroup.xml deleted file mode 100644 index 18e7e5fb52615..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCMSBlocksGridActionGroup.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="AdminOpenCMSBlocksGridActionGroup"> - <annotations> - <description>Navigate to the Admin Blocks Grid page.</description> - </annotations> - - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml deleted file mode 100644 index 4b57e0c1274f6..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.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="AdminOpenCmsBlocksGridActionGroup"> - <annotations> - <description>Goes to the Cms Blocks grid page.</description> - </annotations> - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> From 12fcd207b8527d60260e788cd2d62769492d8567 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 30 Nov 2020 13:51:19 -0600 Subject: [PATCH 353/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml index 1e3cf57e8777b..4813d8aefdb8d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml @@ -10,6 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="SalesRuleConsumerData"> <data key="consumerName">sales.rule.update.coupon.usage</data> - <data key="messageLimit">100</data> + <data key="messageLimit">3</data> </entity> </entities> From 4e82e08520c277bf07fd9436d467dbc8c9511ff7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 30 Nov 2020 13:53:57 -0600 Subject: [PATCH 354/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index f33cf60b4ef6a..da9acc71b33b1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -63,7 +63,7 @@ <argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/> </actionGroup> - <actionGroup ref="CliConsumerStartActionGroup" stepKey="startSalesRuleMessageQueue"> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> </actionGroup> From a53949837ce15882e638a297a43ff7415db76801 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 30 Nov 2020 14:03:05 -0600 Subject: [PATCH 355/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../AdminOpenCmsBlocksGridActionGroup.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.xml new file mode 100644 index 0000000000000..4b57e0c1274f6 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenCmsBlocksGridActionGroup.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="AdminOpenCmsBlocksGridActionGroup"> + <annotations> + <description>Goes to the Cms Blocks grid page.</description> + </annotations> + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> From 6386ee690eb7d8488011a2b18e228e1bd4d25992 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Mon, 30 Nov 2020 15:28:36 -0600 Subject: [PATCH 356/490] MC-39360: Error while uploading first product image with AWS S3 enabled --- .../Magento/CatalogImportExport/Model/Import/Product.php | 6 +++--- app/code/Magento/MediaStorage/App/Media.php | 4 +++- .../Magento/MediaStorage/Test/Unit/App/MediaTest.php | 9 +++++++-- .../Model/Import/ImportWithSharedImagesTest.php | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 428961aa6ddf6..425d1309bd46c 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1965,7 +1965,7 @@ private function getAlreadyExistedImage(array $imageRow, string $columnImage, st if (filter_var($columnImage, FILTER_VALIDATE_URL)) { $hash = $this->getFileHash($columnImage); } else { - $path = $importDir . DS . $columnImage; + $path = $importDir . DIRECTORY_SEPARATOR . $columnImage; $hash = $this->isFileExists($path) ? $this->getFileHash($path) : ''; } @@ -1991,7 +1991,7 @@ function ($exists, $file) use ($hash) { private function addImageHashes(array &$images): void { $productMediaPath = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA) - ->getAbsolutePath(DS . 'catalog' . DS . 'product'); + ->getAbsolutePath(DIRECTORY_SEPARATOR . 'catalog' . DIRECTORY_SEPARATOR . 'product'); foreach ($images as $storeId => $skus) { foreach ($skus as $sku => $files) { @@ -2188,7 +2188,7 @@ private function getImportDir(): string $dirAddon = $dirConfig[DirectoryList::MEDIA][DirectoryList::PATH]; return empty($this->_parameters[Import::FIELD_NAME_IMG_FILE_DIR]) - ? $dirAddon . DS . $this->_mediaDirectory->getRelativePath('import') + ? $dirAddon . DIRECTORY_SEPARATOR . $this->_mediaDirectory->getRelativePath('import') : $this->_parameters[Import::FIELD_NAME_IMG_FILE_DIR]; } diff --git a/app/code/Magento/MediaStorage/App/Media.php b/app/code/Magento/MediaStorage/App/Media.php index 34c20aab40bcb..fd73519ebd290 100644 --- a/app/code/Magento/MediaStorage/App/Media.php +++ b/app/code/Magento/MediaStorage/App/Media.php @@ -187,7 +187,9 @@ public function launch(): ResponseInterface $this->mediaDirectoryPath = $config->getMediaDirectory(); $allowedResources = $config->getAllowedResources(); $isAllowed = $this->isAllowed; - if (!$isAllowed($this->relativeFileName, $allowedResources)) { + $fileAbsolutePath = $this->directoryPub->getAbsolutePath($this->relativeFileName); + $fileRelativePath = str_replace(rtrim($this->mediaDirectoryPath, '/') . '/', '', $fileAbsolutePath); + if (!$isAllowed($fileRelativePath, $allowedResources)) { throw new LogicException('The path is not allowed: ' . $this->relativeFileName); } } diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index 068732a7225cd..e9877a6e1b612 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php @@ -118,7 +118,7 @@ public function testProcessRequestCreatesConfigFileMediaDirectoryIsNotProvided() ->method('getAbsolutePath') ->with(null) ->willReturn(self::MEDIA_DIRECTORY); - $this->directoryPubMock->expects(self::once()) + $this->directoryPubMock->expects(self::exactly(2)) ->method('getAbsolutePath') ->with(self::RELATIVE_FILE_PATH) ->willReturn($filePath); @@ -154,7 +154,7 @@ public function testProcessRequestReturnsFileIfItsProperlySynchronized(): void ->method('isReadable') ->with(self::RELATIVE_FILE_PATH) ->willReturn(true); - $this->directoryPubMock->expects(self::once()) + $this->directoryPubMock->expects(self::exactly(2)) ->method('getAbsolutePath') ->with(self::RELATIVE_FILE_PATH) ->willReturn($filePath); @@ -214,10 +214,15 @@ public function testCatchException(bool $isDeveloper, int $setBodyCalls): void public function testExceptionWhenIsAllowedReturnsFalse(): void { + $filePath = '/absolute/path/to/test/file.png'; $this->directoryMediaMock->expects(self::once()) ->method('getAbsolutePath') ->with(null) ->willReturn(self::MEDIA_DIRECTORY); + $this->directoryPubMock->expects(self::once()) + ->method('getAbsolutePath') + ->with(self::RELATIVE_FILE_PATH) + ->willReturn($filePath); $this->configMock->expects(self::once()) ->method('save'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithSharedImagesTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithSharedImagesTest.php index 35d4cceb50845..683416bc0a7ac 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithSharedImagesTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithSharedImagesTest.php @@ -202,7 +202,7 @@ private function updateUploader(): void $rootDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::ROOT); $destDir = $rootDirectory->getRelativePath( $this->appParams[DirectoryList::MEDIA][DirectoryList::PATH] - . DS . $this->mediaConfig->getBaseMediaPath() + . DIRECTORY_SEPARATOR . $this->mediaConfig->getBaseMediaPath() ); $tmpDir = $rootDirectory->getRelativePath( $this->appParams[DirectoryList::MEDIA][DirectoryList::PATH] @@ -226,7 +226,7 @@ private function moveImages(string $fileName): void $this->appParams[DirectoryList::MEDIA][DirectoryList::PATH] ); $fixtureDir = realpath(__DIR__ . '/../../_files'); - $tmpFilePath = $rootDirectory->getAbsolutePath($tmpDir . DS . $fileName); + $tmpFilePath = $rootDirectory->getAbsolutePath($tmpDir . DIRECTORY_SEPARATOR . $fileName); $this->fileDriver->createDirectory($tmpDir); $rootDirectory->getDriver()->copy( $fixtureDir . DIRECTORY_SEPARATOR . $fileName, From 2ed8a461e23641f6fea9fa566b9fe69de1a01f34 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 30 Nov 2020 15:29:47 -0600 Subject: [PATCH 357/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Test/StorefrontAutoGeneratedCouponCodeTest.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index da9acc71b33b1..1c63796827785 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -63,10 +63,6 @@ <argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/> </actionGroup> - <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> - <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> - <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> - </actionGroup> <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> <comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitFormToReload1"/> <conditionalClick selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" @@ -105,10 +101,16 @@ <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> + <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> + </actionGroup> + <reloadPage stepKey="refreshPage1"/> <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> + <reloadPage stepKey="refreshPage2"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule1"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="couponCode" value="{$couponCode}"/> From a69c6e9a8013ea8cdc4460be3550745c94cff196 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak <oposyniak@magento.com> Date: Mon, 30 Nov 2020 15:32:30 -0600 Subject: [PATCH 358/490] MC-39033: Rename AWS S3 module --- ...S3StorefrontCaptchaOnCustomerLoginTest.xml | 28 +++++++++++++++++++ app/code/Magento/Captcha/Helper/Data.php | 3 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontCaptchaOnCustomerLoginTest.xml diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontCaptchaOnCustomerLoginTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontCaptchaOnCustomerLoginTest.xml new file mode 100644 index 0000000000000..52ab08da88bde --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontCaptchaOnCustomerLoginTest.xml @@ -0,0 +1,28 @@ +<?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="AwsS3StorefrontCaptchaOnCustomerLoginTest" extends="StorefrontCaptchaOnCustomerLoginTest"> + <annotations> + <features value="Captcha"/> + <stories value="Login with Customer Account + Captcha"/> + <title value="AWS S3 Captcha customer login page test"/> + <description value="Check CAPTCHA on Storefront Login Page."/> + <severity value="MAJOR"/> + <testCaseId value="MC-39491" /> + <group value="remote_storage_aws_s3"/> + </annotations> + <before> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> + </before> + <after> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Captcha/Helper/Data.php b/app/code/Magento/Captcha/Helper/Data.php index 9a14f9ae9a21d..8a9131a499b13 100644 --- a/app/code/Magento/Captcha/Helper/Data.php +++ b/app/code/Magento/Captcha/Helper/Data.php @@ -150,7 +150,8 @@ public function getFonts() */ public function getImgDir($website = null) { - $mediaDir = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA); + // Captcha images are not re-used and should be stored only locally. + $mediaDir = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA, Filesystem\DriverPool::FILE); $captchaDir = '/captcha/' . $this->_getWebsiteCode($website); $mediaDir->create($captchaDir); return $mediaDir->getAbsolutePath($captchaDir) . '/'; From fa781f9ef17e7e1c69cd301aef53656dc9fa9ab2 Mon Sep 17 00:00:00 2001 From: Sagar Dahiwala <sagar.dahiwala@briteskies.com> Date: Mon, 30 Nov 2020 17:22:37 -0500 Subject: [PATCH 359/490] magento/partners-magento2b2b#501: mftf fails to rerun when logsout - Few More test are corrected --- ...frontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml | 2 +- ...orefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index 43e440c645790..28cd10cc52f47 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -49,7 +49,7 @@ <after> <!-- Customer Log Out --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml index a02d7945a8e7d..c14cc3bda73d6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -23,7 +23,7 @@ </before> <after> <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromCustomer"/> <deleteData createDataKey="createCustomer" before="goToProductAttributes" stepKey="deleteCustomer"/> </after> From c58e6174dce585929f4c72d72dd7ab5c68c7df7e Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Mon, 30 Nov 2020 16:47:16 -0600 Subject: [PATCH 360/490] MC-39071: Implement Multiple Wishlist additions and patch back minor updates - update test coverage for adding different types of products --- .../AddConfigurableProductToWishlistTest.php | 20 +++-- .../AddDownloadableProductToWishlistTest.php | 24 +++--- .../Wishlist/CustomerWishlistsTest.php | 5 +- .../UpdateProductsFromWishlistTest.php | 79 +++++++++++-------- 4 files changed, 76 insertions(+), 52 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddConfigurableProductToWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddConfigurableProductToWishlistTest.php index cffc5eb6f93c1..25933e341564e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddConfigurableProductToWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddConfigurableProductToWishlistTest.php @@ -68,17 +68,19 @@ public function testAddConfigurableProductWithOptions(): void $this->assertArrayHasKey('addProductsToWishlist', $response); $this->assertArrayHasKey('wishlist', $response['addProductsToWishlist']); + $this->assertEmpty($response['addProductsToWishlist']['user_errors']); $wishlistResponse = $response['addProductsToWishlist']['wishlist']; $this->assertEquals($wishlist->getItemsCount(), $wishlistResponse['items_count']); $this->assertEquals($wishlist->getSharingCode(), $wishlistResponse['sharing_code']); $this->assertEquals($wishlist->getUpdatedAt(), $wishlistResponse['updated_at']); - $this->assertEquals($wishlistItem->getId(), $wishlistResponse['items_v2'][0]['id']); - $this->assertEquals($wishlistItem->getData('qty'), $wishlistResponse['items_v2'][0]['quantity']); - $this->assertEquals($wishlistItem->getDescription(), $wishlistResponse['items_v2'][0]['description']); - $this->assertEquals($wishlistItem->getAddedAt(), $wishlistResponse['items_v2'][0]['added_at']); - $this->assertNotEmpty($wishlistResponse['items_v2'][0]['configurable_options']); - $configurableOptions = $wishlistResponse['items_v2'][0]['configurable_options']; + $this->assertEquals($wishlistItem->getId(), $wishlistResponse['items_v2']['items'][0]['id']); + $this->assertEquals($wishlistItem->getData('qty'), $wishlistResponse['items_v2']['items'][0]['quantity']); + $this->assertEquals($wishlistItem->getDescription(), $wishlistResponse['items_v2']['items'][0]['description']); + $this->assertEquals($wishlistItem->getAddedAt(), $wishlistResponse['items_v2']['items'][0]['added_at']); + $this->assertNotEmpty($wishlistResponse['items_v2']['items'][0]['configurable_options']); + $configurableOptions = $wishlistResponse['items_v2']['items'][0]['configurable_options']; $this->assertEquals('Test Configurable', $configurableOptions[0]['option_label']); + $this->assertEquals('Option 1', $configurableOptions[0]['value_label']); } /** @@ -138,8 +140,9 @@ private function getQuery( sharing_code items_count updated_at - items_v2 { - id + items_v2(currentPage:1,pageSize:1) { + items{ + id description quantity added_at @@ -153,6 +156,7 @@ private function getQuery( } } } + } } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddDownloadableProductToWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddDownloadableProductToWishlistTest.php index 0de45fb21b20b..901d1b2ee87cc 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddDownloadableProductToWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddDownloadableProductToWishlistTest.php @@ -104,19 +104,20 @@ public function testAddDownloadableProductWithOptions(): void $this->assertArrayHasKey('addProductsToWishlist', $response); $this->assertArrayHasKey('wishlist', $response['addProductsToWishlist']); + $this->assertEmpty($response['addProductsToWishlist']['user_errors']); $wishlistResponse = $response['addProductsToWishlist']['wishlist']; $this->assertEquals($wishlist->getItemsCount(), $wishlistResponse['items_count']); $this->assertEquals($wishlist->getSharingCode(), $wishlistResponse['sharing_code']); $this->assertEquals($wishlist->getUpdatedAt(), $wishlistResponse['updated_at']); - $this->assertEquals($wishlistItem->getId(), $wishlistResponse['items_v2'][0]['id']); - $this->assertEquals($wishlistItem->getData('qty'), $wishlistResponse['items_v2'][0]['quantity']); - $this->assertEquals($wishlistItem->getDescription(), $wishlistResponse['items_v2'][0]['description']); - $this->assertEquals($wishlistItem->getAddedAt(), $wishlistResponse['items_v2'][0]['added_at']); - $this->assertNotEmpty($wishlistResponse['items_v2'][0]['links_v2']); - $wishlistItemLinks = $wishlistResponse['items_v2'][0]['links_v2']; + $this->assertEquals($wishlistItem->getId(), $wishlistResponse['items_v2']['items'][0]['id']); + $this->assertEquals($wishlistItem->getData('qty'), $wishlistResponse['items_v2']['items'][0]['quantity']); + $this->assertEquals($wishlistItem->getDescription(), $wishlistResponse['items_v2']['items'][0]['description']); + $this->assertEquals($wishlistItem->getAddedAt(), $wishlistResponse['items_v2']['items'][0]['added_at']); + $this->assertNotEmpty($wishlistResponse['items_v2']['items'][0]['links_v2']); + $wishlistItemLinks = $wishlistResponse['items_v2']['items'][0]['links_v2']; $this->assertEquals('Downloadable Product Link 1', $wishlistItemLinks[0]['title']); - $this->assertNotEmpty($wishlistResponse['items_v2'][0]['samples']); - $wishlistItemSamples = $wishlistResponse['items_v2'][0]['samples']; + $this->assertNotEmpty($wishlistResponse['items_v2']['items'][0]['samples']); + $wishlistItemSamples = $wishlistResponse['items_v2']['items'][0]['samples']; $this->assertEquals('Downloadable Product Sample', $wishlistItemSamples[0]['title']); } @@ -196,8 +197,10 @@ private function getQuery( sharing_code items_count updated_at - items_v2 { - id + items_v2(currentPage:1 pageSize:1) { + items + { + id description quantity added_at @@ -213,6 +216,7 @@ private function getQuery( sample_url } } + } } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php index e452e70c24148..6ce4388877825 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php @@ -64,7 +64,7 @@ public function testCustomerWishlist(): void $this->assertEquals($wishlistItem->getItemsCount(), $wishlist['items_count']); $this->assertEquals($wishlistItem->getSharingCode(), $wishlist['sharing_code']); $this->assertEquals($wishlistItem->getUpdatedAt(), $wishlist['updated_at']); - $wishlistItemResponse = $wishlist['items_v2'][0]; + $wishlistItemResponse = $wishlist['items_v2']['items'][0]; $this->assertEquals('simple', $wishlistItemResponse['product']['sku']); } @@ -113,8 +113,7 @@ private function getQuery(): string sharing_code updated_at items_v2 { - product { - sku + items {product {name sku} } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php index 691c06782070f..51ea9b461edaa 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php @@ -42,19 +42,21 @@ public function testUpdateSimpleProductFromWishlist(): void $wishlist = $this->getWishlist(); $qty = 5; $description = 'New Description'; - $wishlistId = $wishlist['customer']['wishlist']['id']; - $wishlistItem = $wishlist['customer']['wishlist']['items_v2'][0]; + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; $this->assertNotEquals($description, $wishlistItem['description']); $this->assertNotEquals($qty, $wishlistItem['quantity']); - $query = $this->getQuery((int) $wishlistId, (int) $wishlistItem['id'], $qty, $description); + $query = $this->getQuery($wishlistId, $wishlistItem['id'], $qty, $description); $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); $this->assertArrayHasKey('updateProductsInWishlist', $response); $this->assertArrayHasKey('wishlist', $response['updateProductsInWishlist']); + $this->assertEmpty($response['updateProductsInWishlist']['user_errors']); $wishlistResponse = $response['updateProductsInWishlist']['wishlist']; - $this->assertEquals($qty, $wishlistResponse['items_v2'][0]['quantity']); - $this->assertEquals($description, $wishlistResponse['items_v2'][0]['description']); + $this->assertEquals($qty, $wishlistResponse['items_v2']['items'][0]['quantity']); + $this->assertEquals($description, $wishlistResponse['items_v2']['items'][0]['description']); } /** @@ -67,12 +69,13 @@ public function testUpdateSimpleProductFromWishlist(): void public function testUnauthorizedWishlistItemUpdate() { $wishlist = $this->getWishlist(); - $wishlistItem = $wishlist['customer']['wishlist']['items_v2'][0]; + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; $wishlist2 = $this->getWishlist('customer_two@example.com'); - $wishlist2Id = $wishlist2['customer']['wishlist']['id']; + $wishlist2Id = $wishlist2['customer']['wishlists'][0]['id']; $qty = 2; $description = 'New Description'; - $updateWishlistQuery = $this->getQuery((int) $wishlist2Id, (int) $wishlistItem['id'], $qty, $description); + $updateWishlistQuery = $this->getQuery($wishlist2Id, $wishlistItem['id'], $qty, $description); $response = $this->graphQlMutation( $updateWishlistQuery, [], @@ -82,8 +85,9 @@ public function testUnauthorizedWishlistItemUpdate() self::assertEquals(1, $response['updateProductsInWishlist']['wishlist']['items_count']); self::assertNotEmpty($response['updateProductsInWishlist']['wishlist']['items_v2'], 'empty wish list items'); self::assertCount(1, $response['updateProductsInWishlist']['wishlist']['items_v2']); + self::assertNotEmpty($response['updateProductsInWishlist']['user_errors'], 'No user errors'); self::assertEquals( - 'The wishlist item with ID "'.$wishlistItem['id'].'" does not belong to the wishlist', + 'The wishlist item with ID "' . $wishlistItem['id'] . '" does not belong to the wishlist', $response['updateProductsInWishlist']['user_errors'][0]['message'] ); } @@ -98,11 +102,12 @@ public function testUnauthorizedWishlistItemUpdate() public function testUpdateProductInWishlistWithZeroQty() { $wishlist = $this->getWishlist(); - $wishlistId = $wishlist['customer']['wishlist']['id']; - $wishlistItem = $wishlist['customer']['wishlist']['items_v2'][0]; + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; $qty = 0; $description = 'Description for zero quantity'; - $updateWishlistQuery = $this->getQuery((int) $wishlistId, (int) $wishlistItem['id'], $qty, $description); + $updateWishlistQuery = $this->getQuery($wishlistId, $wishlistItem['id'], $qty, $description); $response = $this->graphQlMutation($updateWishlistQuery, [], '', $this->getHeaderMap()); self::assertEquals(1, $response['updateProductsInWishlist']['wishlist']['items_count']); self::assertNotEmpty($response['updateProductsInWishlist']['wishlist']['items_v2'], 'empty wish list items'); @@ -126,16 +131,17 @@ public function testUpdateProductInWishlistWithZeroQty() public function testUpdateProductWithValidQtyAndNoDescription() { $wishlist = $this->getWishlist(); - $wishlistId = $wishlist['customer']['wishlist']['id']; - $wishlistItem = $wishlist['customer']['wishlist']['items_v2'][0]; + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; $qty = 2; - $updateWishlistQuery = $this->getQueryWithNoDescription((int) $wishlistId, (int) $wishlistItem['id'], $qty); + $updateWishlistQuery = $this->getQueryWithNoDescription($wishlistId, $wishlistItem['id'], $qty); $response = $this->graphQlMutation($updateWishlistQuery, [], '', $this->getHeaderMap()); self::assertEquals(1, $response['updateProductsInWishlist']['wishlist']['items_count']); - self::assertNotEmpty($response['updateProductsInWishlist']['wishlist']['items'], 'empty wish list items'); - self::assertCount(1, $response['updateProductsInWishlist']['wishlist']['items']); - $itemsInWishlist = $response['updateProductsInWishlist']['wishlist']['items'][0]; - self::assertEquals($qty, $itemsInWishlist['qty']); + self::assertNotEmpty($response['updateProductsInWishlist']['wishlist']['items_v2'], 'empty wish list items'); + self::assertCount(1, $response['updateProductsInWishlist']['wishlist']['items_v2']['items']); + $itemsInWishlist = $response['updateProductsInWishlist']['wishlist']['items_v2']['items'][0]; + self::assertEquals($qty, $itemsInWishlist['quantity']); self::assertEquals('simple-1', $itemsInWishlist['product']['sku']); } @@ -167,15 +173,15 @@ private function getHeaderMap(string $username = 'customer@example.com', string * @return string */ private function getQuery( - int $wishlistId, - int $wishlistItemId, + string $wishlistId, + string $wishlistItemId, int $qty, string $description ): string { return <<<MUTATION mutation { updateProductsInWishlist( - wishlistId: {$wishlistId}, + wishlistId: "{$wishlistId}", wishlistItems: [ { wishlist_item_id: "{$wishlistItemId}" @@ -193,9 +199,11 @@ private function getQuery( sharing_code items_count items_v2 { - id + items{ + id description quantity + } } } } @@ -213,14 +221,14 @@ private function getQuery( * @return string */ private function getQueryWithNoDescription( - int $wishlistId, - int $wishlistItemId, + string $wishlistId, + string $wishlistItemId, int $qty ): string { return <<<MUTATION mutation { updateProductsInWishlist( - wishlistId: {$wishlistId}, + wishlistId: "{$wishlistId}", wishlistItems: [ { wishlist_item_id: "{$wishlistItemId}" @@ -237,10 +245,12 @@ private function getQueryWithNoDescription( id sharing_code items_count - items { - id - qty - product{sku name} + items_v2 { + items{ + id + quantity + product {sku name} + } } } } @@ -271,13 +281,20 @@ private function getCustomerWishlistQuery(): string return <<<QUERY query { customer { - wishlist { + wishlists { id items_count + sharing_code + updated_at items_v2 { + items { id quantity description + product { + sku + } + } } } } From 9ec148ca4397a46a099196196fe08db4072937f0 Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Mon, 30 Nov 2020 17:57:05 -0600 Subject: [PATCH 361/490] MC-39071: Implement Multiple Wishlist additions and patch back minor updates - Added schema descriptions --- app/code/Magento/WishlistGraphQl/etc/schema.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index 1a8730bba5fcc..dd80f54592780 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -44,8 +44,8 @@ interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\ } type WishlistItems { - items: [WishlistItemInterface]! @doc(description: "Wishlist items list") - page_info: SearchResultPageInfo + items: [WishlistItemInterface]! @doc(description: "A list of items in the wish list") + page_info: SearchResultPageInfo @doc(description: "Contains pagination metadata") } type WishlistItem { From 0cdceec2ddb16b0763fd89fcb4f9ac4d9f159e51 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Mon, 30 Nov 2020 23:09:59 -0600 Subject: [PATCH 362/490] MC-38340: GraphQL code changes for a consistent object uid - change bundle --- .../Model/Cart/BundleOptionDataProvider.php | 25 +++++++++++++-- .../Model/Resolver/Links/Collection.php | 16 ++++++++-- .../Resolver/Options/BundleItemOptionUid.php | 15 +++++++-- .../Model/Resolver/Options/Collection.php | 21 ++++++++++-- .../Resolver/Order/Item/BundleOptions.php | 32 +++++++++++++++++-- .../Magento/BundleGraphQl/etc/schema.graphqls | 19 +++++++---- .../Attributes/ConfigurableAttributeUid.php | 15 +++++++-- ...dBundleProductToCartSingleMutationTest.php | 12 ++++++- .../Bundle/AddBundleProductToCartTest.php | 3 ++ 9 files changed, 136 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/Model/Cart/BundleOptionDataProvider.php b/app/code/Magento/BundleGraphQl/Model/Cart/BundleOptionDataProvider.php index 5cdfdc88e7dc1..fdd69cc268f97 100644 --- a/app/code/Magento/BundleGraphQl/Model/Cart/BundleOptionDataProvider.php +++ b/app/code/Magento/BundleGraphQl/Model/Cart/BundleOptionDataProvider.php @@ -9,6 +9,8 @@ use Magento\Bundle\Helper\Catalog\Product\Configuration; use Magento\Catalog\Model\Product; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Quote\Model\Quote\Item; use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\Serialize\SerializerInterface; @@ -18,6 +20,11 @@ */ class BundleOptionDataProvider { + /** + * Option type name + */ + private const OPTION_TYPE = 'bundle'; + /** * @var Data */ @@ -33,19 +40,26 @@ class BundleOptionDataProvider */ private $configuration; + /** @var Uid */ + private $uidEncoder; + /** * @param Data $pricingHelper * @param SerializerInterface $serializer * @param Configuration $configuration + * @param Uid|null $uidEncoder */ public function __construct( Data $pricingHelper, SerializerInterface $serializer, - Configuration $configuration + Configuration $configuration, + Uid $uidEncoder = null ) { $this->pricingHelper = $pricingHelper; $this->serializer = $serializer; $this->configuration = $configuration; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -103,6 +117,7 @@ private function buildBundleOptions(array $bundleOptions, Item $item): array $options[] = [ 'id' => $bundleOption->getId(), + 'uid' => $this->uidEncoder->encode(self::OPTION_TYPE . '/' . $bundleOption->getId()), 'label' => $bundleOption->getTitle(), 'type' => $bundleOption->getType(), 'values' => $this->buildBundleOptionValues($bundleOption->getSelections(), $item), @@ -131,9 +146,15 @@ private function buildBundleOptionValues(array $selections, Item $item): array } $selectionPrice = $this->configuration->getSelectionFinalPrice($item, $selection); - + $optionDetails = [ + self::OPTION_TYPE, + $selection->getData('option_id'), + $selection->getData('selection_id'), + (int) $selection->getData('selection_qty') + ]; $values[] = [ 'id' => $selection->getSelectionId(), + 'uid' => $this->uidEncoder->encode(implode('/', $optionDetails)), 'label' => $selection->getName(), 'quantity' => $qty, 'price' => $this->pricingHelper->currency($selectionPrice, false, false), diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php index 8025cf91d28c9..0f8cdc27d2417 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php @@ -10,7 +10,9 @@ use Magento\Bundle\Model\Selection; use Magento\Bundle\Model\ResourceModel\Selection\CollectionFactory; use Magento\Bundle\Model\ResourceModel\Selection\Collection as LinkCollection; +use Magento\Framework\App\ObjectManager; use Magento\Framework\GraphQl\Query\EnumLookup; +use Magento\Framework\GraphQl\Query\Uid; /** * Collection to fetch link data at resolution time. @@ -42,14 +44,23 @@ class Collection */ private $links = []; + /** @var Uid */ + private $uidEncoder; + /** * @param CollectionFactory $linkCollectionFactory * @param EnumLookup $enumLookup + * @param Uid|null $uidEncoder */ - public function __construct(CollectionFactory $linkCollectionFactory, EnumLookup $enumLookup) - { + public function __construct( + CollectionFactory $linkCollectionFactory, + EnumLookup $enumLookup, + Uid $uidEncoder = null + ) { $this->linkCollectionFactory = $linkCollectionFactory; $this->enumLookup = $enumLookup; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -117,6 +128,7 @@ private function fetch() : array 'price' => $link->getSelectionPriceValue(), 'position' => $link->getPosition(), 'id' => $link->getSelectionId(), + 'uid' => $this->uidEncoder->encode((string) $link->getSelectionId()), 'qty' => (float)$link->getSelectionQty(), 'quantity' => (float)$link->getSelectionQty(), 'is_default' => (bool)$link->getIsDefault(), diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/BundleItemOptionUid.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/BundleItemOptionUid.php index ce5c12ce69675..c08d69a887089 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/BundleItemOptionUid.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/BundleItemOptionUid.php @@ -11,6 +11,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** @@ -23,6 +24,17 @@ class BundleItemOptionUid implements ResolverInterface */ private const OPTION_TYPE = 'bundle'; + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + /** * Create a option uid for entered option in "<option-type>/<option-id>/<option-value-id>/<quantity>" format * @@ -62,7 +74,6 @@ public function resolve( $content = implode('/', $optionDetails); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - return base64_encode($content); + return $this->uidEncoder->encode($content); } } diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php index c8e2384fcb99c..fe1b47bc635b6 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php @@ -5,11 +5,12 @@ */ declare(strict_types=1); - namespace Magento\BundleGraphQl\Model\Resolver\Options; use Magento\Bundle\Model\OptionFactory; use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Store\Model\StoreManagerInterface; /** @@ -17,6 +18,11 @@ */ class Collection { + /** + * Option type name + */ + private const OPTION_TYPE = 'bundle'; + /** * @var OptionFactory */ @@ -42,19 +48,26 @@ class Collection */ private $optionMap = []; + /** @var Uid */ + private $uidEncoder; + /** * @param OptionFactory $bundleOptionFactory * @param JoinProcessorInterface $extensionAttributesJoinProcessor * @param StoreManagerInterface $storeManager + * @param Uid|null $uidEncoder */ public function __construct( OptionFactory $bundleOptionFactory, JoinProcessorInterface $extensionAttributesJoinProcessor, - StoreManagerInterface $storeManager + StoreManagerInterface $storeManager, + Uid $uidEncoder = null ) { $this->bundleOptionFactory = $bundleOptionFactory; $this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor; $this->storeManager = $storeManager; + $this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance() + ->get(Uid::class); } /** @@ -101,7 +114,7 @@ private function fetch() : array $linkField = $optionsCollection->getConnection()->getAutoIncrementField($productTable); $optionsCollection->getSelect()->join( ['cpe' => $productTable], - 'cpe.'.$linkField.' = main_table.parent_id', + 'cpe.' . $linkField . ' = main_table.parent_id', [] )->where( "cpe.entity_id IN (?)", @@ -124,6 +137,8 @@ private function fetch() : array = $option->getTitle() === null ? $option->getDefaultTitle() : $option->getTitle(); $this->optionMap[$option->getParentId()][$option->getId()]['sku'] = $this->skuMap[$option->getParentId()]['sku']; + $this->optionMap[$option->getParentId()][$option->getId()]['uid'] + = $this->uidEncoder->encode(self::OPTION_TYPE . '/' . $option->getOptionId()); } return $this->optionMap; diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Order/Item/BundleOptions.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Order/Item/BundleOptions.php index a21bbbb84d735..9bbe69c95f552 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Order/Item/BundleOptions.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Order/Item/BundleOptions.php @@ -11,6 +11,7 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\Serialize\Serializer\Json; use Magento\Sales\Api\Data\InvoiceItemInterface; @@ -23,6 +24,11 @@ */ class BundleOptions implements ResolverInterface { + /** + * Option type name + */ + private const OPTION_TYPE = 'bundle'; + /** * Serializer * @@ -35,16 +41,22 @@ class BundleOptions implements ResolverInterface */ private $valueFactory; + /** @var Uid */ + private $uidEncoder; + /** * @param ValueFactory $valueFactory * @param Json $serializer + * @param Uid $uidEncoder */ public function __construct( ValueFactory $valueFactory, - Json $serializer + Json $serializer, + Uid $uidEncoder ) { $this->valueFactory = $valueFactory; $this->serializer = $serializer; + $this->uidEncoder = $uidEncoder; } /** @@ -89,7 +101,9 @@ private function getBundleOptions( foreach ($options['bundle_options'] ?? [] as $bundleOptionId => $bundleOption) { $bundleOptions[$bundleOptionId]['label'] = $bundleOption['label'] ?? ''; $bundleOptions[$bundleOptionId]['id'] = isset($bundleOption['option_id']) ? - base64_encode($bundleOption['option_id']) : null; + $this->uidEncoder->encode((string) $bundleOption['option_id']) : null; + $bundleOptions[$bundleOptionId]['uid'] = isset($bundleOption['option_id']) ? + $this->uidEncoder->encode(self::OPTION_TYPE . '/' . $bundleOption['option_id']) : null; if (isset($bundleOption['option_id'])) { $bundleOptions[$bundleOptionId]['values'] = $this->formatBundleOptionItems( $item, @@ -127,8 +141,20 @@ private function formatBundleOptionItems( // Value Id is missing from parent, so we have to match the child to parent option if (isset($bundleChildAttributes['option_id']) && $bundleChildAttributes['option_id'] == $bundleOptionId) { + + $options = $childOrderItemOptions['info_buyRequest'] + ['bundle_option'][$bundleChildAttributes['option_id']]; + + $optionDetails = [ + self::OPTION_TYPE, + $bundleChildAttributes['option_id'], + implode(',', $options), + (int) $childOrderItemOptions['info_buyRequest']['qty'] + ]; + $optionItems[$childrenOrderItem->getItemId()] = [ - 'id' => base64_encode($childrenOrderItem->getItemId()), + 'id' => $this->uidEncoder->encode((string) $childrenOrderItem->getItemId()), + 'uid' => $this->uidEncoder->encode(implode('/', $optionDetails)), 'product_name' => $childrenOrderItem->getName(), 'product_sku' => $childrenOrderItem->getSku(), 'quantity' => $bundleChildAttributes['qty'], diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index a2cba24c7c4d4..58d9dffdda5bc 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -32,21 +32,24 @@ type BundleCartItem implements CartItemInterface { } type SelectedBundleOption { - id: Int! + id: Int! @deprecated(reason: "Use `uid` instead") + uid: ID! @doc(description: "The unique identifier of the selected bundle option.") label: String! type: String! values: [SelectedBundleOptionValue!]! } type SelectedBundleOptionValue { - id: Int! + id: Int! @doc(description: "Use `uid` instead") + uid: ID! @doc(description: "The unique identifier of the selected bundle option value.") label: String! quantity: Float! price: Float! } type BundleItem @doc(description: "BundleItem defines an individual item in a bundle product.") { - option_id: Int @doc(description: "An ID assigned to each type of item in a bundle product.") + option_id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "An ID assigned to each type of item in a bundle product.") + uid: ID @doc(description: "The unique identifier of the bundle item product.") title: String @doc(description: "The display name of the item.") required: Boolean @doc(description: "Indicates whether the item must be included in the bundle.") type: String @doc(description: "The input type that the customer uses to select the item. Examples include radio button and checkbox.") @@ -56,7 +59,7 @@ type BundleItem @doc(description: "BundleItem defines an individual item in a bu } type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") { - id: Int @doc(description: "The ID assigned to the bundled item option.") + id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "The ID assigned to the bundled item option.") label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label") qty: Float @deprecated(reason: "The `qty` is deprecated. Use `quantity` instead.") @doc(description: "Indicates the quantity of this specific bundle item.") quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.") @@ -66,7 +69,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.") can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.") product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") # A Base64 string that encodes option details. + uid: ID! @doc(description: "The unique identifier of the bundle item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") } type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") { @@ -105,13 +108,15 @@ type BundleCreditMemoItem implements CreditMemoItemInterface { } type ItemSelectedBundleOption @doc(description: "A list of options of the selected bundle product") { - id: ID! @doc(description: "The unique identifier of the option") + id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique identifier of the option") + uid: ID! @doc(description: "The unique identifier of the selected bundle option item") label: String! @doc(description: "The label of the option") values: [ItemSelectedBundleOptionValue] @doc(description: "A list of products that represent the values of the parent option") } type ItemSelectedBundleOptionValue @doc(description: "A list of values for the selected bundle product") { - id: ID! @doc(description: "The unique identifier of the value") + id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique identifier of the value") + uid: ID! @doc(description: "The unique identifier of the selected bundle item option value") product_name: String! @doc(description: "The name of the child bundle product") product_sku: String! @doc(description: "The SKU of the child bundle product") quantity: Float! @doc(description: "Indicates how many of this bundle product were ordered") diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes/ConfigurableAttributeUid.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes/ConfigurableAttributeUid.php index 13f31e7e2ce10..31cbe58d670b6 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes/ConfigurableAttributeUid.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes/ConfigurableAttributeUid.php @@ -11,6 +11,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** @@ -23,6 +24,17 @@ class ConfigurableAttributeUid implements ResolverInterface */ private const OPTION_TYPE = 'configurable'; + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + /** * Create a option uid for super attribute in "<option-type>/<attribute-id>/<value-index>" format * @@ -61,7 +73,6 @@ public function resolve( $content = implode('/', $optionDetails); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - return base64_encode($content); + return $this->uidEncoder->encode($content); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php index fc0fdcf71525f..b2cc2e901efef 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php @@ -97,6 +97,7 @@ public function testAddBundleProductToCart() cart { items { id + uid quantity product { sku @@ -104,10 +105,12 @@ public function testAddBundleProductToCart() ... on BundleCartItem { bundle_options { id + uid label type values { id + uid label price quantity @@ -189,6 +192,7 @@ public function testAddBundleToCartWithWrongBundleOptions() cart { items { id + uid quantity product { sku @@ -196,10 +200,12 @@ public function testAddBundleToCartWithWrongBundleOptions() ... on BundleCartItem { bundle_options { id + uid label type values { id + uid label price quantity @@ -268,6 +274,7 @@ private function getProductQuery(string $sku): string items { sku option_id + option_uid required type title @@ -279,8 +286,8 @@ private function getProductQuery(string $sku): string } can_change_quantity id + uid price - quantity } } @@ -322,6 +329,7 @@ private function getMutationsQuery( cart { items { id + uid quantity product { sku @@ -329,10 +337,12 @@ private function getMutationsQuery( ... on BundleCartItem { bundle_options { id + uid label type values { id + uid label price quantity diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php index f705195050843..2c6d3af69bf40 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php @@ -104,6 +104,7 @@ public function testAddBundleProductToCart() cart { items { id + uid quantity product { sku @@ -111,10 +112,12 @@ public function testAddBundleProductToCart() ... on BundleCartItem { bundle_options { id + uid label type values { id + uid label price quantity From a44a1b3f46c09d92a6b8e78481894e2b3cc92837 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 1 Dec 2020 11:05:08 +0200 Subject: [PATCH 363/490] MC-39501: [MFTF] Flaky AdminAddImageToWYSIWYGProductTest because of bad design --- .../Test/Mftf/Data/WYSIWYGConfigData.xml | 2 +- .../Test/AdminAddImageToWYSIWYGCatalogTest.xml | 2 +- .../Test/AdminAddImageToWYSIWYGProductTest.xml | 13 ++++++++----- ...AdminEditTextEditorProductAttributeTest.xml | 2 +- ...erifyDefaultWYSIWYGToolbarOnProductTest.xml | 2 +- ...ltcontrolsonproductshortdescriptionTest.xml | 2 +- ...fyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml | 2 +- ...fyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml | 2 +- .../CliEnableTinyMCE4ActionGroup.xml | 18 ++++++++++++++++++ .../Test/AdminAddImageToWYSIWYGBlockTest.xml | 2 +- .../Test/AdminAddImageToWYSIWYGCMSTest.xml | 4 ++-- .../AdminAddVariableToWYSIWYGBlockTest.xml | 2 +- .../Test/AdminAddVariableToWYSIWYGCMSTest.xml | 2 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 2 +- ...dWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 2 +- ...dgetToWYSIWYGWithCMSStaticBlockTypeTest.xml | 2 +- ...oWYSIWYGWithCatalogCategoryLinkTypeTest.xml | 2 +- ...ToWYSIWYGWithCatalogProductLinkTypeTest.xml | 2 +- ...ToWYSIWYGWithCatalogProductListTypeTest.xml | 2 +- ...WYGWithRecentlyComparedProductsTypeTest.xml | 2 +- ...SIWYGWithRecentlyViewedProductsTypeTest.xml | 2 +- ...scapeAndEnterHandlesForWYSIWYGBlockTest.xml | 2 +- .../CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 2 +- ...rifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml | 2 +- ...fyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml | 2 +- .../Mftf/ActionGroup/SwitcherActionGroup.xml | 4 ++-- .../AdminAddImageToWYSIWYGNewsletterTest.xml | 2 +- ...AdminAddVariableToWYSIWYGNewsletterTest.xml | 2 +- .../AdminAddWidgetToWYSIWYGNewsletterTest.xml | 2 +- ...inyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml | 2 +- .../Test/AdminSwitchWYSIWYGOptionsTest.xml | 2 +- 31 files changed, 57 insertions(+), 36 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCE4ActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml index 7bb8cf5f4db37..3965cfa1f958b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> - +<!--TODO: This datasets should be moved to CMS module--> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="EnableWYSIWYG"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index bcdf6ad39124a..029c304873ce2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -11,7 +11,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <annotations> <features value="Catalog"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index acc22f2e611d6..5ea7253619ed9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -10,18 +10,20 @@ <test name="AdminAddImageToWYSIWYGProductTest"> <annotations> <features value="Catalog"/> - <stories value="MAGETWO-42041-Default WYSIWYG toolbar configuration with Magento Media Gallery"/> - <group value="Catalog"/> + <stories value="Default WYSIWYG toolbar configuration with Magento Media Gallery"/> <title value="Admin should be able to add image to WYSIWYG Editor on Product Page"/> <description value="Admin should be able to add image to WYSIWYG Editor on Product Page"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-84375"/> + <testCaseId value="MC-25763"/> + <group value="catalog"/> </annotations> + <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> + <after> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> @@ -32,8 +34,9 @@ <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillBasicProductInfo" /> <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" /> - <scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDescription" /> + <scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDescription"/> <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" /> + <scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDescriptionAgain"/> <click selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageIcon}}" stepKey="clickInsertImageIcon1" /> <click selector="{{ProductDescriptionWYSIWYGToolbarSection.Browse}}" stepKey="clickBrowse1" /> <waitForLoadingMaskToDisappear stepKey="waitForBrowseModal" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index b437d5fb0c868..283ed72e62faa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> <createData stepKey="myProductAttributeCreation" entity="productAttributeWysiwyg"/> <createData stepKey="myProductAttributeSetAssign" entity="AddToDefaultSet"> <requiredEntity createDataKey="myProductAttributeCreation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml index 456abecc63ccb..662a251be3b20 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> <waitForPageLoad stepKey="wait"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml index e929cbd752f81..d4bc095dbe9b1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> <waitForPageLoad stepKey="wait"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml index d7e4f97ed0bc2..ee6ff0c224545 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToNewCatalog"/> <waitForLoadingMaskToDisappear stepKey="wait2" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml index cffc4af6fcbbd..f75053f495c4d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> <waitForPageLoad stepKey="wait1"/> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCE4ActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCE4ActionGroup.xml new file mode 100644 index 0000000000000..9e49762f3de20 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCE4ActionGroup.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="CliEnableTinyMCE4ActionGroup"> + <annotations> + <description>Enable Tiny MCE 4 by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{EnableTinyMCE4.path}} {{EnableTinyMCE4.value}}" stepKey="enableTinyMCE4"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index c0424e09f8f76..e2111aac348cb 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -22,7 +22,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="AssignBlockToCMSPage" stepKey="assignBlockToCMSPage"> <argument name="Block" value="$$createPreReqBlock$$"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 4f67b81446ae7..39f44a3270944 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <after> <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> @@ -33,7 +33,7 @@ <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 32bd75d373115..963844710dd7f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -22,7 +22,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 698f29a28598f..7f3d2537a9b0d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -19,7 +19,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index 887fe88533f74..9e28e81c2696d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -22,7 +22,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index 509e1abe81ef6..a599d22eab298 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index cfb323683dc2c..1c9d7b38a40a4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -22,7 +22,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index d9ea67491e30a..4f78f6bcce5e0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> <actionGroup ref="ConfigAdminAccountSharingActionGroup" stepKey="allowAdminShareAccount"/> </before> <!--Main test--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 86f90e0e2a580..4ee5b0d263d40 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -25,7 +25,7 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index dcb4c3dc11f3c..6c36913cbb593 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -27,7 +27,7 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 6acf8ef18a332..440f63403c519 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -26,7 +26,7 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 1ec4f7054e8c2..226292e6cdea4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -25,7 +25,7 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml index c1d5f39d2a005..c5ab9d13b848a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml @@ -23,7 +23,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index 484dc16faa3b9..c0e6a9cbd793d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -22,7 +22,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="enableTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="enableTinyMCE4"/> <waitForPageLoad stepKey="waitConfigToSave"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> <createData entity="ApiSimpleProduct" stepKey="product1"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index 58f3b9d5bd3b1..03e3097dbd720 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -22,7 +22,7 @@ <createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" /> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml index 43615ac906b00..82e725de46249 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> <waitForPageLoad stepKey="waitForPageLoad1"/> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml index f4f97b14682f3..c6b2605c73d8c 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml @@ -10,9 +10,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="SwitchToVersion4ActionGroup"> <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets the 'WYSIWYG Editor' to 'TinyMCE 4'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + <description>DEPRECATED. Use CliEnableTinyMCE4 instead. Goes to the 'Configuration' page for 'Content Management'. Sets the 'WYSIWYG Editor' to 'TinyMCE 4'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> </annotations> - + <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> <waitForPageLoad stepKey="waitForConfigPageToLoad"/> <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index e255f14a83661..a6cb2456c583f 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create a newsletter template that contains an image--> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml index ff2e2a84a612e..d4bb8d358e21d 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 73880f283677d..0fa16d275d6f4 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> <waitForElementVisible selector="{{BasicFieldNewsletterSection.templateName}}" stepKey="waitForTemplateName"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml index 3a247402c111d..7cfd4c67369c8 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml @@ -20,7 +20,7 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml index 0ba20d201f909..0bfdc0eed289c 100644 --- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml +++ b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml @@ -77,7 +77,7 @@ <waitForPageLoad stepKey="wait6" /> <!--see widget on Storefront--> <see userInput="Hello TinyMCE3!" stepKey="seeContent2"/> - <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> <after> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> From 14b9169b13e1a033a2d185ff2c47ceeefc8bef48 Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Tue, 1 Dec 2020 10:06:51 +0100 Subject: [PATCH 364/490] fix unit test --- .../Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php index 0f3d8be212e30..090a74afca050 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php @@ -82,7 +82,7 @@ public function testModifyPrice() $connectionMock->expects($this->once())->method('select')->willReturn($selectMock); $selectMock->expects($this->at(2)) ->method('where') - ->with('stock_item.product_id in (?)', $entityIds) + ->with('stock_item.product_id IN (?)', $entityIds) ->willReturn($selectMock); $this->generator->expects($this->once()) ->method('generate') From 9847f03d47e5027c7f27c4e5c800896a5b199582 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 11:47:05 +0200 Subject: [PATCH 365/490] init --- .../Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 14 +++++ .../Test/Mftf/Test/AdminCreateInvoice.xml | 53 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml new file mode 100644 index 0000000000000..30355882b20df --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -0,0 +1,14 @@ +<?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="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/29/invoices" method="POST"> + <contentType>application/json</contentType> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml new file mode 100644 index 0000000000000..74912e1037436 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -0,0 +1,53 @@ +<?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="AdminCreateInvoice"> + <annotations> + <features value="Sales"/> + <stories value="1Create an Invoice via the Admin"/> + <title value="1111Admin should be able to create an invoice"/> + <description value="1Admin should be able to create an invoice"/> + <severity value="MAJOR"/> + <testCaseId value="1MAGETWO-72096"/> + <group value="sales"/> + </annotations> + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="SimpleCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrder"/> + + + </before> + <after> + <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + </test> +</tests> From e3ff240f0b1991a2ca8f9cdaa31ee4e9cda95211 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Tue, 1 Dec 2020 11:48:49 +0200 Subject: [PATCH 366/490] MC-36383: [B2B] A Product with Customizable Option (File) can not be added from a Requisition List to the Shopping Cart --- .../_files/customer_quote_with_items_simple_product_options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/customer_quote_with_items_simple_product_options.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/customer_quote_with_items_simple_product_options.php index f0ba56f7179aa..4c003c209e3c2 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/customer_quote_with_items_simple_product_options.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/customer_quote_with_items_simple_product_options.php @@ -67,7 +67,7 @@ $iDate++; break; case ProductCustomOptionInterface::OPTION_GROUP_FILE: - $value = 'test.jpg'; + $value = null; break; default: $value = 'test'; From 901daf6771ca2179c886f25c80604f4105da0f83 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 1 Dec 2020 12:10:02 +0200 Subject: [PATCH 367/490] remove preventDefault() --- .../Framework/View/Helper/SecureHtmlRenderer.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d926e85ae4f8f..052c51441d451 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -8,7 +8,6 @@ namespace Magento\Framework\View\Helper; -use Magento\Framework\Api\SimpleDataObjectConverter; use Magento\Framework\Math\Random; use Magento\Framework\View\Helper\SecureHtmlRender\EventHandlerData; use Magento\Framework\View\Helper\SecureHtmlRender\HtmlRenderer; @@ -105,27 +104,26 @@ public function renderEventListenerAsTag( } $random = $this->random->getRandomString(10); - $listenerFunction = 'eventListener' .$random; - $elementName = 'listenedElement' .$random; + $listenerFunction = 'eventListener' . $random; + $elementName = 'listenedElement' . $random; $script = <<<script function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); if({$elementName}Array.length !== 'undefined'){ - {$elementName}Array.forEach(function(element){ + {$elementName}Array.forEach(function(element) { if (element) { element.{$eventName} = function (event) { - event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; } {$listenerFunction}.apply(targetElement); - } + }; } }); - } + } script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); @@ -145,7 +143,7 @@ public function renderStyleAsTag(string $style, string $selector): string throw new \InvalidArgumentException('Invalid style data given'); } - $elementVariable = 'elem' .$this->random->getRandomString(8); + $elementVariable = 'elem' . $this->random->getRandomString(8); /** @var string[] $styles */ $stylesAssignments = ''; foreach ($stylePairs as $stylePair) { @@ -167,7 +165,7 @@ public function renderStyleAsTag(string $style, string $selector): string 'script', ['type' => 'text/javascript'], "var $elementVariable = document.querySelector('$selector');\n" - ."if ($elementVariable) {\n{$stylesAssignments}}", + . "if ($elementVariable) {\n{$stylesAssignments}}", false ); } From c7e78cd3cd4bd9a5136924cc8bf6a9425453de4a Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 1 Dec 2020 12:40:21 +0200 Subject: [PATCH 368/490] MC-39505: [MFTF] Flaky AdminMarketingNewsletterTemplateUpdateTest because of bad design --- .../Test/AdminMarketingNewsletterTemplateUpdateTest.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateUpdateTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateUpdateTest.xml index 1a0c90ff13c36..1d8565d7b2b78 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateUpdateTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateUpdateTest.xml @@ -15,6 +15,9 @@ <title value="Newsletter Updating Test"/> <description value="Admin should be able update created Newsletter Template"/> <severity value="MAJOR"/> + <testCaseId value="MC-39506"/> + <useCaseId value="MAGETWO-69597"/> + <group value="newsletter"/> <group value="reports"/> <group value="mtf_migrated"/> <group value="WYSIWYGDisabled"/> @@ -40,6 +43,7 @@ </actionGroup> <actionGroup ref="AdminMarketingOpenNewsletterTemplateFromGridActionGroup" stepKey="openCreatedNewsletterTemplate"/> </before> + <after> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToNewsletterGridPage"> <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> @@ -74,8 +78,8 @@ <argument name="subject" value="{{updatedNewsletter.subject}}"/> </actionGroup> <actionGroup ref="AdminSearchNewsletterTemplateOnGridActionGroup" stepKey="findUpdatedNewsletterTemplate"> - <argument name="name" value="Updated Newsletter Template"/> - <argument name="subject" value="Updated Newsletter Subject"/> + <argument name="name" value="{{updatedNewsletter.name}}"/> + <argument name="subject" value="{{updatedNewsletter.subject}}"/> </actionGroup> <actionGroup ref="AdminMarketingOpenNewsletterTemplateFromGridActionGroup" stepKey="openTemplate"/> <actionGroup ref="AssertAdminNewsletterTemplateFormActionGroup" stepKey="assertNewsletterForm"> From eeda660e3453709af3631b71935fcf7753afc260 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 1 Dec 2020 12:47:43 +0200 Subject: [PATCH 369/490] merge conflict resolving --- ...reFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 40bdcff6ec937..456bec303dbed 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -18,7 +18,6 @@ <useCaseId value="MAGETWO-96431"/> <group value="Checkout"/> </annotations> - <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"> @@ -61,7 +60,6 @@ </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule"> <argument name="product" value="$$simpleProduct$$"/> <argument name="couponCode" value="{{CatPriceRule.coupon_code}}"/> From e34fc7826d04dcd7e504082d5fa0d7f029343225 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:10:44 +0200 Subject: [PATCH 370/490] ready --- app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 7 ++++++- .../Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml index 30355882b20df..250d657c123ff 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -8,7 +8,12 @@ <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/29/invoices" method="POST"> + <operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/{return}/invoice" method="POST"> <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + <field key="sku" type="string">string</field> + <field key="qty">integer</field> + </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index 74912e1037436..b75be4652c483 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -37,8 +37,9 @@ <requiredEntity createDataKey="createGuestCart"/> </updateData> - <createData entity="Invoice" stepKey="invoiceOrder"/> - + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> </before> <after> From beb0fda08417c7dfec5063a1335639cb356cd9f2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:19:17 +0200 Subject: [PATCH 371/490] refactored --- app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 2 -- app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml index 250d657c123ff..e0bbfa1cd6e5f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -12,8 +12,6 @@ <contentType>application/json</contentType> <object key="cartItem" dataType="CartItem"> <field key="quote_id">string</field> - <field key="sku" type="string">string</field> - <field key="qty">integer</field> </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index b75be4652c483..51aaa251fa3d9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -43,8 +43,8 @@ </before> <after> - <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> From 320748f555d4036d50ed83ebb32a81972aa29579 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:45:26 +0200 Subject: [PATCH 372/490] added Shipment, CreditMemo --- .../Sales/Test/Mftf/Data/CreditMemoData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Data/InvoiceData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Data/ShipmentData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Metadata/CreditMemoMeta.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Metadata/ShipmentMeta.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 10 +++++++++- 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml b/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml new file mode 100644 index 0000000000000..dc6280f7b3444 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.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="CreditMemo" type="CreditMemo"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml b/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml new file mode 100644 index 0000000000000..b55ef96932100 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.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="Invoice" type="Invoice"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml b/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml new file mode 100644 index 0000000000000..96d371d3aaf3a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.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="Shipment" type="Shipment"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml new file mode 100644 index 0000000000000..3b500d61b1c35 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.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="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" 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/ShipmentMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml new file mode 100644 index 0000000000000..1c9de02c6a2e7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.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="CreateShipment" dataType="Shipment" type="create" auth="adminOauth" url="V1/order/{return}/ship" 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/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index 51aaa251fa3d9..3dc1c3ed98d03 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -35,10 +35,18 @@ </createData> <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> <requiredEntity createDataKey="createGuestCart"/> - </updateData> + </updateData> <createData entity="Invoice" stepKey="invoiceOrder"> <requiredEntity createDataKey="createGuestCart"/> + </createData> + + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + + <createData entity="CreditMemo" stepKey="refundMemo"> + <requiredEntity createDataKey="createGuestCart"/> </createData> </before> From 53b85cce1e95a5cfb60db6dc029e551d053e1f14 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 1 Dec 2020 14:00:14 +0200 Subject: [PATCH 373/490] MC-39072: JS error is shown on the checkout --- .../view/frontend/web/template/billing-address/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index e4000e2d120f9..6b3de69d1a21d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@ <div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details"> <text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/> <text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/> - <text args="currentBillingAddress().street"/><br/> + <text args="currentBillingAddress().street.join(', ')"/><br/> <text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/> <text args="getCountryName(currentBillingAddress().countryId)"/><br/> <a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/> From d2ab2f389d64d349dca0ddc3246654c94c806cc3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 14:25:38 +0200 Subject: [PATCH 374/490] AdminCancelTheOrderWithCashOnDeliveryPaymentMethodTest refactoring (in progress) --- .../Quote/Test/Mftf/Data/CustomerCartData.xml | 7 + ...ssOrdersCancelCompleteAndClosedAPITest.xml | 134 ++++++++++++++++++ ...nMassOrdersCancelCompleteAndClosedTest.xml | 7 +- 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index a14be3b533fa8..affebbc07ad61 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,4 +24,11 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> + + <entity name="CustomerOrderPaymentMethod" type="CustomerPaymentInformation"> + <var key="cart_id" entityKey="return" entityType="CustomerCart"/> + <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> + <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> + </entity> + </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml new file mode 100644 index 0000000000000..5ed660b21c6df --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -0,0 +1,134 @@ +<?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="AdminMassOrdersCancelCompleteAndClosedAPITest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass cancel orders in status Complete, Closed"/> + <description value="Try to cancel orders in status Complete, Closed"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16183"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCartOne"/> + <createData entity="SimpleCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + <updateData createDataKey="createGuestCartOne" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + + <createData entity="Shipment" stepKey="shipOrderOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + + + <createData entity="GuestCart" stepKey="createGuestCartTwo"/> + <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createGuestCartTow"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + <updateData createDataKey="createGuestCartTwo" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + + <createData entity="CreditMemo" stepKey="refundOrderTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Create first order --> + <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> + <argument name="product" value="$$createProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"> + <actualResult type="const">$getFirstOrderId</actualResult> + </assertNotEmpty> --> + + <!-- Create Shipment for first Order --> + <!-- <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipmentForFirstOrder"/> --> + + <!-- Create second order --> + <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> + <argument name="product" value="$$createProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> + <assertNotEmpty stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"> + <actualResult type="const">$getSecondOrderId</actualResult> + </assertNotEmpty> --> + + <!-- Create CreditMemo for second Order --> + <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> + + <!-- Navigate to backend: Go to Sales > Orders --> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + + <!-- Select Mass Action according to dataset: Cancel --> + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> + <argument name="action" value="Cancel"/> + <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="secondOrderId" value="$createGuestCartTwo.return$"/> + </actionGroup> + <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> + + <!--Assert first order in orders grid --> + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="orderStatus" value="Complete"/> + </actionGroup> + <see userInput="$createGuestCartOne.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <!--Assert second order in orders grid --> + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="$createGuestCartTwo.return$"/> + <argument name="orderStatus" value="Closed"/> + </actionGroup> + <see userInput="$createGuestCartTwo.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml index b337af3753db3..793e1a07950c9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelCompleteAndClosedTest"> + <test name="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelCompleteAndClosedAPITest instead"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass cancel orders in status Complete, Closed"/> + <title value="DEPRECATED. Mass cancel orders in status Complete, Closed"/> <description value="Try to cancel orders in status Complete, Closed"/> <severity value="MAJOR"/> <testCaseId value="MC-16183"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelCompleteAndClosedAPITest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> From 72574a8e5e6257f52aecb21df4bcd1f3990f31c9 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 1 Dec 2020 14:46:37 +0200 Subject: [PATCH 375/490] "MC-14715: Add bundle dynamic product to the cart" has been updated --- .../StorefrontAddBundleDynamicProductToShoppingCartTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 3c090900563a5..714a06510952f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -94,7 +94,7 @@ <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> - <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertCartSummary" > <argument name="subtotal" value="$100.00"/> <argument name="shipping" value="10.00"/> <argument name="total" value="110.00"/> From f5ed249e645a73309438fae73f237dbc1cc3aef8 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 1 Dec 2020 14:52:16 +0200 Subject: [PATCH 376/490] "MC-14727: Select one multi select option of a bundle product and add to the shopping cart" has been updated --- ...efrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index eff18f9081b67..cd6f4215adb5d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -88,7 +88,7 @@ <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> - <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertCartSummary" > <argument name="subtotal" value="$50.00"/> <argument name="shipping" value="5.00"/> <argument name="total" value="55.00"/> From 328cbaf1e07d902fe806c6d267d1bd1049343126 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Tue, 1 Dec 2020 15:27:44 +0200 Subject: [PATCH 377/490] MC-35717: Admin can not add a Product with a Customizable Option (File) to Order by SKU --- .../Test/Mftf/Section/AdminOrderFormCustomOptionsSection.xml | 2 +- .../Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormCustomOptionsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormCustomOptionsSection.xml index 066aa4181e7ef..49d26d4973874 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormCustomOptionsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormCustomOptionsSection.xml @@ -10,7 +10,7 @@ <section name="AdminOrderFormCustomOptionsSection"> <element name="quantity" type="input" selector="//input[@id='product_composite_configure_input_qty']"/> <element name="file" type="file" selector="//input[@type='file'][contains(@class, 'product-custom-option')]" /> - <element name="buttonOk" type="button" selector="//button[contains(@class, 'action-primary')][@data-role='action']"/> + <element name="buttonOk" type="button" selector="//button[contains(@class, 'action-primary')][@data-role='action']" timeout="30"/> <element name="linkChange" type="text" selector="//div[contains(@class, 'entry-edit')]//a[contains(text(),'Change')]"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index 4437f6e6775f2..fae0bd4589580 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -13,7 +13,7 @@ <element name="configureButtonBySku" type="button" selector="//div[@class='sku-configure-button']//span[contains(text(),'Configure')]"/> <element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]"/> <element name="configureProductQtyField" type="input" selector="//*[@id='super-product-table']/tbody/tr[{{arg}}]/td[5]/input[1]" parameterized="true"/> - <element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']"/> + <element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']" timeout="30"/> <element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/> <element name="configureSelectAttribute" type="select" selector="select[id*=attribute]"/> <element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/> From 71ae5db5ae794f4b79cc991f297b9105a664d664 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Tue, 1 Dec 2020 16:57:41 +0200 Subject: [PATCH 378/490] MC-36779: Product still present in the Wish List after added to order --- .../Magento/Sales/Model/AdminOrder/Create.php | 3 +- .../Adminhtml/Order/Create/LoadBlockTest.php | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 1f23e4480ec1c..d7ddd423733a8 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -970,7 +970,7 @@ public function applySidebarData($data) $item = $this->getCustomerCart()->getItemById($itemId); if ($item) { $this->moveQuoteItem($item, 'order', $qty); - $this->removeItem($itemId, 'cart'); + $data['remove'][$itemId] = 'cart'; } } } @@ -984,6 +984,7 @@ public function applySidebarData($data) ); if ($item->getId()) { $this->addProduct($item->getProduct(), $item->getBuyRequest()->toArray()); + $data['remove'][$itemId] = 'wishlist'; } } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php index b6aa44bac1c4d..104cc74ec1f9b 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php @@ -16,6 +16,7 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Quote\Model\GetQuoteByReservedOrderId; use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\Wishlist\Model\Wishlist; /** * Class checks create order load block controller. @@ -201,6 +202,35 @@ public function testMoveFromOrderToShoppingCart(): void $this->quoteIdsToRemove[] = $customerCart->getId(); } + /** + * Check that Wishlist item is deleted after it has been added to Order. + * + * @return void + * @magentoDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddProductToOrderFromWishList(): void + { + /** @var Wishlist $wishlist */ + $wishlist = $this->_objectManager->create(Wishlist::class); + $wishlistItems = $wishlist->loadByCustomerId(1)->getItemCollection(); + $this->assertCount(1, $wishlistItems); + + $post = $this->hydratePost([ + 'sidebar' => [ + 'add_wishlist_item' => [ + $wishlistItems->getFirstItem()->getId() => 1, + ], + ], + ]); + $params = $this->hydrateParams(); + $this->dispatchWitParams($params, $post); + + $wishlistItems->clear(); + $this->assertEmpty($wishlistItems); + $quoteItems = $this->session->getQuote()->getItemsCollection(); + $this->assertCount(1, $quoteItems); + } + /** * Check customer quotes * From 9eb8dc0ac856f6beb20691e92da92f93063531b0 Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Tue, 1 Dec 2020 12:44:40 -0600 Subject: [PATCH 379/490] MC-39279: [ CLARIFICATION ] Product zoom effect on iPhone is not similar to desktop or android zoom effect --- lib/web/magnifier/magnify.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web/magnifier/magnify.js b/lib/web/magnifier/magnify.js index 559e7782f2476..f0c464f4d9042 100644 --- a/lib/web/magnifier/magnify.js +++ b/lib/web/magnifier/magnify.js @@ -314,7 +314,7 @@ define([ ratio, dimentions = {}; - if (allowZoomIn && (!transitionEnabled || !transitionActive) && (isTouchEnabled || + if (allowZoomIn && (!transitionEnabled && !transitionActive) && (isTouchEnabled || !$(zoomInButtonSelector).hasClass(zoomInDisabled))) { $image = $(fullscreenImageSelector); imgOriginalSize = getImageSize($image[0]); @@ -387,7 +387,7 @@ define([ ratio, fitIntoParent; - if (allowZoomOut && (!transitionEnabled || !transitionActive) && (isTouchEnabled || + if (allowZoomOut && (!transitionEnabled && !transitionActive) && (isTouchEnabled || !$(zoomOutButtonSelector).hasClass(zoomOutDisabled))) { allowZoomIn = true; $image = $(fullscreenImageSelector); @@ -679,7 +679,7 @@ define([ if ($image.hasClass(imageDraggableClass)) { $image.removeClass(imageDraggableClass); } - } else if (gallery.fullScreen && (!transitionEnabled || !transitionActive)) { + } else if (gallery.fullScreen && (!transitionEnabled && !transitionActive)) { imagePosY = getTop($image); imagePosX = $image.offset().left; @@ -719,7 +719,7 @@ define([ var clientX, clientY; - if (gallery.fullScreen && isDragActive && (!transitionEnabled || !transitionActive)) { + if (gallery.fullScreen && isDragActive && (!transitionEnabled && !transitionActive)) { if (allowZoomOut && !$image.hasClass(imageDraggableClass)) { $image.addClass(imageDraggableClass); From 1163c2177b9e4652b43b33a391ad6f942f6806a2 Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Tue, 1 Dec 2020 12:46:01 -0600 Subject: [PATCH 380/490] MC-39071: Implement Multiple Wishlist additions and patch back minor updates - update test coverage for addGroupedProduct to wishlist --- .../AddGroupedProductToWishlistTest.php | 11 +++-- .../DeleteProductsFromWishlistTest.php | 47 +++++++++++-------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/AddGroupedProductToWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/AddGroupedProductToWishlistTest.php index a9c9e0e104235..7a5fdb0a242fa 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/AddGroupedProductToWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/AddGroupedProductToWishlistTest.php @@ -59,9 +59,9 @@ public function testAllFieldsGroupedProduct() $this->assertEquals($wishlist->getItemsCount(), $response['items_count']); $this->assertEquals($wishlist->getSharingCode(), $response['sharing_code']); $this->assertEquals($wishlist->getUpdatedAt(), $response['updated_at']); - $this->assertEquals((int) $item->getQty(), $response['items_v2'][0]['quantity']); - $this->assertEquals($item->getAddedAt(), $response['items_v2'][0]['added_at']); - $this->assertEquals($productSku, $response['items_v2'][0]['product']['sku']); + $this->assertEquals((int) $item->getQty(), $response['items_v2']['items'][0]['quantity']); + $this->assertEquals($item->getAddedAt(), $response['items_v2']['items'][0]['added_at']); + $this->assertEquals($productSku, $response['items_v2']['items'][0]['product']['sku']); } private function getMutation( @@ -90,13 +90,16 @@ private function getMutation( items_count updated_at items_v2 { - id + items{ + id description quantity added_at product { sku } + } + } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/DeleteProductsFromWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/DeleteProductsFromWishlistTest.php index dd7a54cff32a0..344b4e0f93d0d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/DeleteProductsFromWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/DeleteProductsFromWishlistTest.php @@ -40,19 +40,21 @@ protected function setUp(): void public function testDeleteWishlistItemFromWishlist(): void { $wishlist = $this->getWishlist(); - $wishlistId = $wishlist['customer']['wishlist']['id']; - $wishlist = $wishlist['customer']['wishlist']; - $wishlistItems = $wishlist['items_v2']; - $this->assertEquals(1, $wishlist['items_count']); + $customerWishlists = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlists['id']; - $query = $this->getQuery((int) $wishlistId, (int) $wishlistItems[0]['id']); + $wishlistItems = $customerWishlists['items_v2']['items']; + $this->assertEquals(1, $customerWishlists['items_count']); + + $query = $this->getQuery($wishlistId, $wishlistItems[0]['id']); $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); $this->assertArrayHasKey('removeProductsFromWishlist', $response); $this->assertArrayHasKey('wishlist', $response['removeProductsFromWishlist']); + $this->assertEmpty($response['removeProductsFromWishlist']['user_errors'], 'User error is not empty'); $wishlistResponse = $response['removeProductsFromWishlist']['wishlist']; $this->assertEquals(0, $wishlistResponse['items_count']); - $this->assertEmpty($wishlistResponse['items_v2']); + $this->assertEmpty($wishlistResponse['items_v2']['items'], 'Wishlist item is not removed'); } /** @@ -64,10 +66,10 @@ public function testDeleteWishlistItemFromWishlist(): void public function testUnauthorizedWishlistItemDelete() { $wishlist = $this->getWishlist(); - $wishlistItem = $wishlist['customer']['wishlist']['items_v2'][0]; + $wishlistItem = $wishlist['customer']['wishlists'][0]['items_v2']['items']; $wishlist2 = $this->getWishlist('customer_two@example.com'); - $wishlist2Id = $wishlist2['customer']['wishlist']['id']; - $query = $this->getQuery((int) $wishlist2Id, (int) $wishlistItem['id']); + $wishlist2Id = $wishlist2['customer']['wishlists'][0]['id']; + $query = $this->getQuery($wishlist2Id, $wishlistItem[0]['id']); $response = $this->graphQlMutation( $query, [], @@ -75,10 +77,10 @@ public function testUnauthorizedWishlistItemDelete() $this->getHeaderMap('customer_two@example.com') ); self::assertEquals(1, $response['removeProductsFromWishlist']['wishlist']['items_count']); - self::assertNotEmpty($response['removeProductsFromWishlist']['wishlist']['items_v2'], 'empty wish list items'); - self::assertCount(1, $response['removeProductsFromWishlist']['wishlist']['items_v2']); + self::assertNotEmpty($response['removeProductsFromWishlist']['wishlist']['items_v2']['items'], 'empty wish list items'); + self::assertCount(1, $response['removeProductsFromWishlist']['wishlist']['items_v2']['items']); self::assertEquals( - 'The wishlist item with ID "'.$wishlistItem['id'].'" does not belong to the wishlist', + 'The wishlist item with ID "' . $wishlistItem[0]['id'] . '" does not belong to the wishlist', $response['removeProductsFromWishlist']['user_errors'][0]['message'] ); } @@ -109,14 +111,14 @@ private function getHeaderMap(string $username = 'customer@example.com', string * @return string */ private function getQuery( - int $wishlistId, - int $wishlistItemId + string $wishlistId, + string $wishlistItemId ): string { return <<<MUTATION mutation { removeProductsFromWishlist( - wishlistId: {$wishlistId}, - wishlistItemsIds: [{$wishlistItemId}] + wishlistId: "{$wishlistId}", + wishlistItemsIds: ["{$wishlistItemId}"] ) { user_errors { code @@ -127,9 +129,7 @@ private function getQuery( sharing_code items_count items_v2 { - id - description - quantity + items {id description quantity product {name sku}} } } } @@ -159,13 +159,20 @@ private function getCustomerWishlistQuery(): string return <<<QUERY query { customer { - wishlist { + wishlists { id items_count + sharing_code + updated_at items_v2 { + items { id quantity description + product { + sku + } + } } } } From 7e25908e44517949e2246604b3ec8f66d3eeb666 Mon Sep 17 00:00:00 2001 From: David Haecker <dhaecker@magento.com> Date: Tue, 1 Dec 2020 14:59:07 -0600 Subject: [PATCH 381/490] magento/partners-magento2b2b#501: [Test Fix] MFTF Tests Fail to Rerun When Test Logs Out of Storefront After Deleting Customer - Fixing SVC failures --- ...rontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml | 3 ++- .../Test/StorefrontPurchaseProductWithCustomOptionsTest.xml | 3 ++- .../DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml | 3 ++- .../Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml | 3 ++- .../StorefrontCustomerCheckoutTest.xml | 3 ++- ...ingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml | 3 ++- ...refrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml | 3 ++- .../Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml | 3 ++- .../Test/Mftf/Test/WishListWithDisabledProductTest.xml | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index 28cd10cc52f47..814356bb05a22 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -49,7 +49,7 @@ <after> <!-- Customer Log Out --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> @@ -72,6 +72,7 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <comment userInput="BIC workaround" stepKey="customerLogoutStorefront"/> </after> <!-- Open Product Grid, Filter product and open --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 7bd7b6bc8e8b4..71041ee7e1349 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -32,13 +32,14 @@ </before> <after> <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <!-- Delete product and category --> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderListingFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> + <comment userInput="BIC workaround" stepKey="customerLogoutStorefront"/> </after> <!-- Login Customer Storefront --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index c0dfd90a713f5..d46ebfd63203a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -32,10 +32,11 @@ </before> <after> <!--Logout from customer account--> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <comment userInput="BIC workaround" stepKey="logoutCustomer"/> </after> <!-- Add simple product to cart and go to checkout--> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index fe3bf0aa9ef49..38e2203b45258 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -107,12 +107,13 @@ <deleteData createDataKey="createDownloadableProduct" stepKey="deleteDownloadableProduct"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/> + <comment userInput="BIC workaround" stepKey="deleteCustomer"/> <!-- Logout customer --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> <!-- Delete customer --> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml index cb01f2f0ad201..535a3fb0c436b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml @@ -28,12 +28,13 @@ </actionGroup> </before> <after> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createCustomer" stepKey="deleteUsCustomer"/> <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="resetCustomerFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + <comment userInput="BIC workaround" stepKey="logoutCustomer"/> </after> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index 28d7d4d12c7cc..26db75d289a6e 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -45,7 +45,7 @@ </actionGroup> </before> <after> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromCustomer"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/> <createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/> <createData entity="DisableSynchronizeWidgetProductsWithBackendStorage" stepKey="disableSynchronizeWidgetProductsWithBackendStorage"/> @@ -53,6 +53,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <comment userInput="BIC workaround" stepKey="logoutFromCustomer"/> <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteRecentlyComparedProductsWidget"> <argument name="widget" value="RecentlyComparedProductsWidget"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml index c14cc3bda73d6..e05496efaa152 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -23,8 +23,9 @@ </before> <after> <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromCustomer"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createCustomer" before="goToProductAttributes" stepKey="deleteCustomer"/> + <comment userInput="BIC workaround" stepKey="logoutFromCustomer"/> </after> <!-- Remove steps that are not used for this test --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index ae35cc78ec88e..8fe3d3c707900 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -37,7 +37,7 @@ <after> <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> @@ -51,6 +51,7 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsFilters"/> <!--Logout everywhere--> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + <comment userInput="BIC workaround" stepKey="customerLogout"/> </after> <!-- Change products visibility on store-view level --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index 06624d25ad23e..96e5417f1cffd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -24,9 +24,10 @@ </before> <after> <!-- Logout customer --> - <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <comment userInput="BIC workaround" stepKey="customerLogout"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> From 842945116e09540bf4232b1c5e2580b405d2afb3 Mon Sep 17 00:00:00 2001 From: Roman Flowers <flowers@adobe.com> Date: Tue, 1 Dec 2020 15:01:48 -0600 Subject: [PATCH 382/490] MC-39279: [ CLARIFICATION ] Product zoom effect on iPhone is not similar to desktop or android zoom effect --- lib/web/magnifier/magnify.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/web/magnifier/magnify.js b/lib/web/magnifier/magnify.js index f0c464f4d9042..7dec3d2d1b9fd 100644 --- a/lib/web/magnifier/magnify.js +++ b/lib/web/magnifier/magnify.js @@ -35,14 +35,11 @@ define([ allowZoomOut = false, allowZoomIn = true; - (function () { - var style = document.documentElement.style, - transitionEnabled = style.transition !== undefined || - style.WebkitTransition !== undefined || - style.MozTransition !== undefined || - style.MsTransition !== undefined || - style.OTransition !== undefined; - })(); + transitionEnabled = document.documentElement.style.transition !== undefined || + document.documentElement.style.WebkitTransition !== undefined || + document.documentElement.style.MozTransition !== undefined || + document.documentElement.style.MsTransition !== undefined || + document.documentElement.style.OTransition !== undefined; /** * Return width and height of original image @@ -314,7 +311,7 @@ define([ ratio, dimentions = {}; - if (allowZoomIn && (!transitionEnabled && !transitionActive) && (isTouchEnabled || + if (allowZoomIn && (!transitionEnabled || !transitionActive) && (isTouchEnabled || !$(zoomInButtonSelector).hasClass(zoomInDisabled))) { $image = $(fullscreenImageSelector); imgOriginalSize = getImageSize($image[0]); @@ -387,7 +384,7 @@ define([ ratio, fitIntoParent; - if (allowZoomOut && (!transitionEnabled && !transitionActive) && (isTouchEnabled || + if (allowZoomOut && (!transitionEnabled || !transitionActive) && (isTouchEnabled || !$(zoomOutButtonSelector).hasClass(zoomOutDisabled))) { allowZoomIn = true; $image = $(fullscreenImageSelector); @@ -679,7 +676,7 @@ define([ if ($image.hasClass(imageDraggableClass)) { $image.removeClass(imageDraggableClass); } - } else if (gallery.fullScreen && (!transitionEnabled && !transitionActive)) { + } else if (gallery.fullScreen && (!transitionEnabled || !transitionActive)) { imagePosY = getTop($image); imagePosX = $image.offset().left; @@ -719,7 +716,7 @@ define([ var clientX, clientY; - if (gallery.fullScreen && isDragActive && (!transitionEnabled && !transitionActive)) { + if (gallery.fullScreen && isDragActive && (!transitionEnabled || !transitionActive)) { if (allowZoomOut && !$image.hasClass(imageDraggableClass)) { $image.addClass(imageDraggableClass); From 17ed57e25fb5831a2d2c8b9f2267a1f509ae6548 Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Tue, 1 Dec 2020 15:54:59 -0600 Subject: [PATCH 383/490] - Updated constraints on the catalog_compare_list table --- app/code/Magento/Catalog/etc/db_schema.xml | 7 +++---- app/code/Magento/Catalog/etc/db_schema_whitelist.json | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index d601a882cb25e..ce34914a2f5d4 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -586,16 +586,15 @@ <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="list_id"/> </constraint> - + <constraint xsi:type="unique" referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID"> + <column name="customer_id"/> + </constraint> <constraint xsi:type="foreign" referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="catalog_compare_list" column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/> <index referenceId="CATALOG_COMPARE_LIST_LIST_ID_MASK" indexType="btree"> <column name="list_id_mask"/> </index> - <index referenceId="CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_CUSTOMER_ID" indexType="btree"> - <column name="customer_id"/> - </index> </table> <table name="catalog_product_website" resource="default" engine="innodb" comment="Catalog Product To Website Linkage Table"> diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index 3bbd99653e860..efc45112920e2 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1132,12 +1132,12 @@ "customer_id": true }, "index": { - "CATALOG_COMPARE_LIST_LIST_ID_MASK": true, - "CATALOG_COMPARE_LIST_CUSTOMER_ID": true + "CATALOG_COMPARE_LIST_LIST_ID_MASK": true }, "constraint": { "PRIMARY": true, + "CATALOG_COMPARE_LIST_CUSTOMER_ID": true, "CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID": true } } -} \ No newline at end of file +} From 84e1f0f77ffbb69423e14570a6bac30f0c981bf1 Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Tue, 1 Dec 2020 18:29:24 -0600 Subject: [PATCH 384/490] MC-38765: Ensure there are no split db specific tests --- .../Setup/InstallSchema.php | 27 +++++ .../etc/db_schema.xml | 51 +++++++++ .../etc/db_schema_whitelist.json | 14 +++ .../TestSetupDeclarationModule2/etc/di.xml | 18 +++ .../etc/module.xml | 10 ++ .../fixture/shards.mariadb10.php | 36 ++++++ .../fixture/shards.mysql8.php | 36 ++++++ .../fixture/shards.php | 36 ++++++ .../registration.php | 12 ++ .../etc/db_schema.xml | 2 +- .../etc/install-config-mysql.php.dist | 8 +- .../TestFramework/Deploy/ShardingConfig.php | 64 +++++++++++ .../testsuite/Magento/Setup/ShardingTest.php | 104 ++++++++++++++++++ 13 files changed, 413 insertions(+), 5 deletions(-) create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/Setup/InstallSchema.php create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema.xml create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema_whitelist.json create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/di.xml create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/module.xml create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mariadb10.php create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.php create mode 100644 dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/registration.php create mode 100644 dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php create mode 100644 dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/Setup/InstallSchema.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/Setup/InstallSchema.php new file mode 100644 index 0000000000000..663d014ecac2e --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/Setup/InstallSchema.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\TestSetupDeclarationModule2\Setup; + +use Magento\Framework\Setup\InstallSchemaInterface; +use Magento\Framework\Setup\ModuleContextInterface; +use Magento\Framework\Setup\SchemaSetupInterface; + +/** + * InstallSchema mock class. + */ +class InstallSchema implements InstallSchemaInterface +{ + /** + * {@inheritdoc} + */ + public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) + { + $installer = $setup; + $installer->startSetup(); + $installer->endSetup(); + } +} diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema.xml new file mode 100644 index 0000000000000..a11bd9b84c0ff --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> + <table name="test_table_one" resource="shard_one"> + <column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/> + <column xsi:type="varchar" name="varchar" length="254" nullable="true"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="smallint" /> + </constraint> + </table> + <table name="test_table_two" resource="shard_two"> + <column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/> + <column xsi:type="varchar" name="varchar" length="254" nullable="true"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="smallint" /> + </constraint> + </table> + <table name="reference_table" resource="default"> + <column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/> + <column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/> + <column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/> + <column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/> + <column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/> + <column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false" + unsigned="false"/> + <column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/> + <column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/> + <column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/> + <column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1" + unsigned="true"/> + <column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/> + <constraint xsi:type="primary" referenceId="tinyint_primary"> + <column name="tinyint_ref"/> + </constraint> + </table> + <table name="auto_increment_test" resource="default"> + <column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true" + nullable="true"/> + <column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12" + unsigned="true" nullable="true"/> + <constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE"> + <column name="int_auto_increment_with_nullable"/> + </constraint> + </table> +</schema> diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema_whitelist.json b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema_whitelist.json new file mode 100644 index 0000000000000..b5fe2a53a39f9 --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/db_schema_whitelist.json @@ -0,0 +1,14 @@ +{ + "test_table_one": { + "column": [] + }, + "test_table_two": { + "column": [] + }, + "reference_table": { + "column": [] + }, + "auto_increment_test": { + "column": [] + } +} diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/di.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/di.xml new file mode 100644 index 0000000000000..24daf47aeba4c --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/di.xml @@ -0,0 +1,18 @@ +<?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\Framework\Setup\Declaration\Schema\Sharding"> + <arguments> + <argument name="resources" xsi:type="array"> + <item name="default" xsi:type="string">default</item> + <item name="shard_one" xsi:type="string">shard_one</item> + <item name="shard_two" xsi:type="string">shard_two</item> + </argument> + </arguments> + </type> +</config> diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/module.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/module.xml new file mode 100644 index 0000000000000..ec0d4f88aba33 --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/etc/module.xml @@ -0,0 +1,10 @@ +<?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:Module/etc/module.xsd"> + <module name="Magento_TestSetupDeclarationModule2" setup_version="2.0.1"/> +</config> diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mariadb10.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mariadb10.php new file mode 100644 index 0000000000000..c0c7d1af3644a --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mariadb10.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +return [ + 'test_table_one' => 'CREATE TABLE `test_table_one` ( + `smallint` smallint(6) NOT NULL AUTO_INCREMENT, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'test_table_two' => 'CREATE TABLE `test_table_two` ( + `smallint` smallint(6) NOT NULL AUTO_INCREMENT, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'reference_table' => 'CREATE TABLE `reference_table` ( + `tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT, + `tinyint_without_padding` tinyint(4) NOT NULL DEFAULT 0, + `bigint_without_padding` bigint(20) NOT NULL DEFAULT 0, + `smallint_without_padding` smallint(6) NOT NULL DEFAULT 0, + `integer_without_padding` int(11) NOT NULL DEFAULT 0, + `smallint_with_big_padding` smallint(6) NOT NULL DEFAULT 0, + `smallint_without_default` smallint(6) DEFAULT NULL, + `int_without_unsigned` int(11) DEFAULT NULL, + `int_unsigned` int(10) unsigned DEFAULT NULL, + `bigint_default_nullable` bigint(20) unsigned DEFAULT 1, + `bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`tinyint_ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'auto_increment_test' => 'CREATE TABLE `auto_increment_test` ( + `int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT, + `int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0, + UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8' +]; diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php new file mode 100644 index 0000000000000..a73a33032a8d0 --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +return [ + 'test_table_one' => 'CREATE TABLE `test_table_one` ( + `smallint` smallint NOT NULL AUTO_INCREMENT,, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'test_table_two' => 'CREATE TABLE `test_table_two` ( + `smallint` smallint NOT NULL AUTO_INCREMENT,, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'reference_table' => 'CREATE TABLE `reference_table` ( + `tinyint_ref` tinyint NOT NULL AUTO_INCREMENT, + `tinyint_without_padding` tinyint NOT NULL DEFAULT \'0\', + `bigint_without_padding` bigint NOT NULL DEFAULT \'0\', + `smallint_without_padding` smallint NOT NULL DEFAULT \'0\', + `integer_without_padding` int NOT NULL DEFAULT \'0\', + `smallint_with_big_padding` smallint NOT NULL DEFAULT \'0\', + `smallint_without_default` smallint DEFAULT NULL, + `int_without_unsigned` int DEFAULT NULL, + `int_unsigned` int unsigned DEFAULT NULL, + `bigint_default_nullable` bigint unsigned DEFAULT \'1\', + `bigint_not_default_not_nullable` bigint unsigned NOT NULL, + PRIMARY KEY (`tinyint_ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'auto_increment_test' => 'CREATE TABLE `auto_increment_test` ( + `int_auto_increment_with_nullable` int unsigned NOT NULL AUTO_INCREMENT, + `int_disabled_auto_increment` smallint unsigned DEFAULT \'0\', + UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8' +]; diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.php new file mode 100644 index 0000000000000..f0ea3be60ee5f --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +return [ + 'test_table_one' => 'CREATE TABLE `test_table_one` ( + `smallint` smallint(6) NOT NULL AUTO_INCREMENT, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'test_table_two' => 'CREATE TABLE `test_table_two` ( + `smallint` smallint(6) NOT NULL AUTO_INCREMENT, + `varchar` varchar(254) DEFAULT NULL, + PRIMARY KEY (`smallint`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'reference_table' => 'CREATE TABLE `reference_table` ( + `tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT, + `tinyint_without_padding` tinyint(4) NOT NULL DEFAULT \'0\', + `bigint_without_padding` bigint(20) NOT NULL DEFAULT \'0\', + `smallint_without_padding` smallint(6) NOT NULL DEFAULT \'0\', + `integer_without_padding` int(11) NOT NULL DEFAULT \'0\', + `smallint_with_big_padding` smallint(6) NOT NULL DEFAULT \'0\', + `smallint_without_default` smallint(6) DEFAULT NULL, + `int_without_unsigned` int(11) DEFAULT NULL, + `int_unsigned` int(10) unsigned DEFAULT NULL, + `bigint_default_nullable` bigint(20) unsigned DEFAULT \'1\', + `bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`tinyint_ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8', + 'auto_increment_test' => 'CREATE TABLE `auto_increment_test` ( + `int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT, + `int_disabled_auto_increment` smallint(5) unsigned DEFAULT \'0\', + UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8' +]; diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/registration.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/registration.php new file mode 100644 index 0000000000000..065836393186f --- /dev/null +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule2') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule2', __DIR__); +} diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule6/etc/db_schema.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule6/etc/db_schema.xml index d6be9376cb4da..1c4e7b6b6da97 100644 --- a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule6/etc/db_schema.xml +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule6/etc/db_schema.xml @@ -7,7 +7,7 @@ --> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> - <table name="reference_table" resource="sales"> + <table name="reference_table" resource="default"> <column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/> <column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/> <column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/> diff --git a/dev/tests/setup-integration/etc/install-config-mysql.php.dist b/dev/tests/setup-integration/etc/install-config-mysql.php.dist index d355100c446be..b9b1182657188 100644 --- a/dev/tests/setup-integration/etc/install-config-mysql.php.dist +++ b/dev/tests/setup-integration/etc/install-config-mysql.php.dist @@ -20,16 +20,16 @@ return [ 'enable-modules' => 'Magento_TestSetupModule2,Magento_TestSetupModule1,Magento_Backend', 'disable-modules' => 'all' ], - 'checkout' => [ + 'shard_two' => [ 'host' => '{{db-host}}', 'username' => '{{db-user}}', 'password' => '{{db-password}}', - 'dbname' => '{{db-checkout}}' + 'dbname' => '{{db-shardone}}' ], - 'sales' => [ + 'shard_one' => [ 'host' => '{{db-host}}', 'username' => '{{db-user}}', 'password' => '{{db-password}}', - 'dbname' => '{{db-sales}}' + 'dbname' => '{{db-shardtwo}}' ] ]; diff --git a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php new file mode 100644 index 0000000000000..8a6a03a3ef1dc --- /dev/null +++ b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\TestFramework\Deploy; + +use Magento\Framework\App\DeploymentConfig\Reader as ConfigReader; +use Magento\Framework\App\DeploymentConfig\Writer as ConfigWriter; +use Magento\Framework\Config\File\ConfigFilePool; + +/** + * The purpose of this class is add sharding db connections to env file. + */ +class ShardingConfig +{ + /** + * @var ConfigWriter + */ + private $configWriter; + + /** + * @var ConfigReader + */ + private $configReader; + + /** + * @param ConfigWriter $configWriter + * @param ConfigReader $configReader + */ + public function __construct(ConfigWriter $configWriter, ConfigReader $configReader) + { + $this->configWriter = $configWriter; + $this->configReader = $configReader; + } + + /** + * Add sharding database connection to env file + */ + public function addConfiguration() + { + $allDbData = include TESTS_INSTALLATION_DB_CONFIG_FILE; + $config = $this->configReader->load(ConfigFilePool::APP_ENV); + + foreach ($allDbData as $connectionName => $dbData) { + if (!isset($config['db']['connection'][$connectionName]) && $connectionName !== 'default') { + $config['db']['connection'][$connectionName] = [ + 'host' => $dbData['host'], + 'username' => $dbData['username'], + 'password' => $dbData['password'], + 'dbname' => $dbData['dbname'], + 'model' => 'mysql4', + 'engine' => 'innodb', + 'initStatements' => 'SET NAMES utf8;', + 'active' => '1' + ]; + $config['resource'][$connectionName] = [ + 'connection' => $connectionName + ]; + $this->configWriter->saveConfig([ConfigFilePool::APP_ENV => $config], true); + } + } + } +} diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php new file mode 100644 index 0000000000000..548e1278fa0f0 --- /dev/null +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Setup; + +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\ResourceConnection; +use Magento\TestFramework\Deploy\CliCommand; +use Magento\TestFramework\Deploy\DescribeTable; +use Magento\TestFramework\Deploy\ShardingConfig; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\SetupTestCase; +use Magento\TestFramework\Deploy\TestModuleManager; + +/** + * The purpose of this test is verifying declarative installation works with different shard. + */ +class ShardingTest extends SetupTestCase +{ + /** + * @var CliCommand + */ + private $cliCommand; + + /** + * @var DescribeTable + */ + private $describeTable; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var DeploymentConfig + */ + private $deploymentConfig; + + /** + * @var TestModuleManager + */ + private $moduleManager; + + /** + * @var ShardingConfig + */ + private $shardingConfig; + + protected function setUp(): void + { + $objectManager= Bootstrap::getObjectManager(); + $this->cliCommand = $objectManager->get(CliCommand::class); + $this->resourceConnection = $objectManager->get(ResourceConnection::class); + $this->deploymentConfig = $objectManager->get(DeploymentConfig::class); + $this->describeTable = $objectManager->get(DescribeTable::class); + $this->moduleManager = $objectManager->get(TestModuleManager::class); + $this->shardingConfig = $objectManager->get(ShardingConfig::class); + } + + /** + * @moduleName Magento_TestSetupDeclarationModule2 + * @dataProviderFromFile Magento/TestSetupDeclarationModule2/fixture/shards.php + */ + public function testInstall() + { + $this->shardingConfig->addConfiguration(); + $this->cliCommand->install(['Magento_TestSetupDeclarationModule2']); + $this->deploymentConfig->resetData(); + + $default = $this->describeTable->describeShard('default'); + $shard1 = $this->describeTable->describeShard('shard_one'); + $shard2 = $this->describeTable->describeShard('shard_two'); + //Check if tables were installed on different shards + self::assertCount(2, $default); + self::assertCount(1, $shard1); + self::assertCount(1, $shard2); + self::assertEquals($this->getData(), array_replace($default, $shard1, $shard2)); + } + + /** + * @moduleName Magento_TestSetupDeclarationModule2 + * @dataProviderFromFile Magento/TestSetupDeclarationModule2/fixture/shards.php + */ + public function testUpgrade() + { + $this->shardingConfig->addConfiguration(); + $this->cliCommand->install(['Magento_TestSetupDeclarationModule2']); + $this->deploymentConfig->resetData(); + $this->cliCommand->upgrade(); + + $default = $this->describeTable->describeShard('default'); + $shard1 = $this->describeTable->describeShard('shard_one'); + $shard2 = $this->describeTable->describeShard('shard_two'); + //Check if tables were installed on different shards + self::assertCount(2, $default); + self::assertCount(1, $shard1); + self::assertCount(1, $shard2); + self::assertEquals($this->getData(), array_replace($default, $shard1, $shard2)); + } +} From aa53fa67b3bbfcc65777b84b034af901ea7c32f8 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 1 Dec 2020 18:51:41 -0600 Subject: [PATCH 385/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Test/StorefrontAutoGeneratedCouponCodeTest.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 1c63796827785..571bb30e34dd4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -101,11 +101,6 @@ <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/> - <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> - <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> - <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> - </actionGroup> - <reloadPage stepKey="refreshPage1"/> <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> @@ -151,6 +146,11 @@ <!-- Step; 15-16. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage3"/> <waitForPageLoad stepKey="waitForPageLoad5"/> + <!-- Start the usage processing consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> + <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> + </actionGroup> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule3"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="couponCode" value="{$couponCode}"/> From 4a5c877c632bfce25e23c655b6c555fb435ff1ed Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 1 Dec 2020 18:52:34 -0600 Subject: [PATCH 386/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml index 4813d8aefdb8d..5ee98b49bd007 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleQueueData.xml @@ -10,6 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="SalesRuleConsumerData"> <data key="consumerName">sales.rule.update.coupon.usage</data> - <data key="messageLimit">3</data> + <data key="messageLimit">10</data> </entity> </entities> From cdc838667b98cdc8e3bad1b74435fcbe23f04d49 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 1 Dec 2020 18:58:05 -0600 Subject: [PATCH 387/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 571bb30e34dd4..1c9e6b99d073e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -58,7 +58,7 @@ <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="Message is added to queue, wait to get your coupons soon" stepKey="seeSuccessMessage"/> - <!-- Start message queue for export consumer and coupon processing --> + <!-- Start message queue for export consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/> @@ -143,14 +143,15 @@ <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/> <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage1"/> - <!-- Step; 15-16. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage3"/> - <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Start the usage processing consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> </actionGroup> + + <!-- Step; 15-16. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage3"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule3"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="couponCode" value="{$couponCode}"/> From 4f4067bdfa1b33941d058eac93d18a949da7b6bb Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 1 Dec 2020 18:59:39 -0600 Subject: [PATCH 388/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 1c9e6b99d073e..36e70d4f80561 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -105,7 +105,6 @@ <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> - <reloadPage stepKey="refreshPage2"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule1"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="couponCode" value="{$couponCode}"/> From afb1581d15c5813708ea673ac30d436a22035175 Mon Sep 17 00:00:00 2001 From: Prabhu Ram <pganapat@adobe.com> Date: Tue, 1 Dec 2020 20:26:16 -0600 Subject: [PATCH 389/490] Removing additional calls to the db. --- app/code/Magento/Catalog/Controller/Product/Compare/Clear.php | 1 - app/code/Magento/Catalog/Controller/Product/Compare/Remove.php | 3 --- 2 files changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php b/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php index 81f63f3e75c54..2703e9869bd47 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Clear.php @@ -31,7 +31,6 @@ public function execute() try { $items->clear(); - $items->removeCompareList($this->_customerSession->getCustomerId()); $this->messageManager->addSuccessMessage(__('You cleared the comparison list.')); $this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class)->calculate(); } catch (\Magento\Framework\Exception\LocalizedException $e) { diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php b/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php index 23bb7e0e3d459..3f94ffd0909aa 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Remove.php @@ -50,9 +50,6 @@ public function execute() $helper = $this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class); if ($item->getId()) { $item->delete(); - /** @var Collection $items */ - $items = $this->_itemCollectionFactory->create(); - $items->removeCompareList($this->_customerSession->getCustomerId()); $productName = $this->_objectManager->get(\Magento\Framework\Escaper::class) ->escapeHtml($product->getName()); $this->messageManager->addSuccessMessage( From 2083ffffa5ba105a7f77a90327bd82a5b1adf09c Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 2 Dec 2020 10:15:27 +0200 Subject: [PATCH 390/490] MC-39539: [MFTF] Flaky AdminCreateCustomerTest because of bad design --- .../Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml index 7442a32d58b2d..5b6c4fd23e038 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml @@ -15,21 +15,24 @@ <title value="Admin should be able to create a customer"/> <description value="Admin should be able to create a customer"/> <severity value="BLOCKER"/> - <testCaseId value="MAGETWO-72095"/> + <testCaseId value="MC-28500"/> <group value="customer"/> <group value="create"/> </annotations> + <before> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCustomerGrid"> <argument name="indices" value="customer_grid"/> </actionGroup> </before> + <after> + <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearCustomersFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> - <amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/> + <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="navigateToCustomers"/> <waitForPageLoad stepKey="waitForLoad1"/> <click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="clickCreateCustomer"/> <fillField userInput="{{CustomerEntityOne.firstname}}" selector="{{AdminCustomerAccountInformationSection.firstName}}" stepKey="fillFirstName"/> From 7dcd88bd75b83a0a7016b36738462a2e256d8d20 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 10:38:58 +0200 Subject: [PATCH 391/490] added selector AdminOrdersGridSection.orderIdByIncrementId Please enter the commit message for your changes. Lines starting --- .../Mftf/Section/AdminOrdersGridSection.xml | 1 + .../Test/Mftf/Section/OrdersGridSection.xml | 1 + ...ssOrdersCancelCompleteAndClosedAPITest.xml | 27 +++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml index 02878e79f3d70..55cd30f1caf2e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml @@ -41,5 +41,6 @@ <element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/> <element name="selectOrderID" type="checkbox" selector="//td/div[text()='{{orderId}}']/../preceding-sibling::td//input" parameterized="true" timeout="60"/> <element name="orderId" type="text" selector="//table[contains(@class, 'data-grid')]//div[contains(text(), '{{orderId}}')]" parameterized="true"/> + <element name="orderIdByIncrementId" type="text" selector="//input[@class='admin__control-checkbox' and @value={{incrId}}]/parent::label/parent::td/following-sibling::td" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index a6b856f9f814f..02e11ec62e949 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -30,5 +30,6 @@ <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> + </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index 5ed660b21c6df..e0ecab5947bfb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -50,7 +50,7 @@ <createData entity="GuestCart" stepKey="createGuestCartTwo"/> <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> - <requiredEntity createDataKey="createGuestCartTow"/> + <requiredEntity createDataKey="createGuestCartTwo"/> <requiredEntity createDataKey="createSimpleProduct"/> </createData> <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo"> @@ -71,7 +71,6 @@ </before> <after> <!-- Delete data --> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> @@ -103,32 +102,44 @@ <!-- Create CreditMemo for second Order --> <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> + <!-- <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderOne"> + <argument name="entityId" value="$createGuestCartOne.return$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderOneId"/> + + <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderTwo"> + <argument name="entityId" value="$createGuestCartTwo.return$"/> + </actionGroup> --> + <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/> + <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> <argument name="action" value="Cancel"/> - <argument name="orderId" value="$createGuestCartOne.return$"/> - <argument name="secondOrderId" value="$createGuestCartTwo.return$"/> + <argument name="orderId" value="$getOrderOneId"/> + <argument name="secondOrderId" value="$getOrderTwoId"/> </actionGroup> <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> <!--Assert first order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="orderId" value="$getOrderOneId"/> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see userInput="$createGuestCartOne.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> <!--Assert second order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> - <argument name="orderId" value="$createGuestCartTwo.return$"/> + <argument name="orderId" value="$getOrderTwoId"/> <argument name="orderStatus" value="Closed"/> </actionGroup> - <see userInput="$createGuestCartTwo.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="$getOrderTwoId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> </test> </tests> From 10dc15ff44c8494d48cb34cdc2615ae38aebc594 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Wed, 2 Dec 2020 03:06:24 -0600 Subject: [PATCH 392/490] MC-37484: Cart query error when trying to switch store view --- .../Model/Cart/GetCartForUser.php | 5 +++- .../Model/Resolver/CartItemPrices.php | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php index f5e273db0cd6a..36848fa9d7f99 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php @@ -118,6 +118,7 @@ public function execute(string $cartHash, ?int $customerId, int $storeId): Quote private function updateCartCurrency(Quote $cart, int $storeId) { $cartStore = $this->storeRepository->getById($cart->getStoreId()); + $currentCartCurrencyCode = $cartStore->getCurrentCurrency()->getCode(); if ((int)$cart->getStoreId() !== $storeId) { $newStore = $this->storeRepository->getById($storeId); if ($cartStore->getWebsite() !== $newStore->getWebsite()) { @@ -128,8 +129,10 @@ private function updateCartCurrency(Quote $cart, int $storeId) $cart->setStoreId($storeId); $cart->setStoreCurrencyCode($newStore->getCurrentCurrency()); $cart->setQuoteCurrencyCode($newStore->getCurrentCurrency()); - } else { + } elseif ($cart->getQuoteCurrencyCode() !== $currentCartCurrencyCode) { $cart->setQuoteCurrencyCode($cartStore->getCurrentCurrency()); + } else { + return; } $this->cartRepository->save($cart); } diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index da5f0efcedf2b..d4ced5b8b97b0 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -11,13 +11,34 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Quote\Model\Cart\Totals; use Magento\Quote\Model\Quote\Item; +use Magento\Quote\Model\Quote\TotalsCollector; /** * @inheritdoc */ class CartItemPrices implements ResolverInterface { + /** + * @var TotalsCollector + */ + private $totalsCollector; + + /** + * @var Totals + */ + private $totals; + + /** + * @param TotalsCollector $totalsCollector + */ + public function __construct( + TotalsCollector $totalsCollector + ) { + $this->totalsCollector = $totalsCollector; + } + /** * @inheritdoc */ @@ -28,6 +49,12 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } /** @var Item $cartItem */ $cartItem = $value['model']; + + if (!$this->totals) { + // The totals calculation is based on quote address. + // But the totals should be calculated even if no address is set + $this->totals = $this->totalsCollector->collectQuoteTotals($cartItem->getQuote()); + } $currencyCode = $cartItem->getQuote()->getQuoteCurrencyCode(); return [ From 732c6ff48720740fa0e399f2b1d85b198dd41c9e Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:07:37 +0200 Subject: [PATCH 393/490] refactored --- ...ssOrdersCancelCompleteAndClosedAPITest.xml | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index e0ecab5947bfb..85f2fde4d1871 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -47,7 +47,6 @@ <requiredEntity createDataKey="createGuestCartOne"/> </createData> - <createData entity="GuestCart" stepKey="createGuestCartTwo"/> <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> <requiredEntity createDataKey="createGuestCartTwo"/> @@ -69,56 +68,19 @@ </createData> </before> + <after> - <!-- Delete data --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create first order --> - <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"> - <actualResult type="const">$getFirstOrderId</actualResult> - </assertNotEmpty> --> - - <!-- Create Shipment for first Order --> - <!-- <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipmentForFirstOrder"/> --> - - <!-- Create second order --> - <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> - <assertNotEmpty stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"> - <actualResult type="const">$getSecondOrderId</actualResult> - </assertNotEmpty> --> - - <!-- Create CreditMemo for second Order --> - <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> - - <!-- <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderOne"> - <argument name="entityId" value="$createGuestCartOne.return$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderOneId"/> - - <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderTwo"> - <argument name="entityId" value="$createGuestCartTwo.return$"/> - </actionGroup> --> - - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/> <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/> - <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> <argument name="action" value="Cancel"/> <argument name="orderId" value="$getOrderOneId"/> @@ -126,7 +88,6 @@ </actionGroup> <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> - <!--Assert first order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> <argument name="orderId" value="$getOrderOneId"/> <argument name="orderStatus" value="Complete"/> @@ -134,7 +95,6 @@ <see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> - <!--Assert second order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> <argument name="orderId" value="$getOrderTwoId"/> <argument name="orderStatus" value="Closed"/> From a70dfc91c5842aa8ae497912ac91ca2ca93f5020 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:27:56 +0200 Subject: [PATCH 394/490] refactored --- .../Quote/Test/Mftf/Data/CustomerCartData.xml | 6 -- .../Test/Mftf/Metadata/CreditMemoMeta.xml | 2 +- .../Test/Mftf/Section/OrdersGridSection.xml | 1 - .../Test/Mftf/Test/AdminCreateInvoice.xml | 62 ------------------- ...ssOrdersCancelCompleteAndClosedAPITest.xml | 2 + 5 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index affebbc07ad61..8c76c4d0dc31a 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -25,10 +25,4 @@ <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> - <entity name="CustomerOrderPaymentMethod" type="CustomerPaymentInformation"> - <var key="cart_id" entityKey="return" entityType="CustomerCart"/> - <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> - <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> - </entity> - </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml index 3b500d61b1c35..b051c91ba3b10 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml @@ -11,7 +11,7 @@ <operation name="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" method="POST"> <contentType>application/json</contentType> <object key="cartItem" dataType="CartItem"> - <field key="quote_id">string</field> + <field key="quote_id">string</field> </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index 02e11ec62e949..a6b856f9f814f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -30,6 +30,5 @@ <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> - </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml deleted file mode 100644 index 3dc1c3ed98d03..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ /dev/null @@ -1,62 +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="AdminCreateInvoice"> - <annotations> - <features value="Sales"/> - <stories value="1Create an Invoice via the Admin"/> - <title value="1111Admin should be able to create an invoice"/> - <description value="1Admin should be able to create an invoice"/> - <severity value="MAJOR"/> - <testCaseId value="1MAGETWO-72096"/> - <group value="sales"/> - </annotations> - <before> - <createData entity="ApiCategory" stepKey="createCategory"/> - - <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - - <createData entity="GuestCart" stepKey="createGuestCart"/> - <createData entity="SimpleCartItem" stepKey="addCartItem"> - <requiredEntity createDataKey="createGuestCart"/> - <requiredEntity createDataKey="createConfigProduct"/> - </createData> - <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> - <requiredEntity createDataKey="createGuestCart"/> - </updateData> - - <createData entity="Invoice" stepKey="invoiceOrder"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - <createData entity="Shipment" stepKey="shipOrder"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - <createData entity="CreditMemo" stepKey="refundMemo"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - </before> - <after> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> - </after> - - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - - </test> -</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index 85f2fde4d1871..5cb54f0fd5613 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -18,7 +18,9 @@ <group value="sales"/> <group value="mtf_migrated"/> </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <createData entity="ApiCategory" stepKey="createCategory"/> From a5dd5e99039e17705a42297b14a9a40fcd11d96f Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:29:18 +0200 Subject: [PATCH 395/490] refactored --- app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index 8c76c4d0dc31a..a14be3b533fa8 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,5 +24,4 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> - </entities> From dfad73dbca641d405970f024d53856475be5c242 Mon Sep 17 00:00:00 2001 From: Sergio Vera <svera@adobe.com> Date: Wed, 2 Dec 2020 11:49:04 +0100 Subject: [PATCH 396/490] MC-39542: Change LiveCodeTest php stability test - Check for PHP compatibility using lowest and highest supported PHP versions --- .../Magento/Test/Php/LiveCodeTest.php | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index aa1f8b1c259a4..f294e2c2f55e1 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -209,14 +209,14 @@ private function getFullWhitelist() } /** - * Retrieves the lowest PHP version specified in <kbd>composer.json</var> of project. + * Retrieves the lowest and highest PHP version specified in <kbd>composer.json</var> of project. * - * @return string + * @return array */ - private function getLowestPhpVersion(): string + private function getTargetPhpVersions(): array { $composerJson = json_decode(file_get_contents(BP . '/composer.json'), true); - $phpVersion = '7.0'; + $versionsRange = []; if (isset($composerJson['require']['php'])) { $versions = explode('||', $composerJson['require']['php']); @@ -232,12 +232,17 @@ private function getLowestPhpVersion(): string //sort versions usort($versions, 'version_compare'); - $lowestVersion = array_shift($versions); - $versionParts = explode('.', $lowestVersion); - $phpVersion = sprintf('%s.%s', $versionParts[0], $versionParts[1] ?? '0'); + $versionsRange[] = array_shift($versions); + if (!empty($versions)) { + $versionsRange[] = array_pop($versions); + } + foreach ($versionsRange as $key => $version) { + $versionParts = explode('.', $versionsRange[$key]); + $versionsRange[$key] = sprintf('%s.%s', $versionParts[0], $versionParts[1] ?? '0'); + } } - return $phpVersion; + return $versionsRange; } /** @@ -408,7 +413,7 @@ public function testStrictTypes() */ public function testPhpCompatibility() { - $targetVersion = $this->getLowestPhpVersion(); + $targetVersions = $this->getTargetPhpVersions(); $reportFile = self::$reportDir . '/phpcompatibility_report.txt'; $rulesetDir = __DIR__ . '/_files/PHPCompatibilityMagento'; @@ -417,7 +422,11 @@ public function testPhpCompatibility() } $codeSniffer = new PhpCompatibility($rulesetDir, $reportFile, new Wrapper()); - $codeSniffer->setTestVersion($targetVersion); + if (count($targetVersions) > 1) { + $codeSniffer->setTestVersion($targetVersions[0] . '-' . $targetVersions[1]); + } else { + $codeSniffer->setTestVersion($targetVersions[0]); + } $result = $codeSniffer->run( $this->isFullScan() ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']) From c3e897c3516abcc43e80182310de0a21568b0f8a Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Wed, 2 Dec 2020 16:30:38 +0200 Subject: [PATCH 397/490] MC-36779: Product still present in the Wish List after added to order --- .../Magento/Sales/Model/AdminOrder/Create.php | 4 ++-- .../CreateOrderFromEditCustomerPageTest.xml | 13 ++++++------- .../view/adminhtml/web/order/create/scripts.js | 18 +++++++++++++++--- .../Adminhtml/Order/Create/LoadBlockTest.php | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index d7ddd423733a8..935d9111c489d 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -970,7 +970,7 @@ public function applySidebarData($data) $item = $this->getCustomerCart()->getItemById($itemId); if ($item) { $this->moveQuoteItem($item, 'order', $qty); - $data['remove'][$itemId] = 'cart'; + $this->removeItem($itemId, 'cart'); } } } @@ -984,7 +984,7 @@ public function applySidebarData($data) ); if ($item->getId()) { $this->addProduct($item->getProduct(), $item->getBuyRequest()->toArray()); - $data['remove'][$itemId] = 'wishlist'; + $this->removeItem($itemId, 'wishlist'); } } } diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 367c50359701c..89a5fe07ced6a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -136,15 +136,18 @@ <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList"/> <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList"/> - <!-- Add products to order from Wish List --> + <!-- Move products to order from Wish List --> <waitForElementVisible selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForCheckBoxToVisible"/> <click selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectProductToAddToOrder"/> + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> <click selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder($$createConfigProduct.name$$)}}" stepKey="AddConfigurableProductToOrder"/> <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" stepKey="waitForConfigurablePopover"/> <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> - <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> - <waitForPageLoad stepKey="waitForAdminOrderItemsOrderedSectionPageLoad1"/> + + <!-- After move, assert products are NOT present in Wish List section --> + <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$simpleProduct.name$" stepKey="dontSeeSimpleProductInWishList"/> + <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$createConfigProduct.name$" stepKey="dontSeeConfigurableProductInWishList"/> <!-- Assert Products in Order item section --> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid"/> @@ -171,10 +174,6 @@ <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="donSeeProductInShoppingCart"/> <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="dontSeeSecondProductInShoppingCart"/> - <!-- After move, assert products are present in Wish List section --> - <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList1"/> - <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList1"/> - <!-- After move, assert products are present in order items section --> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid1"/> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid1"/> diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index ba93f5f88c387..f90ad563331e6 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -942,7 +942,8 @@ define([ */ sidebarConfigureProduct: function (listType, productId, itemId) { // create additional fields - var params = {}; + var params = {}, + isWishlist = !!itemId; params.reset_shipping = true; params.add_product = productId; this.prepareParams(params); @@ -963,10 +964,18 @@ define([ }.bind(this)); // response handler productConfigure.setOnLoadIFrameCallback(listType, function (response) { + var area = ['items', 'shipping_method', 'billing_method', 'totals', 'giftmessage']; + if (!response.ok) { return; } - this.loadArea(['items', 'shipping_method', 'billing_method', 'totals', 'giftmessage'], true); + if (isWishlist) { + this.removeSidebarItem(itemId, 'wishlist').done(function () { + this.loadArea(area, true); + }.bind(this)); + } else { + this.loadArea(area, true); + } }.bind(this)); // show item configuration itemId = itemId ? itemId : productId; @@ -975,7 +984,10 @@ define([ }, removeSidebarItem: function (id, from) { - this.loadArea(['sidebar_' + from], 'sidebar_data_' + from, {remove_item: id, from: from}); + return this.loadArea(['sidebar_' + from], 'sidebar_data_' + from, { + remove_item: id, + from: from + }); }, itemsUpdate: function () { diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php index 104cc74ec1f9b..529b491269643 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlockTest.php @@ -225,7 +225,7 @@ public function testAddProductToOrderFromWishList(): void $params = $this->hydrateParams(); $this->dispatchWitParams($params, $post); - $wishlistItems->clear(); + $wishlistItems->clear()->load(); $this->assertEmpty($wishlistItems); $quoteItems = $this->session->getQuote()->getItemsCollection(); $this->assertCount(1, $quoteItems); From 8e1a0aef98b3e6fe3cb6c68c483ac0a22007cf46 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Wed, 2 Dec 2020 17:10:16 +0200 Subject: [PATCH 398/490] Removed usage or changed value of CliIndexerReindexActionGroup action group for Bundle, BundleImportExport, CatalogUrlRewrite, ConfigurableProduct modules --- .../Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml | 5 +---- .../Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml | 4 +--- .../Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml | 4 +--- ...frontAddBundleProductWithZeroPriceToShoppingCartTest.xml | 2 +- ...StorefrontCustomerSearchBundleProductsByKeywordsTest.xml | 2 +- .../Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml | 2 +- ...ynamicBundleProductPricesForCombinationOfOptionsTest.xml | 2 +- .../Test/Mftf/Test/UpdateBundleProductViaImportTest.xml | 6 ++---- .../Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml | 4 +--- .../Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml | 4 +--- .../Test/AdminCreateConfigurableProductWithImagesTest.xml | 5 +---- .../Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 4 +--- .../Test/StorefrontConfigurableProductChildSearchTest.xml | 4 +--- .../StorefrontConfigurableProductGridViewTest.xml | 4 +--- ...nfigurableProductChildAssignedToSeparateCategoryTest.xml | 4 +--- ...tingByPriceForConfigurableWithCatalogRuleAppliedTest.xml | 4 +--- ...efrontVerifyConfigurableProductLayeredNavigationTest.xml | 5 +---- .../Test/StorefrontVisibilityOfDuplicateProductTest.xml | 4 +--- 18 files changed, 19 insertions(+), 50 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml index f73941c375a41..8818fadc1d10c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml @@ -42,10 +42,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> - <!-- Reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml index 8b50fffec091f..6924e389451cd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml @@ -36,9 +36,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> <!-- TODO: Remove this action when MC-37719 will be fixed --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices"> - <argument name="indices" value="cataloginventory_stock"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index f8f98384ee8da..0474de1144f4e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -133,9 +133,7 @@ <click selector="{{AdminProductFiltersSection.enable}}" stepKey="ClickOnEnable"/> <!--Clear Cache - reindex - resets products according to enabled/disabled view--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index 93fac3171e9fb..b68171ba49825 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="apiSimple"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 5997cdc14ade8..52cd91385a4b2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -40,7 +40,7 @@ <requiredEntity createDataKey="createSimpleProductTwo"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml index 7049299987dff..d127f18355643 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml @@ -96,7 +96,7 @@ <!-- Perform CLI reindex --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 24c481c9ddcb2..3a7550b1484f0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -168,7 +168,7 @@ <see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml index 515c2bc56f067..6ddce634ec957 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -42,7 +42,7 @@ <argument name="tags" value="full_page"/> </actionGroup> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_product_price"/> </actionGroup> <!-- Check Bundle product is visible on the storefront--> @@ -63,9 +63,7 @@ <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterUpdate"> <argument name="tags" value="full_page"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterUpdate"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterUpdate"/> <!-- Check Bundle product is still visible on the storefront--> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPageAfterUpdate"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml index 776b5b9b70f33..783d9fa31c996 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterCreate"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index f8cd1760788a8..4915a17c738a4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -91,9 +91,7 @@ <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="seeConfigurationsPrice"/> <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Assert storefront category list page--> <amOnPage url="/" stepKey="amOnStorefront"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 120734d679d09..4984d296df5d0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -131,10 +131,7 @@ <!-- Save product --> <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index e34bf7c22f06b..1b8dffbd3ac68 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -78,9 +78,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index 4ad2d0dc936eb..ca3065c13ea67 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -144,9 +144,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml index e20a6dcfa09b8..81a083c5da068 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml @@ -27,9 +27,7 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value="eav"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml index 3519503c1e287..65ba89d5efb1f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml @@ -112,9 +112,7 @@ <argument name="categoryName" value="$$secondCategory.name$$"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexSearchIndex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexSearchIndex"/> <!-- Go to storefront to view child product --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToSecondCategoryStorefront"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index 363a8ea4d4fd6..9cbe134116e51 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -153,9 +153,7 @@ <argument name="discountAmount" value="{{CatalogRuleByPercentWith96Amount.discount_amount}}"/> </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexIndices"> - <argument name="indices" value="catalogsearch_fulltext catalog_category_product catalog_product_price catalogrule_rule"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexIndices"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="fullCache"> <argument name="tags" value="full_page"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 9b046d5c71cfc..c5a40be952e2a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -136,10 +136,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Open Category in Store Front and select product attribute option from sidebar --> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="selectStorefrontProductAttributeOption"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 79705e679fb78..8cd4489ba2a36 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -192,9 +192,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateConfigsForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> From c6b97a0d210acbcd3863917b48e65c9dc7f1ac77 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 2 Dec 2020 09:26:31 -0600 Subject: [PATCH 399/490] MC-29335: Missing paid orders and lock wait timeouts in Guest Checkout --- .../Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 36e70d4f80561..18de326a2919d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -102,6 +102,12 @@ <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/> + <!-- Start the usage processing consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue1"> + <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> + </actionGroup> + <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> @@ -143,7 +149,7 @@ <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage1"/> <!-- Start the usage processing consumer --> - <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue"> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue2"> <argument name="consumerName" value="{{SalesRuleConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{SalesRuleConsumerData.messageLimit}}"/> </actionGroup> From 5bcb9dbf3c92e9f57d970f8e4e3983b37c63659c Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Wed, 2 Dec 2020 11:29:28 -0600 Subject: [PATCH 400/490] MC-38765: Ensure there are no split db specific tests --- .../setup-integration/etc/install-config-mysql.php.dist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/setup-integration/etc/install-config-mysql.php.dist b/dev/tests/setup-integration/etc/install-config-mysql.php.dist index b9b1182657188..21511695fa092 100644 --- a/dev/tests/setup-integration/etc/install-config-mysql.php.dist +++ b/dev/tests/setup-integration/etc/install-config-mysql.php.dist @@ -20,16 +20,16 @@ return [ 'enable-modules' => 'Magento_TestSetupModule2,Magento_TestSetupModule1,Magento_Backend', 'disable-modules' => 'all' ], - 'shard_two' => [ + 'shard_one' => [ 'host' => '{{db-host}}', 'username' => '{{db-user}}', 'password' => '{{db-password}}', - 'dbname' => '{{db-shardone}}' + 'dbname' => '{{db-sales}}' ], - 'shard_one' => [ + 'shard_two' => [ 'host' => '{{db-host}}', 'username' => '{{db-user}}', 'password' => '{{db-password}}', - 'dbname' => '{{db-shardtwo}}' + 'dbname' => '{{db-checkout}}' ] ]; From 19c7e10ccb0b6b6f43dd7931394ca0156c756c8b Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Wed, 2 Dec 2020 23:03:56 +0530 Subject: [PATCH 401/490] Removed header from group product grid --- .../Ui/DataProvider/Product/Form/Modifier/Grouped.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php b/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php index 3ea8c6eb3c2b9..12a21a4ebd04b 100644 --- a/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php +++ b/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php @@ -562,6 +562,7 @@ protected function fillMeta() 'fit' => true, 'label' => __('Thumbnail'), 'sortOrder' => 20, + 'labelVisible' => false, ], ], ], @@ -586,6 +587,7 @@ protected function fillMeta() 'validation' => [ 'validate-number' => true, ], + 'labelVisible' => false, ], ], ], @@ -601,7 +603,8 @@ protected function fillMeta() 'elementTmpl' => 'Magento_GroupedProduct/components/position', 'sortOrder' => 90, 'fit' => true, - 'dataScope' => 'positionCalculated' + 'dataScope' => 'positionCalculated', + 'labelVisible' => false, ], ], ], @@ -660,6 +663,7 @@ protected function getTextColumn($dataScope, $fit, Phrase $label, $sortOrder) 'fit' => $fit, 'label' => $label, 'sortOrder' => $sortOrder, + 'labelVisible' => false, ], ], ], From 365ea4d89748b27b230c5de5dd83405006ce6b83 Mon Sep 17 00:00:00 2001 From: Max Lesechko <mlesechko@magento.com> Date: Wed, 2 Dec 2020 13:44:26 -0600 Subject: [PATCH 402/490] MC-38775: Send attributes into Launch Extension for Gainsight --- .../Magento/AdminAnalytics/view/adminhtml/layout/default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/AdminAnalytics/view/adminhtml/layout/default.xml b/app/code/Magento/AdminAnalytics/view/adminhtml/layout/default.xml index 7e379a17c78d7..8fcda98e604bc 100644 --- a/app/code/Magento/AdminAnalytics/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminAnalytics/view/adminhtml/layout/default.xml @@ -10,7 +10,7 @@ <referenceContainer name="header"> <block name="tracking" as="tracking" template="Magento_AdminAnalytics::tracking.phtml" ifconfig="admin/usage/enabled"> <arguments> - <argument name="tracking_url" xsi:type="string">//assets.adobedtm.com/launch-EN30eb7ffa064444f1b8b0368ef38fd3a9.min.js</argument> + <argument name="tracking_url" xsi:type="string">//assets.adobedtm.com/a7d65461e54e/37baabec1b6e/launch-177bc126c8e6.min.js</argument> <argument name="metadata" xsi:type="object">Magento\AdminAnalytics\ViewModel\Metadata</argument> </arguments> </block> From bd2fdad75e0749cf9c60db7b94b053fca2a18f9a Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Wed, 2 Dec 2020 14:25:26 -0600 Subject: [PATCH 403/490] MC-38765: Ensure there are no split db specific tests - remove extra comma --- .../TestSetupDeclarationModule2/fixture/shards.mysql8.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php index a73a33032a8d0..a461b42dacb9e 100644 --- a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php +++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule2/fixture/shards.mysql8.php @@ -5,12 +5,12 @@ */ return [ 'test_table_one' => 'CREATE TABLE `test_table_one` ( - `smallint` smallint NOT NULL AUTO_INCREMENT,, + `smallint` smallint NOT NULL AUTO_INCREMENT, `varchar` varchar(254) DEFAULT NULL, PRIMARY KEY (`smallint`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8', 'test_table_two' => 'CREATE TABLE `test_table_two` ( - `smallint` smallint NOT NULL AUTO_INCREMENT,, + `smallint` smallint NOT NULL AUTO_INCREMENT, `varchar` varchar(254) DEFAULT NULL, PRIMARY KEY (`smallint`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8', From c06bb3d93d3f95f52d4723d686ed47bf86e29b0b Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Wed, 2 Dec 2020 14:25:26 -0600 Subject: [PATCH 404/490] MC-37484: Cart query error when trying to switch store view --- app/code/Magento/Quote/Model/PaymentMethodManagement.php | 2 +- .../Quote/Test/Unit/Model/PaymentMethodManagementTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Quote/Model/PaymentMethodManagement.php b/app/code/Magento/Quote/Model/PaymentMethodManagement.php index d6768fe31ecb2..b6e4bcf5ccc8f 100644 --- a/app/code/Magento/Quote/Model/PaymentMethodManagement.php +++ b/app/code/Magento/Quote/Model/PaymentMethodManagement.php @@ -83,7 +83,7 @@ public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method) throw new InvalidTransitionException(__('The requested Payment Method is not available.')); } - $this->quoteRepository->save($quote); + $quote->save(); return $quote->getPayment()->getId(); } diff --git a/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php index bc5b811bc9611..b9c7d8c93e724 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/PaymentMethodManagementTest.php @@ -136,7 +136,7 @@ public function testSetVirtualProduct() $quoteMock = $this->getMockBuilder(Quote::class) ->addMethods(['setTotalsCollectedFlag']) - ->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals']) + ->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals', 'save']) ->disableOriginalConstructor() ->getMock(); $this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock); @@ -189,7 +189,7 @@ public function testSetVirtualProduct() ->willReturn(true); $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf(); - $this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock); + $quoteMock->expects($this->once())->method('save')->willReturnSelf(); $paymentMock->expects($this->once())->method('getId')->willReturn($paymentId); $this->assertEquals($paymentId, $this->model->set($cartId, $methodMock)); @@ -267,7 +267,7 @@ public function testSetSimpleProduct() $quoteMock = $this->getMockBuilder(Quote::class) ->addMethods(['setTotalsCollectedFlag']) - ->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals']) + ->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals', 'save']) ->disableOriginalConstructor() ->getMock(); $this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock); @@ -324,7 +324,7 @@ public function testSetSimpleProduct() ->willReturn(true); $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf(); - $this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock); + $quoteMock->expects($this->once())->method('save')->willReturnSelf(); $paymentMock->expects($this->once())->method('getId')->willReturn($paymentId); $this->assertEquals($paymentId, $this->model->set($cartId, $methodMock)); From 9776a93623f9619a4806900c21964dc0a0a997fc Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Wed, 2 Dec 2020 15:06:19 -0600 Subject: [PATCH 405/490] MC-38765: Ensure there are no split db specific tests - change method name --- .../framework/Magento/TestFramework/Deploy/ShardingConfig.php | 4 ++-- .../testsuite/Magento/Setup/ShardingTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php index 8a6a03a3ef1dc..f22b578301264 100644 --- a/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php +++ b/dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ShardingConfig.php @@ -35,9 +35,9 @@ public function __construct(ConfigWriter $configWriter, ConfigReader $configRead } /** - * Add sharding database connection to env file + * Apply sharding database connection to env file */ - public function addConfiguration() + public function applyConfiguration() { $allDbData = include TESTS_INSTALLATION_DB_CONFIG_FILE; $config = $this->configReader->load(ConfigFilePool::APP_ENV); diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php index 548e1278fa0f0..ed219fb89a56f 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/ShardingTest.php @@ -67,7 +67,7 @@ protected function setUp(): void */ public function testInstall() { - $this->shardingConfig->addConfiguration(); + $this->shardingConfig->applyConfiguration(); $this->cliCommand->install(['Magento_TestSetupDeclarationModule2']); $this->deploymentConfig->resetData(); @@ -87,7 +87,7 @@ public function testInstall() */ public function testUpgrade() { - $this->shardingConfig->addConfiguration(); + $this->shardingConfig->applyConfiguration(); $this->cliCommand->install(['Magento_TestSetupDeclarationModule2']); $this->deploymentConfig->resetData(); $this->cliCommand->upgrade(); From a5528ab8a98a5f978be42c1fcbcc833e330e518d Mon Sep 17 00:00:00 2001 From: Ievgen Kolesov <ikolesov@adobe.com> Date: Wed, 2 Dec 2020 18:13:42 -0600 Subject: [PATCH 406/490] PWA-1107: GraphQL returns null for empty Category URL Suffix value --- .../Bootstrap/WebapiDocBlock.php | 2 +- .../CatalogUrlRewrite/UrlResolverTest.php | 6 ++---- ...product_with_category_empty_url_suffix.php | 19 +++++++++++++++++++ ...ith_category_empty_url_suffix_rollback.php | 19 +++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix_rollback.php diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php index 6bc242c194ba0..7b7047d1aceba 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php @@ -32,8 +32,8 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati unset($subscribers[$key]); } } - $subscribers[] = new ApiConfigFixture(); $subscribers[] = new \Magento\TestFramework\Annotation\ApiDataFixture(); + $subscribers[] = new ApiConfigFixture(); return $subscribers; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index d8e9f02990a94..618a2789b369a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -459,8 +459,7 @@ public function testGetNonExistentUrlRewrite() /** * Test for category entity with empty url suffix * - * @magentoConfigFixture default_store catalog/seo/category_url_suffix - * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php */ public function testCategoryUrlResolverWithEmptyUrlSuffix() { @@ -470,8 +469,7 @@ public function testCategoryUrlResolverWithEmptyUrlSuffix() /** * Tests if target_path(relative_url) is resolved for Product entity with empty url suffix * - * @magentoConfigFixture default_store catalog/seo/product_url_suffix - * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php */ public function testProductUrlResolverWithEmptyUrlSuffix() { diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php new file mode 100644 index 0000000000000..30d1b7512a11a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\App\Config\ConfigResource\ConfigInterface; +use Magento\Framework\App\Config\ReinitableConfigInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ConfigInterface $config */ +$config = $objectManager->get(ConfigInterface::class); +$config->saveConfig('catalog/seo/product_url_suffix', null); +$config->saveConfig('catalog/seo/category_url_suffix', null); +$objectManager->get(ReinitableConfigInterface::class)->reinit(); + +Resolver::getInstance()->requireDataFixture('Magento/CatalogUrlRewrite/_files/product_with_category.php'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix_rollback.php new file mode 100644 index 0000000000000..5cf753e04ca7b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix_rollback.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\App\Config\ConfigResource\ConfigInterface; +use Magento\Framework\App\Config\ReinitableConfigInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ConfigInterface $config */ +$config = $objectManager->get(ConfigInterface::class); +$config->deleteConfig('catalog/seo/product_url_suffix'); +$config->deleteConfig('catalog/seo/category_url_suffix'); +$objectManager->get(ReinitableConfigInterface::class)->reinit(); + +Resolver::getInstance()->requireDataFixture('Magento/CatalogUrlRewrite/_files/product_with_category_rollback.php'); From 3a7a5ab97e5170073c72a1b47fdd1ddc8aaef565 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 2 Dec 2020 21:30:48 -0600 Subject: [PATCH 407/490] MC-38340: GraphQL code changes for a consistent object uid - changes to docs --- .../Magento/BundleGraphQl/etc/schema.graphqls | 16 ++++----- .../CatalogGraphQl/etc/schema.graphqls | 34 +++++++++---------- .../etc/schema.graphqls | 12 +++---- .../DirectoryGraphQl/etc/schema.graphqls | 4 +-- .../DownloadableGraphQl/etc/schema.graphqls | 4 +-- app/code/Magento/GraphQl/etc/schema.graphqls | 2 +- .../Magento/QuoteGraphQl/etc/schema.graphqls | 20 +++++------ .../Magento/SalesGraphQl/etc/schema.graphqls | 18 +++++----- .../UrlRewriteGraphQl/etc/schema.graphqls | 2 +- .../WishlistGraphQl/etc/schema.graphqls | 10 +++--- 10 files changed, 61 insertions(+), 61 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 58d9dffdda5bc..8a60eb671b0b6 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -33,7 +33,7 @@ type BundleCartItem implements CartItemInterface { type SelectedBundleOption { id: Int! @deprecated(reason: "Use `uid` instead") - uid: ID! @doc(description: "The unique identifier of the selected bundle option.") + uid: ID! @doc(description: "The unique ID for a `SelectedBundleOption` object") label: String! type: String! values: [SelectedBundleOptionValue!]! @@ -41,7 +41,7 @@ type SelectedBundleOption { type SelectedBundleOptionValue { id: Int! @doc(description: "Use `uid` instead") - uid: ID! @doc(description: "The unique identifier of the selected bundle option value.") + uid: ID! @doc(description: "The unique ID for a `SelectedBundleOptionValue` object") label: String! quantity: Float! price: Float! @@ -49,7 +49,7 @@ type SelectedBundleOptionValue { type BundleItem @doc(description: "BundleItem defines an individual item in a bundle product.") { option_id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "An ID assigned to each type of item in a bundle product.") - uid: ID @doc(description: "The unique identifier of the bundle item product.") + uid: ID @doc(description: "The unique ID for a `BundleItem` object.") title: String @doc(description: "The display name of the item.") required: Boolean @doc(description: "Indicates whether the item must be included in the bundle.") type: String @doc(description: "The input type that the customer uses to select the item. Examples include radio button and checkbox.") @@ -69,7 +69,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.") can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.") product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") - uid: ID! @doc(description: "The unique identifier of the bundle item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") + uid: ID! @doc(description: "The unique ID for a `BundleItemOption` object.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") } type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") { @@ -108,15 +108,15 @@ type BundleCreditMemoItem implements CreditMemoItemInterface { } type ItemSelectedBundleOption @doc(description: "A list of options of the selected bundle product") { - id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique identifier of the option") - uid: ID! @doc(description: "The unique identifier of the selected bundle option item") + id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique ID for a `ItemSelectedBundleOption` object") + uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOption` object") label: String! @doc(description: "The label of the option") values: [ItemSelectedBundleOptionValue] @doc(description: "A list of products that represent the values of the parent option") } type ItemSelectedBundleOptionValue @doc(description: "A list of values for the selected bundle product") { - id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique identifier of the value") - uid: ID! @doc(description: "The unique identifier of the selected bundle item option value") + id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object") + uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object") product_name: String! @doc(description: "The name of the child bundle product") product_sku: String! @doc(description: "The SKU of the child bundle product") quantity: Float! @doc(description: "Indicates how many of this bundle product were ordered") diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 17d040d622deb..8b36a490d1aea 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -84,7 +84,7 @@ interface ProductLinksInterface @typeResolver(class: "Magento\\CatalogGraphQl\\M interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes.") { id: Int @deprecated(reason: "Use the `uid` field instead.") @doc(description: "The ID number assigned to the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToId") - uid: ID! @doc(description: "Unique identifier from objects implementing `ProductInterface`.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToUid") + uid: ID! @doc(description: "The unique ID for a `ProductInterface` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToUid") name: String @doc(description: "The product name. Customers use this name to identify the product.") sku: String @doc(description: "A number or code assigned to a product to identify the product, options, price, and manufacturer.") description: ComplexTextValue @doc(description: "Detailed information about the product. The value can include simple HTML tags.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute") @@ -133,7 +133,7 @@ type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") max_characters: Int @doc(description: "The maximum number of characters that can be entered for this customizable option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableAreaValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CategoryTree implements CategoryInterface @doc(description: "Category Tree implementation.") { @@ -155,7 +155,7 @@ type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableDateValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CustomizableDropDownOption implements CustomizableOptionInterface @doc(description: "CustomizableDropDownOption contains information about a drop down menu that is defined as part of a customizable option.") { @@ -169,7 +169,7 @@ type CustomizableDropDownValue @doc(description: "CustomizableDropDownValue defi sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the option is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableDropDownValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type CustomizableMultipleOption implements CustomizableOptionInterface @doc(description: "CustomizableMultipleOption contains information about a multiselect that is defined as part of a customizable option.") { @@ -183,7 +183,7 @@ type CustomizableMultipleValue @doc(description: "CustomizableMultipleValue defi sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the option is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableMultipleValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type CustomizableFieldOption implements CustomizableOptionInterface @doc(description: "CustomizableFieldOption contains information about a text field that is defined as part of a customizable option.") { @@ -196,7 +196,7 @@ type CustomizableFieldValue @doc(description: "CustomizableFieldValue defines th price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") max_characters: Int @doc(description: "The maximum number of characters that can be entered for this customizable option.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableFieldValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } type CustomizableFileOption implements CustomizableOptionInterface @doc(description: "CustomizableFileOption contains information about a file picker that is defined as part of a customizable option.") { @@ -211,7 +211,7 @@ type CustomizableFileValue @doc(description: "CustomizableFileValue defines the file_extension: String @doc(description: "The file extension to accept.") image_size_x: Int @doc(description: "The maximum width of an image.") image_size_y: Int @doc(description: "The maximum height of an image.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableFileValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } interface MediaGalleryInterface @doc(description: "Contains basic information about a product image or video.") @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\MediaGalleryTypeResolver") { @@ -233,7 +233,7 @@ interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGrap required: Boolean @doc(description: "Indicates whether the option is required.") sort_order: Int @doc(description: "The order in which the option is displayed.") option_id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "Option ID.") - uid: ID! @doc(description: "Unique identifier for `CustomizableOptionInterface` object.") + uid: ID! @doc(description: "The unique ID for a `CustomizableOptionInterface` object.") } interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "CustomizableProductInterface contains information about customizable product options.") { @@ -242,7 +242,7 @@ interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGra interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CategoryInterfaceTypeResolver") @doc(description: "CategoryInterface contains the full set of attributes that can be returned in a category search.") { id: Int @deprecated(reason: "Use the `uid` argument instead.") @doc(description: "An ID that uniquely identifies the category.") - uid: ID! @doc(description: "Unique identifier from objects implementing `CategoryInterface`.") + uid: ID! @doc(description: "The unique ID for a `CategoryInterface` object.") description: String @doc(description: "An optional description of the category.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoryHtmlAttribute") name: String @doc(description: "The display name of the category.") path: String @doc(description: "Category Path.") @@ -266,7 +266,7 @@ interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model type Breadcrumb @doc(description: "Breadcrumb item.") { category_id: Int @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Category ID.") - category_uid: ID! @doc(description: "Unique identifier from objects implementing `CategoryInterface`.") + category_uid: ID! @doc(description: "The unique ID for a `Breadcrumb` object.") category_name: String @doc(description: "Category name.") category_level: Int @doc(description: "Category level.") category_url_key: String @doc(description: "Category URL key.") @@ -284,7 +284,7 @@ type CustomizableRadioValue @doc(description: "CustomizableRadioValue defines th sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the radio button is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableRadioValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type CustomizableCheckboxOption implements CustomizableOptionInterface @doc(description: "CustomizableCheckbbixOption contains information about a set of checkbox values that are defined as part of a customizable option.") { @@ -298,7 +298,7 @@ type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defi sku: String @doc(description: "The Stock Keeping Unit for this option.") title: String @doc(description: "The display name for this option.") sort_order: Int @doc(description: "The order in which the checkbox value is displayed.") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") + uid: ID! @doc(description: "The unique ID for a `CustomizableCheckboxValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } type VirtualProduct implements ProductInterface, CustomizableProductInterface @doc(description: "A virtual product is non-tangible product that does not require shipping and is not kept in inventory.") { @@ -325,14 +325,14 @@ type CategoryProducts @doc(description: "The category products object returned i input ProductAttributeFilterInput @doc(description: "ProductAttributeFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { category_id: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use `category_uid` to filter product by category id.") - category_uid: FilterEqualTypeInput @doc(description: "Filter product by category unique identifier from objects implementing `CategoryInterface`.") + category_uid: FilterEqualTypeInput @doc(description: "Filter product by the unique ID for a `CategoryInterface` object.") } input CategoryFilterInput @doc(description: "CategoryFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") - category_uid: FilterEqualTypeInput @doc(description: "Filter by category ID that uniquely identifies the category from objects implementing `CategoryInterface`.") - parent_id: FilterEqualTypeInput @doc(description: "Filter by parent category ID") + category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique category ID for a `CategoryInterface` object.") + parent_id: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") url_key: FilterEqualTypeInput @doc(description: "Filter by the part of the URL that identifies the category.") name: FilterMatchTypeInput @doc(description: "Filter by the display name of the category.") url_path: FilterEqualTypeInput @doc(description: "Filter by the URL path for the category.") @@ -433,7 +433,7 @@ input ProductAttributeSortInput @doc(description: "ProductAttributeSortInput spe type MediaGalleryEntry @doc(description: "MediaGalleryEntry defines characteristics about images and videos associated with a specific product.") { id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The identifier assigned to the object.") - uid: ID! @doc(description: "Unique Identifier for `MediaGalleryEntry` objects.") + uid: ID! @doc(description: "The unique ID for a `MediaGalleryEntry` object.") media_type: String @doc(description: "image or video.") label: String @doc(description: "The alt text displayed on the UI when the user points to the image.") position: Int @doc(description: "The media item's position after it has been sorted.") @@ -499,7 +499,7 @@ type StoreConfig @doc(description: "The type contains information about a store list_per_page : Int @doc(description: "Products per Page on List Default Value.") catalog_default_sort_by : String @doc(description: "Default Sort By.") root_category_id: Int @deprecated(reason: "Use `root_category_uid` instead") @doc(description: "The ID of the root category") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryId") - root_category_uid: ID @doc(description: "Unique Identifier for the root category object implementing `CategoryInterface`.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryUid") + root_category_uid: ID @doc(description: "The unique ID for a `CategoryInterface` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryUid") } type SimpleWishlistItem implements WishlistItemInterface @doc(description: "A simple product wish list Item") { diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 3d28eae9b41d7..024efb3aeceb9 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -19,15 +19,15 @@ type ConfigurableAttributeOption @doc(description: "ConfigurableAttributeOption label: String @doc(description: "A string that describes the configurable attribute option") code: String @doc(description: "The ID assigned to the attribute") value_index: Int @doc(description: "A unique index number assigned to the configurable product option") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") + uid: ID! @doc(description: "The unique ID for a `ConfigurableAttributeOption` object") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") } type ConfigurableProductOptions @doc(description: "ConfigurableProductOptions defines configurable attributes for the specified product") { id: Int @deprecated(reason: "Use uid instead") @doc(description: "The configurable option ID number assigned by the system") - uid: ID! @doc(description: "Unique identifier for `ConfigurableProductOptions` option object") + uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object") attribute_id: String @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") attribute_id_v2: Int @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") - attribute_uid: ID! @doc(description: "The unique UID assigned to the attribute") + attribute_uid: ID! @doc(description: "The unique ID for a `Attribute` object") attribute_code: String @doc(description: "A string that identifies the attribute") label: String @doc(description: "A string that describes the configurable product option, which is displayed on the UI") position: Int @doc(description: "A number that indicates the order in which the attribute is displayed") @@ -38,7 +38,7 @@ type ConfigurableProductOptions @doc(description: "ConfigurableProductOptions de type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOptionsValues contains the index number assigned to a configurable product option") { value_index: Int @deprecated(reason: "Use `uid` instead") @doc(description: "A unique index number assigned to the configurable product option") - uid: ID @doc(description: "A unique uid assigned to the configurable product option value") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") + uid: ID @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") label: String @doc(description: "The label of the product") default_label: String @doc(description: "The label of the product on the default store") store_label: String @doc(description: "The label of the product on the current store") @@ -68,10 +68,10 @@ type ConfigurableCartItem implements CartItemInterface { type SelectedConfigurableOption { id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_uid instead") - configurable_product_option_uid: ID! @doc(description: "Unique identifier for the selected configurable option object") + configurable_product_option_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object") option_label: String! value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_value_uid instead") - configurable_product_option_value_uid: ID! @doc(description: "Unique identifier for the option value of the `SelectedConfigurableOption` object") + configurable_product_option_value_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object") value_label: String! } diff --git a/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls b/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls index 6daf13f567d4b..06d7d4817ee02 100644 --- a/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls @@ -24,7 +24,7 @@ type ExchangeRate { } type Country { - id: String + id: String @doc(description: "The unique ID for a `Country` object.") two_letter_abbreviation: String three_letter_abbreviation: String full_name_locale: String @@ -33,7 +33,7 @@ type Country { } type Region { - id: Int + id: Int @doc(description: "The unique ID for a `Region` object.") code: String name: String } diff --git a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls index 8248343fcb120..d8e9c9615b618 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls @@ -53,7 +53,7 @@ type DownloadableProductLinks @doc(description: "DownloadableProductLinks define link_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") sample_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") sample_file: String @deprecated(reason: "`sample_url` serves to get the downloadable sample") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") + uid: ID! @doc(description: "The unique ID for a `DownloadableProductLinks` object.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") } type DownloadableProductSamples @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product") { @@ -80,7 +80,7 @@ type DownloadableCreditMemoItem implements CreditMemoItemInterface { type DownloadableItemsLinks @doc(description: "DownloadableProductLinks defines characteristics of a downloadable product") { title: String @doc(description: "The display name of the link") sort_order: Int @doc(description: "A number indicating the sort order") - uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") + uid: ID! @doc(description: "The unique ID for a `DownloadableItemsLinks` object.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") } type DownloadableWishlistItem implements WishlistItemInterface @doc(description: "A downloadable product wish list item") { diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index c93c229a8cae9..65280ad1ad2aa 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -279,6 +279,6 @@ enum CurrencyEnum @doc(description: "The list of available currency codes") { } input EnteredOptionInput @doc(description: "Defines a customer-entered option") { - uid: ID! @doc(description: "Unique identifier for the `EnteredOptionInput` object") + uid: ID! @doc(description: "The unique ID for a `CustomizableFieldOption`, `CustomizableFileOption`, `CustomizableAreaOption`, etc. of `CustomizableOptionInterface` objects") value: String! @doc(description: "Text the customer entered") } diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index 84015be0f1913..bcbbb3dc97de3 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -53,7 +53,7 @@ input CartItemInput { sku: String! quantity: Float! parent_sku: String @doc(description: "For child products, the SKU of its parent product") - selected_options: [ID!] @doc(description: "The selected options for the base product, such as color or size") + selected_options: [ID!] @doc(description: "The selected options for the base product, such as color or size with unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `ConfigurableProductOptionsValues`, etc. objects") entered_options: [EnteredOptionInput!] @doc(description: "An array of entered options for the base product, such as personalization text") } @@ -74,7 +74,7 @@ input UpdateCartItemsInput { input CartItemUpdateInput { cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") - cart_item_uid: ID @doc(description: "Unique Identifier from objects implementing `CartItemInterface`") + cart_item_uid: ID @doc(description: "The unique ID for a `CartItemInterface` object") quantity: Float customizable_options: [CustomizableOptionInput!] } @@ -82,7 +82,7 @@ input CartItemUpdateInput { input RemoveItemFromCartInput { cart_id: String! cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") - cart_item_uid: ID @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") + cart_item_uid: ID @doc(description: "Required field. The unique ID for a `CartItemInterface` object") } input SetShippingAddressesOnCartInput { @@ -201,9 +201,9 @@ type PlaceOrderOutput { } type Cart { - id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The ID of the cart.") + id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The unique ID for a `Cart` object") items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") - applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") + applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead") applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") @@ -330,8 +330,8 @@ type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Car } interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { - id: String! @deprecated(reason: "Use CartItemInterface.uid instead") - uid: ID! @doc(description: "Unique identifier for the `CartItemInterface` object") + id: String! @deprecated(reason: "Use `uid` instead") + uid: ID! @doc(description: "The unique ID for a `CartItemInterface` object") quantity: Float! prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") product: ProductInterface! @@ -352,7 +352,7 @@ type CartItemPrices { type SelectedCustomizableOption { id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") - customizable_option_uid: ID! @doc(description: "Unique identifier for the `SelectedCustomizableOption` object") + customizable_option_uid: ID! @doc(description: "The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects") label: String! is_required: Boolean! values: [SelectedCustomizableOptionValue!]! @@ -361,7 +361,7 @@ type SelectedCustomizableOption { type SelectedCustomizableOptionValue { id: Int! @deprecated(reason: "Use SelectedCustomizableOptionValue.customizable_option_value_uid instead") - customizable_option_value_uid: ID! @doc(description: "Unique identifier for the `SelectedCustomizableOptionValue` object") + customizable_option_value_uid: ID! @doc(description: "The unique ID for a `CustomizableMultipleValue`, `CustomizableRadioValue`, `CustomizableCheckboxValue`, `CustomizableDropDownValue`, etc. objects") label: String! value: String! price: CartItemSelectedOptionValuePrice! @@ -374,7 +374,7 @@ type CartItemSelectedOptionValuePrice { } type Order { - order_number: String! + order_number: String! @doc(description: "The unique ID for a `Order` object.") order_id: String @deprecated(reason: "The order_id field is deprecated, use order_number instead.") } diff --git a/app/code/Magento/SalesGraphQl/etc/schema.graphqls b/app/code/Magento/SalesGraphQl/etc/schema.graphqls index 3544acd1564d0..8a76f51d78e79 100644 --- a/app/code/Magento/SalesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SalesGraphQl/etc/schema.graphqls @@ -39,7 +39,7 @@ type CustomerOrders @doc(description: "The collection of orders that match the c } type CustomerOrder @doc(description: "Contains details about each of the customer's orders") { - id: ID! @doc(description: "Unique identifier for the order") + id: ID! @doc(description: "The unique ID for a `CustomerOrder` object") order_date: String! @doc(description: "The date the order was placed") status: String! @doc(description: "The current status of the order") number: String! @doc(description: "The order number") @@ -65,7 +65,7 @@ type OrderAddress @doc(description: "OrderAddress contains detailed information lastname: String! @doc(description: "The family name of the person associated with the shipping/billing address") middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address") region: String @doc(description: "The state or province name") - region_id: ID @doc(description: "The unique ID for a pre-defined region") + region_id: ID @doc(description: "The unique ID for a `Region` object of a pre-defined region") country_code: CountryCodeEnum @doc(description: "The customer's country") street: [String!]! @doc(description: "An array of strings that define the street number and name") company: String @doc(description: "The customer's company") @@ -79,7 +79,7 @@ type OrderAddress @doc(description: "OrderAddress contains detailed information } interface OrderItemInterface @doc(description: "Order item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\OrderItem") { - id: ID! @doc(description: "The unique identifier of the order item") + id: ID! @doc(description: "The unique ID for a `OrderItemInterface` object") product_name: String @doc(description: "The name of the base product") product_sku: String! @doc(description: "The SKU of the base product") product_url_key: String @doc(description: "URL key of the base product") @@ -123,7 +123,7 @@ type OrderTotal @doc(description: "Contains details about the sales total amount } type Invoice @doc(description: "Invoice details") { - id: ID! @doc(description: "The ID of the invoice, used for API purposes") + id: ID! @doc(description: "The unique ID for a `Invoice` object") number: String! @doc(description: "Sequential invoice number") total: InvoiceTotal @doc(description: "Invoice total amount details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceTotal") items: [InvoiceItemInterface] @doc(description: "Invoiced product details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceItems") @@ -131,7 +131,7 @@ type Invoice @doc(description: "Invoice details") { } interface InvoiceItemInterface @doc(description: "Invoice item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\InvoiceItem") { - id: ID! @doc(description: "The unique ID of the invoice item") + id: ID! @doc(description: "The unique ID for a `InvoiceItemInterface` object") order_item: OrderItemInterface @doc(description: "Contains details about an individual order item") product_name: String @doc(description: "The name of the base product") product_sku: String! @doc(description: "The SKU of the base product") @@ -167,7 +167,7 @@ type ShippingDiscount @doc(description:"Defines an individual shipping discount. } type OrderShipment @doc(description: "Order shipment details") { - id: ID! @doc(description: "The unique ID of the shipment") + id: ID! @doc(description: "The unique ID for a `OrderShipment` object") number: String! @doc(description: "The sequential credit shipment number") tracking: [ShipmentTracking] @doc(description: "Contains shipment tracking details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentTracking") items: [ShipmentItemInterface] @doc(description: "Contains items included in the shipment") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentItems") @@ -180,7 +180,7 @@ type SalesCommentItem @doc(description: "Comment item details") { } interface ShipmentItemInterface @doc(description: "Order shipment item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\ShipmentItem"){ - id: ID! @doc(description: "Shipment item unique identifier") + id: ID! @doc(description: "The unique ID for a `ShipmentItemInterface` object") order_item: OrderItemInterface @doc(description: "Associated order item") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") product_name: String @doc(description: "Name of the base product") product_sku: String! @doc(description: "SKU of the base product") @@ -204,7 +204,7 @@ type OrderPaymentMethod @doc(description: "Contains details about the payment me } type CreditMemo @doc(description: "Credit memo details") { - id: ID! @doc(description: "The unique ID of the credit memo, used for API purposes") + id: ID! @doc(description: "The unique ID for a `CreditMemo` object") number: String! @doc(description: "The sequential credit memo number") items: [CreditMemoItemInterface] @doc(description: "An array containing details about refunded items") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoItems") total: CreditMemoTotal @doc(description: "Contains details about the total refunded amount") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoTotal") @@ -212,7 +212,7 @@ type CreditMemo @doc(description: "Credit memo details") { } interface CreditMemoItemInterface @doc(description: "Credit memo item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\CreditMemoItem") { - id: ID! @doc(description: "The unique ID of the credit memo item, used for API purposes") + id: ID! @doc(description: "The unique ID for a `CreditMemoItemInterface` object") order_item: OrderItemInterface @doc(description: "The order item the credit memo is applied to") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") product_name: String @doc(description: "The name of the base product") product_sku: String! @doc(description: "SKU of the base product") diff --git a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls index 11f5129a50736..7000f52d7d683 100644 --- a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls @@ -7,7 +7,7 @@ type Query { type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") { id: Int @deprecated(reason: "Use `entity_uid` instead.") @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") - entity_uid: ID @doc(description: "The unique identifier assigned to the object associated with the specified url. This could be a product UID, category UID, or cms page UID.") + entity_uid: ID @doc(description: "The unique ID for a `ProductInterface`, `CategoryInterface`, `CmsPage`, etc. object associated with the specified url. This could be a product UID, category UID, or cms page UID.") canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.") relative_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.") redirectCode: Int @doc(description: "301 or 302 HTTP code for url permanent or temporary redirect or 0 for the 200 no redirect") diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index dd80f54592780..5a44facb606ac 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -11,7 +11,7 @@ type Customer { currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1.") ): [Wishlist!]! @doc(description: "An array of wishlists. In Magento Open Source, customers are limited to one wish list. The number of wish lists is configurable for Magento Commerce") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlists") wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2`") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlistResolver") @doc(description: "Contains a customer's wish lists") @cache(cacheable: false) - wishlist_v2(id: ID!): Wishlist @doc(description: "Retrieve the specified wish list") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistById") + wishlist_v2(id: ID!): Wishlist @doc(description: "Retrieve the specified wish list identified by the unique ID for a `Wishlist` object") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistById") } type WishlistOutput @doc(description: "Deprecated: `Wishlist` type should be used instead") { @@ -23,7 +23,7 @@ type WishlistOutput @doc(description: "Deprecated: `Wishlist` type should be use } type Wishlist { - id: ID @doc(description: "Wishlist unique identifier") + id: ID @doc(description: "The unique ID for a `Wishlist` object") items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") items_v2( currentPage: Int = 1, @@ -35,7 +35,7 @@ type Wishlist { } interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Type\\WishlistItemType") { - id: ID! @doc(description: "The ID of the wish list item") + id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") quantity: Float! @doc(description: "The quantity of this wish list item") description: String @doc(description: "The description of the item") added_at: String! @doc(description: "The date and time the item was added to the wish list") @@ -49,7 +49,7 @@ type WishlistItems { } type WishlistItem { - id: Int @doc(description: "The wish list item ID") + id: Int @doc(description: "The unique ID for a `WishlistItem` object") qty: Float @doc(description: "The quantity of this wish list item"), description: String @doc(description: "The customer's comment about this item"), added_at: String @doc(description: "The time when the customer added the item to the wish list"), @@ -81,7 +81,7 @@ type RemoveProductsFromWishlistOutput @doc(description: "Contains the customer's } input WishlistItemUpdateInput @doc(description: "Defines updates to items in a wish list") { - wishlist_item_id: ID! @doc(description: "The ID of the wishlist item to update") + wishlist_item_id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") quantity: Float @doc(description: "The new amount or number of this item") description: String @doc(description: "Customer-entered comments about the item") selected_options: [ID!] @doc(description: "An array of strings corresponding to options the customer selected") From d4e1641188e841885329fa2a8adb0cefd4b44879 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 3 Dec 2020 13:35:51 +0200 Subject: [PATCH 408/490] refactored AdminApplyTierPriceToProductWithPercentageDiscountTest --- .../Catalog/Test/Mftf/Data/TierPriceData.xml | 6 +++ ...iceToProductWithPercentageDiscountTest.xml | 43 +++++++++++++------ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml index 731754ef01959..b763fda489b20 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml @@ -80,4 +80,10 @@ <data key="quantity">1</data> <var key="sku" entityType="product" entityKey="sku" /> </entity> + <entity name="tierPrice01PercentDiscount" type="data"> + <data key="website">All Websites [USD]</data> + <data key="customer_group">ALL GROUPS</data> + <data key="price">0.1</data> + <data key="qty">1</data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 45284e69a54e0..37a7e461c2869 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -23,6 +23,7 @@ <requiredEntity createDataKey="createCategory"/> <field key="price">100</field> </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminInBefore"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> @@ -31,29 +32,45 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="1" stepKey="fillProductTierPriceQtyInput"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> + <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> + + <actionGroup ref="AdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="selectProductTierPricePriceInput"> + <argument name="website" value="{{tierPrice01PercentDiscount.website}}"/> + <argument name="customerGroup" value="{{tierPrice01PercentDiscount.customer_group}}"/> + <argument name="quantity" value="{{tierPrice01PercentDiscount.qty}}"/> + <argument name="priceType" value="Discount"/> + <argument name="amount" value="{{tierPrice01PercentDiscount.price}}"/> + </actionGroup> + + <actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="clickDoneButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront"> + <argument name="productUrl" value="$$createSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceProductPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountProductPage"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabelCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountCategoryPage"/> From 00fa24651f2c7c61b7bc78f2b74173ae22633dda Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Thu, 3 Dec 2020 13:36:16 +0200 Subject: [PATCH 409/490] Updated value of CliIndexerReindexActionGroup action for failed test --- ...orefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml | 2 +- .../StorefrontCustomerSearchBundleProductsByKeywordsTest.xml | 3 ++- ...fyDynamicBundleProductPricesForCombinationOfOptionsTest.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index b68171ba49825..88f992e698181 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="apiSimple"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 52cd91385a4b2..f7bce778cc0d8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -39,8 +39,9 @@ <requiredEntity createDataKey="fixedBundleOption"/> <requiredEntity createDataKey="createSimpleProductTwo"/> </createData> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 3a7550b1484f0..927cebdf7e508 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -168,7 +168,7 @@ <see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> From fe39fba308b4be8b320dda5d84a50af5919a931a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 3 Dec 2020 13:43:05 +0200 Subject: [PATCH 410/490] added comment --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 37a7e461c2869..594eb320e439a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -44,6 +44,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From 55926f83b5517b4acf989b20029830187e4df8ca Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <svizev.igor@gmail.com> Date: Thu, 3 Dec 2020 16:58:52 +0200 Subject: [PATCH 411/490] Use magento coding standard 6 --- composer.lock | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/composer.lock b/composer.lock index f4ece70a22e62..6875d3644b76a 100644 --- a/composer.lock +++ b/composer.lock @@ -1459,12 +1459,6 @@ "BSD-3-Clause" ], "description": "Replace zendframework and zfcampus packages with their Laminas Project equivalents.", - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-05-20T13:45:39+00:00" }, { @@ -8461,21 +8455,21 @@ }, { "name": "magento/magento-coding-standard", - "version": "5", + "version": "6", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5" + "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/da46c5d57a43c950dfa364edc7f1f0436d5353a5", - "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", + "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", "shasum": "" }, "require": { "php": ">=5.6.0", - "squizlabs/php_codesniffer": "^3.4", + "squizlabs/php_codesniffer": "^3.5", "webonyx/graphql-php": ">=0.12.6 <1.0" }, "require-dev": { @@ -8496,7 +8490,7 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-11-04T22:08:27+00:00" + "time": "2020-12-03T14:41:54+00:00" }, { "name": "magento/magento2-functional-testing-framework", @@ -9560,20 +9554,6 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], "time": "2020-05-05T12:55:44+00:00" }, { @@ -9863,12 +9843,6 @@ "keywords": [ "timer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-04-20T06:00:37+00:00" }, { @@ -10013,16 +9987,6 @@ "testing", "xunit" ], - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-05-22T13:54:05+00:00" }, { @@ -12059,5 +12023,6 @@ "ext-zip": "*", "lib-libxml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } From 3163fae9967c1a429d6dde46d6c8133acc4b5f34 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Thu, 3 Dec 2020 09:56:39 -0600 Subject: [PATCH 412/490] MC-38951: Images positions are inconsistent across store-views if images were added in a store-view level - Fix images positions for default scope if image were added in store view level --- .../Model/Product/Gallery/CreateHandler.php | 39 ++++++++--- .../Model/Import/Product.php | 11 ++- .../Import/Product/MediaGalleryProcessor.php | 6 +- ...uteMediaGalleryManagementInterfaceTest.php | 18 +++-- .../Helper/Form/Gallery/ContentTest.php | 2 +- .../Block/Product/View/GalleryTest.php | 2 +- .../Product/Gallery/UpdateHandlerTest.php | 67 +++++++++++++++++++ 7 files changed, 126 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php index 5a9d53ce80cf8..7a1bd21d78182 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php @@ -267,29 +267,50 @@ protected function processNewAndExistingImages($product, array &$images) { foreach ($images as &$image) { if (empty($image['removed'])) { + $isNew = empty($image['value_id']); $data = $this->processNewImage($product, $image); - if (!$product->isObjectNew()) { - $this->resourceModel->deleteGalleryValueInStore( - $image['value_id'], - $product->getData($this->metadata->getLinkField()), - $product->getStoreId() - ); - } // Add per store labels, position, disabled $data['value_id'] = $image['value_id']; $data['label'] = isset($image['label']) ? $image['label'] : ''; - $data['position'] = isset($image['position']) ? (int)$image['position'] : 0; + $data['position'] = isset($image['position']) && $image['position'] !== '' + ? (int)$image['position'] + : null; $data['disabled'] = isset($image['disabled']) ? (int)$image['disabled'] : 0; $data['store_id'] = (int)$product->getStoreId(); $data[$this->metadata->getLinkField()] = (int)$product->getData($this->metadata->getLinkField()); - $this->resourceModel->insertGalleryValueInStore($data); + $this->saveGalleryStoreValue($product, $data); + if ($isNew && $data['store_id'] !== Store::DEFAULT_STORE_ID) { + $dataForDefaultScope = $data; + $dataForDefaultScope['store_id'] = Store::DEFAULT_STORE_ID; + $dataForDefaultScope['disabled'] = 0; + $dataForDefaultScope['label'] = null; + $this->saveGalleryStoreValue($product, $dataForDefaultScope); + } } } } + /** + * Save media gallery store value + * + * @param Product $product + * @param array $data + */ + private function saveGalleryStoreValue(Product $product, array $data): void + { + if (!$product->isObjectNew()) { + $this->resourceModel->deleteGalleryValueInStore( + $data['value_id'], + $data[$this->metadata->getLinkField()], + $data['store_id'] + ); + } + $this->resourceModel->insertGalleryValueInStore($data); + } + /** * Processes image as new. * diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 428961aa6ddf6..13b7cbc2dfd2a 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1807,7 +1807,7 @@ protected function _saveProducts() if ($column === self::COL_MEDIA_IMAGE) { $rowData[$column][] = $uploadedFile; } - $mediaGallery[$storeId][$rowSku][$uploadedFile] = [ + $mediaGalleryStoreData = [ 'attribute_id' => $this->getMediaGalleryAttributeId(), 'label' => isset($rowLabels[$column][$columnImageKey]) ? $rowLabels[$column][$columnImageKey] @@ -1817,6 +1817,15 @@ protected function _saveProducts() ? $imageHiddenStates[$columnImage] : '0', 'value' => $uploadedFile, ]; + $mediaGallery[$storeId][$rowSku][$uploadedFile] = $mediaGalleryStoreData; + // Add record for default scope if it does not exist + if (!($mediaGallery[Store::DEFAULT_STORE_ID][$rowSku][$uploadedFile] ?? [])) { + //Set label and disabled values to their default values + $mediaGalleryStoreData['label'] = null; + $mediaGalleryStoreData['disabled'] = 0; + $mediaGallery[Store::DEFAULT_STORE_ID][$rowSku][$uploadedFile] = $mediaGalleryStoreData; + } + } } } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php index d4694b72ba64f..c838688c1c4f8 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php @@ -12,6 +12,7 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\EntityManager\MetadataPool; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\Store\Model\Store; /** * Process and saves images during import. @@ -259,7 +260,10 @@ private function prepareMediaGalleryValueData( $position = $data['position']; $storeId = $data['store_id']; $mediaGalleryValueData[$index]['value_id'] = $productIdMediaValueIdMap[$productId][$value]; - $mediaGalleryValueData[$index]['position'] = $position + ($lastPositions[$storeId][$productId] ?? 0); + $lastPosition = $lastPositions[$storeId][$productId] + ?? $lastPositions[Store::DEFAULT_STORE_ID][$productId] + ?? 0; + $mediaGalleryValueData[$index]['position'] = $position + $lastPosition; unset($mediaGalleryValueData[$index]['value']); } return $mediaGalleryValueData; diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php index ba12a02cb5b1f..09987457e3c56 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php @@ -235,8 +235,8 @@ public function testCreateWithNotDefaultStoreId() $this->assertEquals($updatedImage['file'], $targetProduct->getData('image')); // No values for default store view were provided $this->assertNull($updatedImage['label_default']); - $this->assertNull($updatedImage['position_default']); - $this->assertNull($updatedImage['disabled_default']); + $this->assertEquals(1, $updatedImage['position_default']); + $this->assertEquals(0, $updatedImage['disabled_default']); } /** @@ -483,7 +483,9 @@ public function testCreateThrowsExceptionIfProvidedImageHasWrongMimeType() public function testCreateThrowsExceptionIfTargetProductDoesNotExist() { $this->expectException(\Exception::class); - $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.'); + $this->expectExceptionMessage( + 'The product that was requested doesn\'t exist. Verify the product and try again.' + ); $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media'; @@ -538,7 +540,9 @@ public function testCreateThrowsExceptionIfProvidedImageNameContainsForbiddenCha public function testUpdateThrowsExceptionIfTargetProductDoesNotExist() { $this->expectException(\Exception::class); - $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.'); + $this->expectExceptionMessage( + 'The product that was requested doesn\'t exist. Verify the product and try again.' + ); $this->updateServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media' . '/' . 'wrong-sku'; @@ -592,7 +596,9 @@ public function testUpdateThrowsExceptionIfThereIsNoImageWithGivenId() public function testDeleteThrowsExceptionIfTargetProductDoesNotExist() { $this->expectException(\Exception::class); - $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.'); + $this->expectExceptionMessage( + 'The product that was requested doesn\'t exist. Verify the product and try again.' + ); $this->deleteServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media/9999'; $requestData = [ @@ -782,6 +788,6 @@ public function testAddProductVideo() $this->assertEquals(1, $updatedImage['position']); $this->assertEquals(0, $updatedImage['disabled']); $this->assertStringStartsWith('/t/e/test_image', $updatedImage['file']); - $this->assertEquals($videoContent, array_intersect($updatedImage, $videoContent)); + $this->assertEquals($videoContent, array_intersect_key($updatedImage, $videoContent)); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php index 28c5d435cd038..56a07034bd490 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php @@ -206,7 +206,7 @@ public function imagesPositionStoreViewDataProvider(): array [ 'file' => '/m/a/magento_small_image.jpg', 'label' => null, - 'position' => null, + 'position' => 2, ], ] ], diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php index 2941349a94eaa..bcec3168c7885 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/GalleryTest.php @@ -462,7 +462,7 @@ public function imagesPositionStoreViewDataProvider(): array [ 'img' => '/media/catalog/product/m/a/magento_small_image.jpg', 'caption' => 'Simple Product', - 'position' => null, + 'position' => 2, ], ] ], diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php index 481ec6aeac0f2..f317b9bbf377e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php @@ -593,6 +593,73 @@ public function updateImageDataProvider(): array ]; } + /** + * Tests that images positions are inconsistent across store-views if images were added in a store-view level + * + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @magentoDataFixture Magento/Store/_files/second_store.php + * @return void + */ + public function testAddImageInStoreView(): void + { + $secondStoreId = (int)$this->storeRepository->get('fixture_second_store')->getId(); + $existingImagePath = '/m/a/magento_image.jpg'; + $newImagePath = '/m/a/magento_small_image.jpg'; + $product = $this->getProduct($secondStoreId); + $images = $product->getData('media_gallery')['images']; + $newImage = [ + 'file' => $newImagePath, + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ]; + $images[] = $newImage; + $product->setData('media_gallery', ['images' => $images]); + $this->updateHandler->execute($product); + $product = $this->getProduct(Store::DEFAULT_STORE_ID); + $expectedImages = [ + [ + 'file' => $existingImagePath, + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => $newImagePath, + 'label' => null, + 'position' => 2 + ], + ]; + $actualImages = array_map( + function (\Magento\Framework\DataObject $item) { + return $item->toArray(['file', 'label', 'position']); + }, + $product->getMediaGalleryImages()->getItems() + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + $product->cleanModelCache(); + $product = $this->getProduct($secondStoreId); + $expectedImages = [ + [ + 'file' => $existingImagePath, + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => $newImagePath, + 'label' => 'New Image Alt Text', + 'position' => 2 + ], + ]; + $actualImages = array_map( + function (\Magento\Framework\DataObject $item) { + return $item->toArray(['file', 'label', 'position']); + }, + $product->getMediaGalleryImages()->getItems() + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + } + /** * Check product image link and product image exist * From 17b213e942dada48f3ff01145f6bf60bf48ed2ce Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 3 Dec 2020 13:57:56 -0600 Subject: [PATCH 413/490] MC-38340: GraphQL code changes for a consistent object uid - change tests --- .../Resolver/ConfigurableCartItemOptions.php | 1 - .../Model/Resolver/EntityUrl.php | 15 +++++++++++++-- .../AddBundleProductToCartSingleMutationTest.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php index 3af45cdcdcea1..92f441f61249c 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -9,7 +9,6 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Helper\Product\Configuration; -use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php index 6430f71765fe4..a897086181d41 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php @@ -9,6 +9,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; @@ -36,16 +37,24 @@ class EntityUrl implements ResolverInterface */ private $redirectType; + /** + * @var Uid + */ + private $idEncoder; + /** * @param UrlFinderInterface $urlFinder * @param CustomUrlLocatorInterface $customUrlLocator + * @param Uid $idEncoder */ public function __construct( UrlFinderInterface $urlFinder, - CustomUrlLocatorInterface $customUrlLocator + CustomUrlLocatorInterface $customUrlLocator, + Uid $idEncoder ) { $this->urlFinder = $urlFinder; - $this->customUrlLocator = $customUrlLocator; + $this->cuxstomUrlLocator = $customUrlLocator; + $this->idEncoder = $idEncoder; } /** @@ -78,6 +87,7 @@ public function resolve( $relativeUrl = $finalUrlRewrite->getRequestPath(); $resultArray = $this->rewriteCustomUrls($finalUrlRewrite, $storeId) ?? [ 'id' => $finalUrlRewrite->getEntityId(), + 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), 'canonical_url' => $relativeUrl, 'relative_url' => $relativeUrl, 'redirectCode' => $this->redirectType, @@ -115,6 +125,7 @@ private function rewriteCustomUrls(UrlRewrite $finalUrlRewrite, int $storeId): ? ? $finalCustomUrlRewrite->getRequestPath() : $finalUrlRewrite->getRequestPath(); return [ 'id' => $finalUrlRewrite->getEntityId(), + 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), 'canonical_url' => $relativeUrl, 'relative_url' => $relativeUrl, 'redirectCode' => $finalCustomUrlRewrite->getRedirectType(), diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php index b2cc2e901efef..cb62cc0f75264 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php @@ -274,7 +274,7 @@ private function getProductQuery(string $sku): string items { sku option_id - option_uid + uid required type title From cb083e7182ed0525e0be342e5214e767b981af6a Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Thu, 3 Dec 2020 14:53:41 -0600 Subject: [PATCH 414/490] MC-38340: GraphQL code changes for a consistent object uid - change tests --- app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php index a897086181d41..0b372555fe4c2 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php @@ -53,7 +53,7 @@ public function __construct( Uid $idEncoder ) { $this->urlFinder = $urlFinder; - $this->cuxstomUrlLocator = $customUrlLocator; + $this->customUrlLocator = $customUrlLocator; $this->idEncoder = $idEncoder; } From 1ba4c874cf6b7e5641f0d49a27ba18537b558e05 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Thu, 3 Dec 2020 15:04:36 -0600 Subject: [PATCH 415/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs --- .../isRemoteShoppingAssistanceAllowed.php | 56 ++++++ .../Plugin/DataObjectHelperPlugin.php | 65 ++++++ .../Magento/LoginAsCustomerGraphQl/etc/di.xml | 13 ++ .../etc/schema.graphqls | 4 +- .../CreateCustomerV2Test.php | 188 ++++++++++++++++++ .../UpdateCustomerV2Test.php | 76 +++++++ 6 files changed, 401 insertions(+), 1 deletion(-) create mode 100755 app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/isRemoteShoppingAssistanceAllowed.php create mode 100644 app/code/Magento/LoginAsCustomerGraphQl/Plugin/DataObjectHelperPlugin.php create mode 100644 app/code/Magento/LoginAsCustomerGraphQl/etc/di.xml create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/CreateCustomerV2Test.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/UpdateCustomerV2Test.php diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/isRemoteShoppingAssistanceAllowed.php b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/isRemoteShoppingAssistanceAllowed.php new file mode 100755 index 0000000000000..6ab2a7386986d --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/isRemoteShoppingAssistanceAllowed.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomerGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\Resolver\Value; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled; + +/** + * Determines if the customer allows remote shopping assistance + */ +class isRemoteShoppingAssistanceAllowed implements ResolverInterface +{ + /** + * @var IsAssistanceEnabled + */ + private $isAssistanceEnabled; + + /** + * @param IsAssistanceEnabled $isAssistanceEnabled + */ + public function __construct( + IsAssistanceEnabled $isAssistanceEnabled + ) { + $this->isAssistanceEnabled = $isAssistanceEnabled; + } + + /** + * Determines if remote shopping assistance is allowed for the specified customer + * + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * @return Value|mixed|void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + return $this->isAssistanceEnabled->execute((int)$value['model']->getId()); + } +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/Plugin/DataObjectHelperPlugin.php b/app/code/Magento/LoginAsCustomerGraphQl/Plugin/DataObjectHelperPlugin.php new file mode 100644 index 0000000000000..b1c54c6d00df7 --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/Plugin/DataObjectHelperPlugin.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + + +namespace Magento\LoginAsCustomerGraphQl\Plugin; + + +use Magento\Customer\Api\Data\CustomerExtensionFactory; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\Api\DataObjectHelper; +use Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled; + +class DataObjectHelperPlugin +{ + /** + * @var CustomerExtensionFactory + */ + private $customerExtensionFactory; + + /** + * @param CustomerExtensionFactory $customerExtensionFactory + */ + public function __construct( + CustomerExtensionFactory $customerExtensionFactory + ) { + $this->customerExtensionFactory = $customerExtensionFactory; + } + + /** + * Add assistance_allowed extension attribute value to Customer instance. + * + * @param DataObjectHelper $subject + * @param DataObjectHelper $result + * @param mixed $dataObject + * @param array $data + * @param string $interfaceName + * @return DataObjectHelper + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterPopulateWithArray( + DataObjectHelper $subject, + DataObjectHelper $result, + Object $dataObject, + array $data, + string $interfaceName + ) { + if ($interfaceName === CustomerInterface::class + && array_key_exists('allow_remote_shopping_assistance', $data)) { + $isLoginAsCustomerEnabled = $data['allow_remote_shopping_assistance']; + $extensionAttributes = $dataObject->getExtensionAttributes(); + if (null === $extensionAttributes) { + $extensionAttributes = $this->customerExtensionFactory->create(); + } + $extensionAttributes->setAssistanceAllowed( + $isLoginAsCustomerEnabled ? IsAssistanceEnabled::ALLOWED : IsAssistanceEnabled::DENIED + ); + $dataObject->setExtensionAttributes($extensionAttributes); + } + return $result; + } +} diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/di.xml b/app/code/Magento/LoginAsCustomerGraphQl/etc/di.xml new file mode 100644 index 0000000000000..e98bc71d872ca --- /dev/null +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/di.xml @@ -0,0 +1,13 @@ +<?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\Framework\Api\DataObjectHelper"> + <plugin name="add_allow_remote_shopping_assistance_to_customer" + type="Magento\LoginAsCustomerGraphQl\Plugin\DataObjectHelperPlugin"/> + </type> +</config> diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls index 11157af0ca602..296f5b23a8b5f 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls @@ -18,7 +18,9 @@ type GenerateCustomerTokenAsAdminOutput { } type Customer { - allow_remote_shopping_assistance: Boolean! @doc(description: "Indicates whether the customer has enabled remote shopping assistance") + allow_remote_shopping_assistance: Boolean! + @resolver(class: "Magento\\LoginAsCustomerGraphQl\\Model\\Resolver\\isRemoteShoppingAssistanceAllowed") + @doc(description: "Indicates whether the customer has enabled remote shopping assistance") } input CustomerCreateInput { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/CreateCustomerV2Test.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/CreateCustomerV2Test.php new file mode 100644 index 0000000000000..57d5bbff1786d --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/CreateCustomerV2Test.php @@ -0,0 +1,188 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\LoginAsCustomerGraphQl; + +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Tests for create customer (V2) with allow_remote_shopping_assistance input/output + */ +class CreateCustomerV2Test extends GraphQlAbstract +{ + /** + * @var Registry + */ + private $registry; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + protected function setUp(): void + { + parent::setUp(); + + $this->registry = Bootstrap::getObjectManager()->get(Registry::class); + $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); + } + + /** + * Test setting allow_remote_shopping_assistance to true + * + * @throws \Exception + */ + public function testCreateCustomerAccountWithAllowTrue() + { + $newFirstname = 'Richard'; + $newLastname = 'Rowe'; + $currentPassword = 'test123#'; + $newEmail = 'new_customer@example.com'; + + $query = <<<QUERY +mutation { + createCustomerV2( + input: { + firstname: "{$newFirstname}" + lastname: "{$newLastname}" + email: "{$newEmail}" + password: "{$currentPassword}" + is_subscribed: true + allow_remote_shopping_assistance: true + } + ) { + customer { + id + firstname + lastname + email + is_subscribed + allow_remote_shopping_assistance + } + } +} +QUERY; + $response = $this->graphQlMutation($query); + + $this->assertNull($response['createCustomerV2']['customer']['id']); + $this->assertEquals($newFirstname, $response['createCustomerV2']['customer']['firstname']); + $this->assertEquals($newLastname, $response['createCustomerV2']['customer']['lastname']); + $this->assertEquals($newEmail, $response['createCustomerV2']['customer']['email']); + $this->assertTrue($response['createCustomerV2']['customer']['is_subscribed']); + $this->assertTrue($response['createCustomerV2']['customer']['allow_remote_shopping_assistance']); + } + + /** + * Test setting allow_remote_shopping_assistance to false + * + * @throws \Exception + */ + public function testCreateCustomerAccountWithAllowFalse() + { + $newFirstname = 'Richard'; + $newLastname = 'Rowe'; + $currentPassword = 'test123#'; + $newEmail = 'new_customer@example.com'; + + $query = <<<QUERY +mutation { + createCustomerV2( + input: { + firstname: "{$newFirstname}" + lastname: "{$newLastname}" + email: "{$newEmail}" + password: "{$currentPassword}" + is_subscribed: true + allow_remote_shopping_assistance: false + } + ) { + customer { + id + firstname + lastname + email + is_subscribed + allow_remote_shopping_assistance + } + } +} +QUERY; + $response = $this->graphQlMutation($query); + + $this->assertNull($response['createCustomerV2']['customer']['id']); + $this->assertEquals($newFirstname, $response['createCustomerV2']['customer']['firstname']); + $this->assertEquals($newLastname, $response['createCustomerV2']['customer']['lastname']); + $this->assertEquals($newEmail, $response['createCustomerV2']['customer']['email']); + $this->assertTrue($response['createCustomerV2']['customer']['is_subscribed']); + $this->assertFalse($response['createCustomerV2']['customer']['allow_remote_shopping_assistance']); + } + + /** + * Test omitting allow_remote_shopping_assistance + * + * @throws \Exception + */ + public function testCreateCustomerAccountWithoutAllow() + { + $newFirstname = 'Richard'; + $newLastname = 'Rowe'; + $currentPassword = 'test123#'; + $newEmail = 'new_customer@example.com'; + + $query = <<<QUERY +mutation { + createCustomerV2( + input: { + firstname: "{$newFirstname}" + lastname: "{$newLastname}" + email: "{$newEmail}" + password: "{$currentPassword}" + is_subscribed: true, + } + ) { + customer { + id + firstname + lastname + email + is_subscribed + allow_remote_shopping_assistance + } + } +} +QUERY; + $response = $this->graphQlMutation($query); + + $this->assertNull($response['createCustomerV2']['customer']['id']); + $this->assertEquals($newFirstname, $response['createCustomerV2']['customer']['firstname']); + $this->assertEquals($newLastname, $response['createCustomerV2']['customer']['lastname']); + $this->assertEquals($newEmail, $response['createCustomerV2']['customer']['email']); + $this->assertTrue($response['createCustomerV2']['customer']['is_subscribed']); + $this->assertFalse($response['createCustomerV2']['customer']['allow_remote_shopping_assistance']); + } + + protected function tearDown(): void + { + $newEmail = 'new_customer@example.com'; + try { + $customer = $this->customerRepository->get($newEmail); + } catch (\Exception $exception) { + return; + } + + $this->registry->unregister('isSecureArea'); + $this->registry->register('isSecureArea', true); + $this->customerRepository->delete($customer); + $this->registry->unregister('isSecureArea'); + $this->registry->register('isSecureArea', false); + parent::tearDown(); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/UpdateCustomerV2Test.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/UpdateCustomerV2Test.php new file mode 100644 index 0000000000000..f47f7c1d1c3db --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/UpdateCustomerV2Test.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\LoginAsCustomerGraphQl; + +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Tests for update customer (V2) with allow_remote_shopping_assistance input/output + */ +class UpdateCustomerV2Test extends GraphQlAbstract +{ + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + protected function setUp(): void + { + parent::setUp(); + + $this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class); + } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + */ + public function testUpdateCustomer(): void + { + $currentEmail = 'customer@example.com'; + $currentPassword = 'password'; + + $query = <<<QUERY +mutation { + updateCustomerV2( + input: { + allow_remote_shopping_assistance: true + } + ) { + customer { + allow_remote_shopping_assistance + } + } +} +QUERY; + $response = $this->graphQlMutation( + $query, + [], + '', + $this->getCustomerAuthHeaders($currentEmail, $currentPassword) + ); + + $this->assertTrue($response['updateCustomerV2']['customer']['allow_remote_shopping_assistance']); + } + + /** + * @param string $email + * @param string $password + * @return array + * @throws AuthenticationException + */ + private function getCustomerAuthHeaders(string $email, string $password): array + { + $customerToken = $this->customerTokenService->createCustomerAccessToken($email, $password); + return ['Authorization' => 'Bearer ' . $customerToken]; + } + +} From c47d3334fb5684ccce02c2be04651c820f32b066 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Thu, 3 Dec 2020 16:41:14 -0600 Subject: [PATCH 416/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs --- .../LoginAsCustomerGraphQl/composer.json | 1 + composer.lock | 1152 +++-------------- .../GenerateLoginCustomerTokenTest.php | 2 +- 3 files changed, 191 insertions(+), 964 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerGraphQl/composer.json b/app/code/Magento/LoginAsCustomerGraphQl/composer.json index e96f22a3ac649..9b3e7ca2efbb7 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/composer.json +++ b/app/code/Magento/LoginAsCustomerGraphQl/composer.json @@ -5,6 +5,7 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-login-as-customer-api": "*", + "magento/module-login-as-customer-assistance": "*", "magento/module-integration": "*", "magento/module-store": "*", "magento/module-customer": "*" diff --git a/composer.lock b/composer.lock index f4ece70a22e62..fe325ab599581 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "50fd3418a729ef9b577d214fe6c9b0b1", + "content-hash": "fa173f7f295f1ff527f850f572c47282", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.158.19", + "version": "3.166.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561" + "reference": "36788095cfab7850400e337a3128572cfc1537e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b1c3c763e227e518768f0416cbd2b29c11f79561", - "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/36788095cfab7850400e337a3128572cfc1537e6", + "reference": "36788095cfab7850400e337a3128572cfc1537e6", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ "s3", "sdk" ], - "time": "2020-11-02T19:49:21+00:00" + "time": "2020-12-03T19:25:02+00:00" }, { "name": "colinmollenhour/cache-backend-file", @@ -291,34 +291,20 @@ "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" }, { "name": "composer/composer", - "version": "1.10.17", + "version": "1.10.18", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "09d42e18394d8594be24e37923031c4b7442a1cb" + "reference": "0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/09d42e18394d8594be24e37923031c4b7442a1cb", - "reference": "09d42e18394d8594be24e37923031c4b7442a1cb", + "url": "https://api.github.com/repos/composer/composer/zipball/0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f", + "reference": "0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f", "shasum": "" }, "require": { @@ -327,7 +313,7 @@ "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -385,38 +371,24 @@ "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" + "time": "2020-12-03T16:16:19+00:00" }, { "name": "composer/semver", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "38276325bd896f90dfcfe30029aa5db40df387a7" + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/38276325bd896f90dfcfe30029aa5db40df387a7", - "reference": "38276325bd896f90dfcfe30029aa5db40df387a7", + "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^4.5 || ^5.0.5" @@ -460,34 +432,20 @@ "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" + "time": "2020-12-03T15:47:16+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.4", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + "reference": "de30328a7af8680efdc03e396aad24befd513200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", + "reference": "de30328a7af8680efdc03e396aad24befd513200", "shasum": "" }, "require": { @@ -499,7 +457,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -534,34 +492,20 @@ "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" + "time": "2020-12-03T16:04:16+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.4", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + "reference": "f28d44c286812c714741478d968104c5e604a1d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", + "reference": "f28d44c286812c714741478d968104c5e604a1d4", "shasum": "" }, "require": { @@ -592,21 +536,7 @@ "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" + "time": "2020-11-13T08:04:11+00:00" }, { "name": "container-interop/container-interop", @@ -1459,12 +1389,6 @@ "BSD-3-Clause" ], "description": "Replace zendframework and zfcampus packages with their Laminas Project equivalents.", - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-05-20T13:45:39+00:00" }, { @@ -1595,36 +1519,36 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.6.1", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70" + "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/25f2a053eadfa92ddacb609dcbbc39362610da70", - "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/5e04bc5ae5990b17159d79d331055e2c645e5cc5", + "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5", "shasum": "" }, "require": { "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-escaper": "self.version" + "zendframework/zend-escaper": "^2.6.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.12.2", + "vimeo/psalm": "^3.16" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" - } + "suggest": { + "ext-iconv": "*", + "ext-mbstring": "*" }, + "type": "library", "autoload": { "psr-4": { "Laminas\\Escaper\\": "src/" @@ -1640,7 +1564,7 @@ "escaper", "laminas" ], - "time": "2019-12-31T16:43:30+00:00" + "time": "2020-11-17T21:26:43+00:00" }, { "name": "laminas/laminas-eventmanager", @@ -1698,12 +1622,6 @@ "events", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-25T11:10:44+00:00" }, { @@ -1771,12 +1689,6 @@ "feed", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-18T13:45:04+00:00" }, { @@ -1928,12 +1840,6 @@ "form", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-07-14T13:53:27+00:00" }, { @@ -1986,12 +1892,6 @@ "http client", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-18T17:11:58+00:00" }, { @@ -2127,12 +2027,6 @@ "i18n", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-24T13:14:32+00:00" }, { @@ -2438,12 +2332,6 @@ "laminas", "mail" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-12T14:51:33+00:00" }, { @@ -2616,12 +2504,6 @@ "laminas", "modulemanager" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-08-25T09:29:22+00:00" }, { @@ -2837,38 +2719,34 @@ }, { "name": "laminas/laminas-server", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-server.git", - "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e" + "reference": "9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-server/zipball/4aaca9174c40a2fab2e2aa77999da99f71bdd88e", - "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e", + "url": "https://api.github.com/repos/laminas/laminas-server/zipball/9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4", + "reference": "9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4", "shasum": "" }, "require": { "laminas/laminas-code": "^2.5 || ^3.0", "laminas/laminas-stdlib": "^2.5 || ^3.0", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-server": "self.version" + "zendframework/zend-server": "^2.8.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.13.0", + "vimeo/psalm": "^4.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Server\\": "src/" @@ -2884,7 +2762,7 @@ "laminas", "server" ], - "time": "2019-12-31T17:43:03+00:00" + "time": "2020-12-01T21:06:52+00:00" }, { "name": "laminas/laminas-servicemanager", @@ -3008,12 +2886,6 @@ "laminas", "session" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-31T15:33:31+00:00" }, { @@ -3075,16 +2947,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6" + "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/b9d84eaa39fde733356ea948cdef36c631f202b6", - "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", + "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", "shasum": "" }, "require": { @@ -3097,15 +2969,9 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "phpbench/phpbench": "^0.17.1", - "phpunit/phpunit": "^9.3.7" + "phpunit/phpunit": "~9.3.7" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3.x-dev", - "dev-develop": "3.4.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Stdlib\\": "src/" @@ -3121,13 +2987,7 @@ "laminas", "stdlib" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-08-25T09:08:16+00:00" + "time": "2020-11-19T20:18:59+00:00" }, { "name": "laminas/laminas-text", @@ -3224,12 +3084,6 @@ "laminas", "uri" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-10-31T20:20:07+00:00" }, { @@ -3448,12 +3302,6 @@ "laminas", "zf" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-09-14T14:23:00+00:00" }, { @@ -3539,12 +3387,6 @@ "sftp", "storage" ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], "time": "2020-08-23T07:39:11+00:00" }, { @@ -3680,16 +3522,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" }, { @@ -3809,16 +3641,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.4", + "version": "1.14.5", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565" + "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/250f35c0e80b5e6fa1a1598c144cba2fff36b565", - "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565", + "url": "https://api.github.com/repos/magento/zf1/zipball/6ad81500d33f085ca2391f2b59e37bd34203b29b", + "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b", "shasum": "" }, "require": { @@ -3852,7 +3684,7 @@ "ZF1", "framework" ], - "time": "2020-05-19T23:25:07+00:00" + "time": "2020-12-02T21:12:59+00:00" }, { "name": "monolog/monolog", @@ -3929,16 +3761,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" }, { @@ -4045,16 +3867,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.13.0", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "bbade402cbe84c69b718120911506a3aa2bae653" + "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653", - "reference": "bbade402cbe84c69b718120911506a3aa2bae653", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", + "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", "shasum": "" }, "require": { @@ -4062,7 +3884,7 @@ "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" }, "require-dev": { - "phpunit/phpunit": "^3|^4|^5|^6|^7" + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", @@ -4123,7 +3945,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2020-03-20T21:48:09+00:00" + "time": "2020-12-03T16:26:19+00:00" }, { "name": "pelago/emogrifier", @@ -4410,20 +4232,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" }, { @@ -4788,16 +4596,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", "shasum": "" }, "require": { @@ -4833,17 +4641,7 @@ "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" + "time": "2020-11-11T09:19:24+00:00" }, { "name": "seld/phar-utils", @@ -4891,16 +4689,16 @@ }, { "name": "symfony/console", - "version": "v4.4.16", + "version": "v4.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" + "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", + "url": "https://api.github.com/repos/symfony/console/zipball/c8e37f6928c19816437a4dd7bf16e3bd79941470", + "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470", "shasum": "" }, "require": { @@ -4959,34 +4757,20 @@ ], "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" + "time": "2020-11-28T10:15:42+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", "shasum": "" }, "require": { @@ -5021,34 +4805,20 @@ ], "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" + "time": "2020-10-28T21:31:18+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.16", + "version": "v4.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98" + "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4204f13d2d0b7ad09454f221bb2195fccdf1fe98", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f029d6f21eac61ab23198e7aca40e7638e8c8924", + "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924", "shasum": "" }, "require": { @@ -5101,21 +4871,7 @@ ], "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" + "time": "2020-10-31T22:44:29+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5177,34 +4933,20 @@ "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" }, { "name": "symfony/filesystem", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "df08650ea7aee2d925380069c131a66124d79177" + "reference": "bb92ba7f38b037e531908590a858a04d85c0e238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177", - "reference": "df08650ea7aee2d925380069c131a66124d79177", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb92ba7f38b037e531908590a858a04d85c0e238", + "reference": "bb92ba7f38b037e531908590a858a04d85c0e238", "shasum": "" }, "require": { @@ -5236,34 +4978,20 @@ ], "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" + "time": "2020-11-12T09:58:18+00:00" }, { "name": "symfony/finder", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d", + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d", "shasum": "" }, "require": { @@ -5294,21 +5022,7 @@ ], "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" + "time": "2020-11-18T09:42:36+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5370,20 +5084,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" }, { @@ -5454,20 +5154,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" }, { @@ -5535,20 +5221,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" }, { @@ -5612,20 +5284,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" }, { @@ -5685,20 +5343,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" }, { @@ -5761,20 +5405,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" }, { @@ -5841,34 +5471,20 @@ "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" }, { "name": "symfony/process", - "version": "v4.4.16", + "version": "v4.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05" + "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2f4b049fb80ca5e9874615a2a85dc2a502090f05", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05", + "url": "https://api.github.com/repos/symfony/process/zipball/ec1482f13d53911a8a32e54ba6f9a3b43a57d943", + "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943", "shasum": "" }, "require": { @@ -5899,21 +5515,7 @@ ], "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" + "time": "2020-11-02T15:10:16+00:00" }, { "name": "symfony/service-contracts", @@ -5975,20 +5577,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" }, { @@ -6183,12 +5771,6 @@ "safe writer", "webimpress" ], - "funding": [ - { - "url": "https://github.com/michalbundyra", - "type": "github" - } - ], "time": "2020-08-25T07:21:11+00:00" }, { @@ -6241,12 +5823,6 @@ "api", "graphql" ], - "funding": [ - { - "url": "https://opencollective.com/webonyx-graphql-php", - "type": "open_collective" - } - ], "time": "2020-07-02T05:49:25+00:00" }, { @@ -6468,32 +6044,31 @@ }, { "name": "beberlei/assert", - "version": "v3.2.7", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf" + "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf", - "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf", + "url": "https://api.github.com/repos/beberlei/assert/zipball/5367e3895976b49704ae671f75bc5f0ba1b986ab", + "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7" + "php": "^7.0 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan-shim": "*", - "phpunit/phpunit": ">=6.0.0 <8" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=6.0.0", + "yoast/phpunit-polyfills": "^0.1.0" }, "type": "library", "autoload": { @@ -6526,7 +6101,7 @@ "assertion", "validation" ], - "time": "2019-12-19T17:51:41+00:00" + "time": "2020-11-13T20:02:54+00:00" }, { "name": "behat/gherkin", @@ -6682,16 +6257,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.11", + "version": "4.1.12", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061" + "reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", - "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd", + "reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd", "shasum": "" }, "require": { @@ -6763,13 +6338,7 @@ "functional testing", "unit testing" ], - "funding": [ - { - "url": "https://opencollective.com/codeception", - "type": "open_collective" - } - ], - "time": "2020-11-03T17:34:51+00:00" + "time": "2020-11-16T06:36:57+00:00" }, { "name": "codeception/lib-asserts", @@ -6916,16 +6485,16 @@ }, { "name": "codeception/module-webdriver", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55" + "reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/b7dc227f91730e7abb520439decc9ad0677b8a55", - "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/f719edc1eca033e0dc5fd8d99db122070b1fb933", + "reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933", "shasum": "" }, "require": { @@ -6964,7 +6533,7 @@ "browser-testing", "codeception" ], - "time": "2020-10-24T15:41:19+00:00" + "time": "2020-11-16T06:50:15+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -7343,20 +6912,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" }, { @@ -7428,36 +6983,31 @@ }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -7471,7 +7021,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -7480,21 +7030,7 @@ "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" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "doctrine/lexer", @@ -7556,20 +7092,6 @@ "parser", "php" ], - "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%2Flexer", - "type": "tidelift" - } - ], "time": "2020-05-25T17:44:05+00:00" }, { @@ -7661,12 +7183,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" }, { @@ -8461,21 +7977,21 @@ }, { "name": "magento/magento-coding-standard", - "version": "5", + "version": "6", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5" + "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/da46c5d57a43c950dfa364edc7f1f0436d5353a5", - "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", + "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", "shasum": "" }, "require": { "php": ">=5.6.0", - "squizlabs/php_codesniffer": "^3.4", + "squizlabs/php_codesniffer": "^3.5", "webonyx/graphql-php": ">=0.12.6 <1.0" }, "require-dev": { @@ -8496,7 +8012,7 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-11-04T22:08:27+00:00" + "time": "2020-12-03T14:41:54+00:00" }, { "name": "magento/magento2-functional-testing-framework", @@ -8683,16 +8199,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -8727,13 +8243,7 @@ "object", "object graph" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -9384,12 +8894,6 @@ "phpmd", "pmd" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", - "type": "tidelift" - } - ], "time": "2020-09-23T22:06:32+00:00" }, { @@ -9445,16 +8949,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" }, { @@ -9560,20 +9054,6 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], "time": "2020-05-05T12:55:44+00:00" }, { @@ -9638,12 +9118,6 @@ "testing", "xunit" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-05-23T08:02:54+00:00" }, { @@ -9694,12 +9168,6 @@ "filesystem", "iterator" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:57:25+00:00" }, { @@ -9753,12 +9221,6 @@ "keywords": [ "process" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:58:55+00:00" }, { @@ -9808,12 +9270,6 @@ "keywords": [ "template" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T05:33:50+00:00" }, { @@ -9863,12 +9319,6 @@ "keywords": [ "timer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-04-20T06:00:37+00:00" }, { @@ -9918,12 +9368,6 @@ "keywords": [ "tokenizer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "abandoned": true, "time": "2020-08-04T08:28:15+00:00" }, @@ -10013,16 +9457,6 @@ "testing", "xunit" ], - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-05-22T13:54:05+00:00" }, { @@ -10117,12 +9551,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" }, { @@ -10168,12 +9596,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" }, { @@ -10238,12 +9660,6 @@ "compare", "equality" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T15:49:45+00:00" }, { @@ -10300,12 +9716,6 @@ "unidiff", "unified diff" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-10-26T13:10:38+00:00" }, { @@ -10359,12 +9769,6 @@ "environment", "hhvm" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:52:38+00:00" }, { @@ -10432,12 +9836,6 @@ "export", "exporter" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-09-28T05:24:23+00:00" }, { @@ -10586,12 +9984,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" }, { @@ -10637,12 +10029,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" }, { @@ -10747,12 +10133,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" }, { @@ -10798,12 +10178,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" }, { @@ -10850,12 +10224,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" }, { @@ -10899,12 +10267,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" }, { @@ -11031,16 +10393,16 @@ }, { "name": "symfony/config", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "11baeefa4c179d6908655a7b6be728f62367c193" + "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/11baeefa4c179d6908655a7b6be728f62367c193", - "reference": "11baeefa4c179d6908655a7b6be728f62367c193", + "url": "https://api.github.com/repos/symfony/config/zipball/fa1219ecbf96bb5db59f2599cba0960a0d9c3aea", + "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea", "shasum": "" }, "require": { @@ -11088,34 +10450,20 @@ ], "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" + "time": "2020-11-16T18:02:40+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "829ca6bceaf68036a123a13a979f3c89289eae78" + "reference": "98cec9b9f410a4832e239949a41d47182862c3a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/829ca6bceaf68036a123a13a979f3c89289eae78", - "reference": "829ca6bceaf68036a123a13a979f3c89289eae78", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/98cec9b9f410a4832e239949a41d47182862c3a4", + "reference": "98cec9b9f410a4832e239949a41d47182862c3a4", "shasum": "" }, "require": { @@ -11172,21 +10520,7 @@ ], "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" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/deprecation-contracts", @@ -11236,34 +10570,20 @@ ], "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" }, { "name": "symfony/http-foundation", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e4576271ee99123aa59a40564c7b5405f0ebd1e6", + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6", "shasum": "" }, "require": { @@ -11306,38 +10626,25 @@ ], "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" + "time": "2020-11-27T06:13:25+00:00" }, { "name": "symfony/mime", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" @@ -11347,7 +10654,11 @@ }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" }, "type": "library", "autoload": { @@ -11378,39 +10689,26 @@ "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" + "time": "2020-10-30T14:55:39+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02" + "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/87a2a4a766244e796dd9cb9d6f58c123358cd986", + "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.15" }, "type": "library", @@ -11443,21 +10741,7 @@ "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" + "time": "2020-10-24T12:08:07+00:00" }, { "name": "symfony/polyfill-php70", @@ -11508,34 +10792,20 @@ "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" }, { "name": "symfony/stopwatch", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5" + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/3d9f57c89011f0266e6b1d469e5c0110513859d5", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2b105c0354f39a63038a1d8bf776ee92852813af", + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af", "shasum": "" }, "require": { @@ -11567,34 +10837,20 @@ ], "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" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/yaml", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6" + "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598", + "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598", "shasum": "" }, "require": { @@ -11639,21 +10895,7 @@ ], "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" + "time": "2020-11-28T10:57:20+00:00" }, { "name": "thecodingmachine/safe", @@ -11868,12 +11110,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" }, { @@ -11936,16 +11172,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" }, { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php index d8bae2c8e08c9..6d7731836656e 100755 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php @@ -5,7 +5,7 @@ */ declare(strict_types=1); -namespace Magento\GraphQl\LoginAsCustomer; +namespace Magento\GraphQl\LoginAsCustomerGraphQl; use Exception; use Magento\Framework\Exception\AuthenticationException; From 473182be13ae40c0e92548226d567eef041f98ad Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Thu, 3 Dec 2020 12:46:16 -0600 Subject: [PATCH 417/490] MC-38951: Images positions are inconsistent across store-views if images were added in a store-view level - Fix images positions for default scope if image were added in store view level --- .../Product/Gallery/UpdateHandlerTest.php | 123 +++++++++++------- .../Model/Import/ProductTest.php | 85 ++++++++++++ ...port_media_additional_images_storeview.csv | 2 + 3 files changed, 163 insertions(+), 47 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php index f317b9bbf377e..d20bf2907c780 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php @@ -594,70 +594,99 @@ public function updateImageDataProvider(): array } /** - * Tests that images positions are inconsistent across store-views if images were added in a store-view level + * Tests that images are added correctly * * @magentoDataFixture Magento/Catalog/_files/product_with_image.php * @magentoDataFixture Magento/Store/_files/second_store.php + * @dataProvider addImagesDataProvider + * @param string $addFromStore + * @param array $newImages + * @param string $viewFromStore + * @param array $expectedImages + * @param array $select * @return void */ - public function testAddImageInStoreView(): void - { - $secondStoreId = (int)$this->storeRepository->get('fixture_second_store')->getId(); - $existingImagePath = '/m/a/magento_image.jpg'; - $newImagePath = '/m/a/magento_small_image.jpg'; - $product = $this->getProduct($secondStoreId); + public function testAddImages( + string $addFromStore, + array $newImages, + string $viewFromStore, + array $expectedImages, + array $select = ['file', 'label', 'position'] + ): void { + $storeId = (int)$this->storeRepository->get($addFromStore)->getId(); + $product = $this->getProduct($storeId); $images = $product->getData('media_gallery')['images']; - $newImage = [ - 'file' => $newImagePath, - 'position' => 2, - 'label' => 'New Image Alt Text', - 'disabled' => 0, - 'media_type' => 'image' - ]; - $images[] = $newImage; + $images = array_merge($images, $newImages); $product->setData('media_gallery', ['images' => $images]); $this->updateHandler->execute($product); - $product = $this->getProduct(Store::DEFAULT_STORE_ID); - $expectedImages = [ - [ - 'file' => $existingImagePath, - 'label' => 'Image Alt Text', - 'position' => 1 - ], - [ - 'file' => $newImagePath, - 'label' => null, - 'position' => 2 - ], - ]; + $storeId = (int)$this->storeRepository->get($viewFromStore)->getId(); + $product = $this->getProduct($storeId); $actualImages = array_map( - function (\Magento\Framework\DataObject $item) { - return $item->toArray(['file', 'label', 'position']); + function (\Magento\Framework\DataObject $item) use ($select) { + return $item->toArray($select); }, $product->getMediaGalleryImages()->getItems() ); $this->assertEquals($expectedImages, array_values($actualImages)); - $product->cleanModelCache(); - $product = $this->getProduct($secondStoreId); - $expectedImages = [ + } + + /** + * @return array[] + */ + public function addImagesDataProvider(): array + { + return [ [ - 'file' => $existingImagePath, - 'label' => 'Image Alt Text', - 'position' => 1 + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'default', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => null, + 'position' => 2, + ], + ] ], [ - 'file' => $newImagePath, - 'label' => 'New Image Alt Text', - 'position' => 2 - ], + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_small_image.jpg', + 'position' => 2, + 'label' => 'New Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ] + ], + 'fixture_second_store', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1, + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'New Image Alt Text', + 'position' => 2, + ], + ] + ] ]; - $actualImages = array_map( - function (\Magento\Framework\DataObject $item) { - return $item->toArray(['file', 'label', 'position']); - }, - $product->getMediaGalleryImages()->getItems() - ); - $this->assertEquals($expectedImages, array_values($actualImages)); } /** 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 01a6bfe7b39b6..3ca6754c77767 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -3330,4 +3330,89 @@ public function testUpdateImageByNameNotPrefixedWithSlash() $imageItems = $product->getMediaGalleryImages()->getItems(); $this->assertCount(0, $imageItems); } + + /** + * Tests that images are imported correctly + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @dataProvider importImagesDataProvider + * @magentoAppIsolation enabled + * @param string $importFile + * @param string $productSku + * @param string $storeCode + * @param array $expectedImages + * @param array $select + */ + public function testImportImages( + string $importFile, + string $productSku, + string $storeCode, + array $expectedImages, + array $select = ['file', 'label', 'position'] + ): void { + $this->importDataForMediaTest($importFile); + $product = $this->getProductBySku($productSku, $storeCode); + $actualImages = array_map( + function (\Magento\Framework\DataObject $item) use ($select) { + return $item->toArray($select); + }, + $product->getMediaGalleryImages()->getItems() + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + } + + /** + * @return array[] + */ + public function importImagesDataProvider(): array + { + return [ + [ + 'import_media_additional_images_storeview.csv', + 'simple', + 'default', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => null, + 'position' => 2 + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => null, + 'position' => 3 + ], + ] + ], + [ + 'import_media_additional_images_storeview.csv', + 'simple', + 'fixturestore', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => 'Additional Image Label One', + 'position' => 2 + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => 'Additional Image Label Two', + 'position' => 3 + ], + ] + ] + ]; + } } 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 new file mode 100644 index 0000000000000..ed8755a73fcb1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_media_additional_images_storeview.csv @@ -0,0 +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" From b5cd222e183a5edc356d9a7c13bbb4844b313dbc Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Thu, 3 Dec 2020 18:47:21 -0600 Subject: [PATCH 418/490] MC-37484: Cart query error when trying to switch store view --- .../Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php index 10b38abaa7f0a..703e30314ef5f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php @@ -316,7 +316,7 @@ public function testUpdateGiftMessageCartForItem() $query = $this->getUpdateGiftMessageQuery($messageTo, $messageFrom, $message); foreach ($this->graphQlMutation($query)['updateCartItems']['cart']['items'] as $item) { self::assertArrayHasKey('gift_message', $item); - self::assertSame(['to' => '', 'from' => '', 'message' => ''], $item['gift_message']); + self::assertSame(null, $item['gift_message']); } } From c84b731e5be20464dab54c25a1d3ee8bc7150d35 Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Thu, 3 Dec 2020 12:57:20 -0600 Subject: [PATCH 419/490] MC-38655: [GraphQL] Gifting message is not saved in Order - Missing the event at GraphQL while Gift message saving --- .../GiftMessageGraphQl/etc/graphql/events.xml | 12 ++++++ .../GraphQl/Quote/Guest/PlaceOrderTest.php | 39 +++++++++++++++++++ .../GraphQl/Quote/_files/set_gift_options.php | 33 ++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 app/code/Magento/GiftMessageGraphQl/etc/graphql/events.xml create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_gift_options.php diff --git a/app/code/Magento/GiftMessageGraphQl/etc/graphql/events.xml b/app/code/Magento/GiftMessageGraphQl/etc/graphql/events.xml new file mode 100644 index 0000000000000..2411221ded375 --- /dev/null +++ b/app/code/Magento/GiftMessageGraphQl/etc/graphql/events.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:Event/etc/events.xsd"> + <event name="sales_model_service_quote_submit_before"> + <observer name="giftmessage" instance="Magento\GiftMessage\Observer\SalesEventQuoteSubmitBeforeObserver" shared="false" /> + </event> +</config> diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php index 72d35fdd51b96..db9a12e654a2c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php @@ -327,6 +327,45 @@ public function testPlaceOrderOfCustomerCart() $this->graphQlMutation($query); } + /** + * Test place order with gift message options + * + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture sales/gift_options/allow_order 1 + * @magentoConfigFixture default_store customer/create_account/auto_group_assign 1 + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_gift_options.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php + */ + public function testPlaceOrderWithGiftMessage() + { + $reservedOrderId = 'test_quote'; + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); + + $query = $this->getQuery($maskedQuoteId); + $response = $this->graphQlMutation($query); + + self::assertArrayHasKey('placeOrder', $response); + self::assertArrayHasKey('order_number', $response['placeOrder']['order']); + self::assertEquals($reservedOrderId, $response['placeOrder']['order']['order_number']); + $orderIncrementId = $response['placeOrder']['order']['order_number']; + $order = $this->orderFactory->create(); + $order->loadByIncrementId($orderIncrementId); + $this->assertNotEmpty($order->getGiftMessageId()); + } + /** * @param string $maskedQuoteId * @return string diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_gift_options.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_gift_options.php new file mode 100644 index 0000000000000..c870fa53c5e39 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_gift_options.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Model\QuoteFactory; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var QuoteFactory $quoteFactory */ +$quoteFactory = $objectManager->get(QuoteFactory::class); +/** @var QuoteResource $quoteResource */ +$quoteResource = $objectManager->get(QuoteResource::class); +/** @var CartRepositoryInterface $cartRepository */ +$cartRepository = $objectManager->get(CartRepositoryInterface::class); + + +/** @var \Magento\GiftMessage\Model\Message $message */ +$message = $objectManager->create(\Magento\GiftMessage\Model\Message::class); +$message->setSender('Romeo'); +$message->setRecipient('Mercutio'); +$message->setMessage('I thought all for the best.'); +$message->save(); + +$quote = $quoteFactory->create(); +$quoteResource->load($quote, 'test_quote', 'reserved_order_id'); +$quote->setGiftMessageId($message->getId()); +$cartRepository->save($quote); From 77e6e2b33980227553346ca9c1547b1ed5bae052 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Thu, 3 Dec 2020 20:50:11 -0600 Subject: [PATCH 420/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs --- composer.json | 1 - composer.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 865b6e490f825..b5a484d3828b8 100644 --- a/composer.json +++ b/composer.json @@ -195,7 +195,6 @@ "magento/module-integration": "*", "magento/module-layered-navigation": "*", "magento/module-login-as-customer": "*", - "magento/module-login-as-customer-graph-ql": "*", "magento/module-login-as-customer-admin-ui": "*", "magento/module-login-as-customer-api": "*", "magento/module-login-as-customer-assistance": "*", diff --git a/composer.lock b/composer.lock index fe325ab599581..e2d062f1fc776 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": "fa173f7f295f1ff527f850f572c47282", + "content-hash": "50fd3418a729ef9b577d214fe6c9b0b1", "packages": [ { "name": "aws/aws-sdk-php", From 33f3fe3aba1bfcb66aa5b210ab45ff92d3830fae Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 4 Dec 2020 00:20:25 -0600 Subject: [PATCH 421/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs --- composer.json | 1 + composer.lock | 735 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 731 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index b5a484d3828b8..01b852ca9bb02 100644 --- a/composer.json +++ b/composer.json @@ -199,6 +199,7 @@ "magento/module-login-as-customer-api": "*", "magento/module-login-as-customer-assistance": "*", "magento/module-login-as-customer-frontend-ui": "*", + "magento/module-login-as-customer-graph-ql": "*", "magento/module-login-as-customer-log": "*", "magento/module-login-as-customer-quote": "*", "magento/module-login-as-customer-page-cache": "*", diff --git a/composer.lock b/composer.lock index e2d062f1fc776..badc4b8f239b9 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": "50fd3418a729ef9b577d214fe6c9b0b1", + "content-hash": "2d7a8504b5d5e18d8d73512bcb754a75", "packages": [ { "name": "aws/aws-sdk-php", @@ -291,6 +291,20 @@ "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" }, { @@ -371,6 +385,20 @@ "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-12-03T16:16:19+00:00" }, { @@ -432,6 +460,20 @@ "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-12-03T15:47:16+00:00" }, { @@ -492,6 +534,20 @@ "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-12-03T16:04:16+00:00" }, { @@ -536,6 +592,20 @@ "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-11-13T08:04:11+00:00" }, { @@ -1564,6 +1634,12 @@ "escaper", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-11-17T21:26:43+00:00" }, { @@ -1622,6 +1698,12 @@ "events", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-08-25T11:10:44+00:00" }, { @@ -1689,6 +1771,12 @@ "feed", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-08-18T13:45:04+00:00" }, { @@ -1840,6 +1928,12 @@ "form", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-07-14T13:53:27+00:00" }, { @@ -1892,6 +1986,12 @@ "http client", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-08-18T17:11:58+00:00" }, { @@ -2027,6 +2127,12 @@ "i18n", "laminas" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-10-24T13:14:32+00:00" }, { @@ -2332,6 +2438,12 @@ "laminas", "mail" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-08-12T14:51:33+00:00" }, { @@ -2504,6 +2616,12 @@ "laminas", "modulemanager" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-08-25T09:29:22+00:00" }, { @@ -2762,6 +2880,12 @@ "laminas", "server" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-12-01T21:06:52+00:00" }, { @@ -2886,6 +3010,12 @@ "laminas", "session" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-10-31T15:33:31+00:00" }, { @@ -2987,6 +3117,12 @@ "laminas", "stdlib" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-11-19T20:18:59+00:00" }, { @@ -3084,6 +3220,12 @@ "laminas", "uri" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-10-31T20:20:07+00:00" }, { @@ -3302,6 +3444,12 @@ "laminas", "zf" ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], "time": "2020-09-14T14:23:00+00:00" }, { @@ -3387,6 +3535,12 @@ "sftp", "storage" ], + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], "time": "2020-08-23T07:39:11+00:00" }, { @@ -3522,6 +3676,16 @@ } ], "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" }, { @@ -3552,13 +3716,11 @@ "Magento\\Composer\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "OSL-3.0", "AFL-3.0" ], - "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2020-06-15T17:52:31+00:00" + "description": "Magento composer library helps to instantiate Composer application and run composer commands." }, { "name": "magento/magento-composer-installer", @@ -3761,6 +3923,16 @@ "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" }, { @@ -4232,6 +4404,20 @@ "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" }, { @@ -4641,6 +4827,16 @@ "parser", "validator" ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], "time": "2020-11-11T09:19:24+00:00" }, { @@ -4757,6 +4953,20 @@ ], "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-11-28T10:15:42+00:00" }, { @@ -4805,6 +5015,20 @@ ], "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-28T21:31:18+00:00" }, { @@ -4871,6 +5095,20 @@ ], "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-31T22:44:29+00:00" }, { @@ -4933,6 +5171,20 @@ "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" }, { @@ -4978,6 +5230,20 @@ ], "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-11-12T09:58:18+00:00" }, { @@ -5022,6 +5288,20 @@ ], "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-11-18T09:42:36+00:00" }, { @@ -5084,6 +5364,20 @@ "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" }, { @@ -5154,6 +5448,20 @@ "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" }, { @@ -5221,6 +5529,20 @@ "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" }, { @@ -5284,6 +5606,20 @@ "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" }, { @@ -5343,6 +5679,20 @@ "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" }, { @@ -5405,6 +5755,20 @@ "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" }, { @@ -5471,6 +5835,20 @@ "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" }, { @@ -5515,6 +5893,20 @@ ], "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-11-02T15:10:16+00:00" }, { @@ -5577,6 +5969,20 @@ "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" }, { @@ -5771,6 +6177,12 @@ "safe writer", "webimpress" ], + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } + ], "time": "2020-08-25T07:21:11+00:00" }, { @@ -5823,6 +6235,12 @@ "api", "graphql" ], + "funding": [ + { + "url": "https://opencollective.com/webonyx-graphql-php", + "type": "open_collective" + } + ], "time": "2020-07-02T05:49:25+00:00" }, { @@ -6338,6 +6756,12 @@ "functional testing", "unit testing" ], + "funding": [ + { + "url": "https://opencollective.com/codeception", + "type": "open_collective" + } + ], "time": "2020-11-16T06:36:57+00:00" }, { @@ -6912,6 +7336,20 @@ "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" }, { @@ -7030,6 +7468,20 @@ "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-11-10T18:47:58+00:00" }, { @@ -7183,6 +7635,12 @@ } ], "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" }, { @@ -8243,6 +8701,12 @@ "object", "object graph" ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], "time": "2020-11-13T09:40:50+00:00" }, { @@ -8894,6 +9358,12 @@ "phpmd", "pmd" ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], "time": "2020-09-23T22:06:32+00:00" }, { @@ -8949,6 +9419,16 @@ "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" }, { @@ -9118,6 +9598,12 @@ "testing", "xunit" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-05-23T08:02:54+00:00" }, { @@ -9168,6 +9654,12 @@ "filesystem", "iterator" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-09-28T05:57:25+00:00" }, { @@ -9221,6 +9713,12 @@ "keywords": [ "process" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-09-28T05:58:55+00:00" }, { @@ -9270,6 +9768,12 @@ "keywords": [ "template" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-10-26T05:33:50+00:00" }, { @@ -9368,6 +9872,12 @@ "keywords": [ "tokenizer" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "abandoned": true, "time": "2020-08-04T08:28:15+00:00" }, @@ -9551,6 +10061,12 @@ ], "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" }, { @@ -9596,6 +10112,12 @@ ], "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" }, { @@ -9660,6 +10182,12 @@ "compare", "equality" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-10-26T15:49:45+00:00" }, { @@ -9716,6 +10244,12 @@ "unidiff", "unified diff" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-10-26T13:10:38+00:00" }, { @@ -9769,6 +10303,12 @@ "environment", "hhvm" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-09-28T05:52:38+00:00" }, { @@ -9836,6 +10376,12 @@ "export", "exporter" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "time": "2020-09-28T05:24:23+00:00" }, { @@ -9984,6 +10530,12 @@ ], "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" }, { @@ -10029,6 +10581,12 @@ ], "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" }, { @@ -10133,6 +10691,12 @@ ], "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" }, { @@ -10178,6 +10742,12 @@ ], "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" }, { @@ -10224,6 +10794,12 @@ ], "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" }, { @@ -10267,6 +10843,12 @@ ], "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" }, { @@ -10450,6 +11032,20 @@ ], "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-11-16T18:02:40+00:00" }, { @@ -10520,6 +11116,20 @@ ], "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-11-28T11:24:18+00:00" }, { @@ -10570,6 +11180,20 @@ ], "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" }, { @@ -10626,6 +11250,20 @@ ], "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-11-27T06:13:25+00:00" }, { @@ -10689,6 +11327,20 @@ "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-30T14:55:39+00:00" }, { @@ -10741,6 +11393,20 @@ "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:08:07+00:00" }, { @@ -10792,6 +11458,20 @@ "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" }, { @@ -10837,6 +11517,20 @@ ], "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-11-01T16:14:45+00:00" }, { @@ -10895,6 +11589,20 @@ ], "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-11-28T10:57:20+00:00" }, { @@ -11110,6 +11818,12 @@ } ], "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" }, { @@ -11172,6 +11886,16 @@ "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" }, { @@ -11285,5 +12009,6 @@ "ext-zip": "*", "lib-libxml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } From 9703ece04f658b9f383cc3f06fd199fbe15dd427 Mon Sep 17 00:00:00 2001 From: Cari Spruiell <spruiell@adobe.com> Date: Fri, 4 Dec 2020 00:24:53 -0600 Subject: [PATCH 422/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index b5a484d3828b8..01b852ca9bb02 100644 --- a/composer.json +++ b/composer.json @@ -199,6 +199,7 @@ "magento/module-login-as-customer-api": "*", "magento/module-login-as-customer-assistance": "*", "magento/module-login-as-customer-frontend-ui": "*", + "magento/module-login-as-customer-graph-ql": "*", "magento/module-login-as-customer-log": "*", "magento/module-login-as-customer-quote": "*", "magento/module-login-as-customer-page-cache": "*", From 51f5c43dbcf87ee1352d5ed2647479890cec3e9f Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 4 Dec 2020 10:28:06 +0200 Subject: [PATCH 423/490] MC-38973: Duplicate address by order from admin --- .../view/adminhtml/templates/order/create/form/address.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 80083569df889..638ac7e66f769 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -125,7 +125,7 @@ endif; ?> <?php endif; ?> class="admin__control-checkbox"/> <label for="<?= $block->escapeHtmlAttr($block->getForm()->getHtmlIdPrefix()) ?>save_in_address_book" - class="admin__field-label"><?= $block->escapeHtml(__('Save in address book')) ?></label> + class="admin__field-label"><?= $block->escapeHtml(__('Add to address book')) ?></label> </div> </div> <?php $hideElement = 'address-' . ($block->getIsShipping() ? 'shipping' : 'billing') . '-overlay'; ?> From a119cbeaedeed60b4d5b7b62c05aa756e579a330 Mon Sep 17 00:00:00 2001 From: Dmitry Furs <dmitryfurs@gmail.com> Date: Fri, 4 Dec 2020 13:51:06 +0300 Subject: [PATCH 424/490] Invalid combination of tabs and spaces in phpstan.neon --- .../Test/Php/_files/phpstan/phpstan.neon | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon index d487fbe602acf..0bdb5861dbf33 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon @@ -1,41 +1,41 @@ parameters: - checkExplicitMixedMissingReturn: true - checkPhpDocMissingReturn: true - reportUnmatchedIgnoredErrors: false - excludes_analyse: - - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* - - %rootDir%/../../../*/_files/* - - %rootDir%/../../../dev/tests/*/Fixtures/* - - %rootDir%/../../../dev/tests/*/tmp/* - - %rootDir%/../../../dev/tests/*/_generated/* - - %rootDir%/../../../pub/* - autoload_directories: - - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento - - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento - - %rootDir%/../../../dev/tests/api-functional/_files/Magento - autoload_files: - - %rootDir%/../../../dev/tests/static/framework/autoload.php - - %rootDir%/../../../dev/tests/integration/framework/autoload.php - - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php - - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php - - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php - ignoreErrors: - # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule - - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' - # Ignore setCustomErrorHandler function not found in bootstrap files - - '#Function setCustomErrorHandler not found#' - # Ignore 'return statement is missing' error when 'void' is present in return type list - - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' - # Ignore constants, defined dynamically. - - '#Constant TESTS_WEB_API_ADAPTER not found.#' - - '#Constant TESTS_BASE_URL not found.#' - - '#Constant TESTS_XDEBUG_ENABLED not found.#' - - '#Constant TESTS_XDEBUG_SESSION not found.#' - - '#Constant INTEGRATION_TESTS_DIR not found.#' - - '#Constant MAGENTO_MODULES_PATH not found.#' - - '#Constant TESTS_MODULES_PATH not found.#' - - '#Constant TESTS_INSTALLATION_DB_CONFIG_FILE not found.#' - - '#Constant T_[A-Z_]+ not found.#' + checkExplicitMixedMissingReturn: true + checkPhpDocMissingReturn: true + reportUnmatchedIgnoredErrors: false + excludes_analyse: + - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* + - %rootDir%/../../../*/_files/* + - %rootDir%/../../../dev/tests/*/Fixtures/* + - %rootDir%/../../../dev/tests/*/tmp/* + - %rootDir%/../../../dev/tests/*/_generated/* + - %rootDir%/../../../pub/* + autoload_directories: + - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/api-functional/_files/Magento + autoload_files: + - %rootDir%/../../../dev/tests/static/framework/autoload.php + - %rootDir%/../../../dev/tests/integration/framework/autoload.php + - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php + - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php + - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php + ignoreErrors: + # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule + - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' + # Ignore setCustomErrorHandler function not found in bootstrap files + - '#Function setCustomErrorHandler not found#' + # Ignore 'return statement is missing' error when 'void' is present in return type list + - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' + # Ignore constants, defined dynamically. + - '#Constant TESTS_WEB_API_ADAPTER not found.#' + - '#Constant TESTS_BASE_URL not found.#' + - '#Constant TESTS_XDEBUG_ENABLED not found.#' + - '#Constant TESTS_XDEBUG_SESSION not found.#' + - '#Constant INTEGRATION_TESTS_DIR not found.#' + - '#Constant MAGENTO_MODULES_PATH not found.#' + - '#Constant TESTS_MODULES_PATH not found.#' + - '#Constant TESTS_INSTALLATION_DB_CONFIG_FILE not found.#' + - '#Constant T_[A-Z_]+ not found.#' services: From 63810d1471499b0e3adac3b58bd9521e9eed8e58 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 4 Dec 2020 13:22:31 +0200 Subject: [PATCH 425/490] MC-38973: Duplicate address by order from admin --- app/code/Magento/Sales/i18n/en_US.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index 0e65131b7c4b0..13afa0832086e 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -804,3 +804,4 @@ If set YES Email field will be required during Admin order creation for new Cust "Please enter a coupon code!","Please enter a coupon code!" "Reorder is not available.","Reorder is not available." "The coupon code has been removed.","The coupon code has been removed." +"Add to address book","Add to address book" From 0b729c623ccabf5fadc5d921078b7ea8d93ebdb2 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 4 Dec 2020 06:17:47 -0600 Subject: [PATCH 426/490] MC-38886: [Zilker] Login as Customer: Review and deliver community PRs - update composer without upgrading --- composer.lock | 400 +++++++++++++++++++++++++------------------------- 1 file changed, 199 insertions(+), 201 deletions(-) diff --git a/composer.lock b/composer.lock index badc4b8f239b9..fa90484975728 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d7a8504b5d5e18d8d73512bcb754a75", + "content-hash": "ac6fc13ba98a815bce589d300d28012c", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.166.1", + "version": "3.158.19", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "36788095cfab7850400e337a3128572cfc1537e6" + "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/36788095cfab7850400e337a3128572cfc1537e6", - "reference": "36788095cfab7850400e337a3128572cfc1537e6", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b1c3c763e227e518768f0416cbd2b29c11f79561", + "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ "s3", "sdk" ], - "time": "2020-12-03T19:25:02+00:00" + "time": "2020-11-02T19:49:21+00:00" }, { "name": "colinmollenhour/cache-backend-file", @@ -309,16 +309,16 @@ }, { "name": "composer/composer", - "version": "1.10.18", + "version": "1.10.17", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f" + "reference": "09d42e18394d8594be24e37923031c4b7442a1cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f", - "reference": "0de2d4e9c0ab834c2e660b6f18b9cdefef0bb11f", + "url": "https://api.github.com/repos/composer/composer/zipball/09d42e18394d8594be24e37923031c4b7442a1cb", + "reference": "09d42e18394d8594be24e37923031c4b7442a1cb", "shasum": "" }, "require": { @@ -327,7 +327,7 @@ "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0 || ^8.0", + "php": "^5.3.2 || ^7.0", "psr/log": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -399,24 +399,24 @@ "type": "tidelift" } ], - "time": "2020-12-03T16:16:19+00:00" + "time": "2020-10-30T21:31:58+00:00" }, { "name": "composer/semver", - "version": "1.7.2", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" + "reference": "38276325bd896f90dfcfe30029aa5db40df387a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", + "url": "https://api.github.com/repos/composer/semver/zipball/38276325bd896f90dfcfe30029aa5db40df387a7", + "reference": "38276325bd896f90dfcfe30029aa5db40df387a7", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^5.3.2 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.5 || ^5.0.5" @@ -474,20 +474,20 @@ "type": "tidelift" } ], - "time": "2020-12-03T15:47:16+00:00" + "time": "2020-09-27T13:13:07+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.5", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "de30328a7af8680efdc03e396aad24befd513200" + "reference": "6946f785871e2314c60b4524851f3702ea4f2223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", - "reference": "de30328a7af8680efdc03e396aad24befd513200", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223", "shasum": "" }, "require": { @@ -499,7 +499,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -548,20 +548,20 @@ "type": "tidelift" } ], - "time": "2020-12-03T16:04:16+00:00" + "time": "2020-07-15T15:35:07+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.5", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f28d44c286812c714741478d968104c5e604a1d4" + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", - "reference": "f28d44c286812c714741478d968104c5e604a1d4", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", "shasum": "" }, "require": { @@ -606,7 +606,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T08:04:11+00:00" + "time": "2020-10-24T12:39:10+00:00" }, { "name": "container-interop/container-interop", @@ -1589,36 +1589,36 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.7.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5" + "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/5e04bc5ae5990b17159d79d331055e2c645e5cc5", - "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/25f2a053eadfa92ddacb609dcbbc39362610da70", + "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70", "shasum": "" }, "require": { "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "php": "^5.6 || ^7.0" }, "replace": { - "zendframework/zend-escaper": "^2.6.1" + "zendframework/zend-escaper": "self.version" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.12.2", - "vimeo/psalm": "^3.16" - }, - "suggest": { - "ext-iconv": "*", - "ext-mbstring": "*" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" + } + }, "autoload": { "psr-4": { "Laminas\\Escaper\\": "src/" @@ -1634,13 +1634,7 @@ "escaper", "laminas" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-11-17T21:26:43+00:00" + "time": "2019-12-31T16:43:30+00:00" }, { "name": "laminas/laminas-eventmanager", @@ -2837,34 +2831,38 @@ }, { "name": "laminas/laminas-server", - "version": "2.9.1", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-server.git", - "reference": "9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4" + "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-server/zipball/9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4", - "reference": "9b82e3e45f8f01ca6ac5d0003dba58f85043d7e4", + "url": "https://api.github.com/repos/laminas/laminas-server/zipball/4aaca9174c40a2fab2e2aa77999da99f71bdd88e", + "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e", "shasum": "" }, "require": { "laminas/laminas-code": "^2.5 || ^3.0", "laminas/laminas-stdlib": "^2.5 || ^3.0", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "php": "^5.6 || ^7.0" }, "replace": { - "zendframework/zend-server": "^2.8.1" + "zendframework/zend-server": "self.version" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.13.0", - "vimeo/psalm": "^4.2" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" + } + }, "autoload": { "psr-4": { "Laminas\\Server\\": "src/" @@ -2880,13 +2878,7 @@ "laminas", "server" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-12-01T21:06:52+00:00" + "time": "2019-12-31T17:43:03+00:00" }, { "name": "laminas/laminas-servicemanager", @@ -3077,16 +3069,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.3.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe" + "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", - "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/b9d84eaa39fde733356ea948cdef36c631f202b6", + "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6", "shasum": "" }, "require": { @@ -3099,9 +3091,15 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "phpbench/phpbench": "^0.17.1", - "phpunit/phpunit": "~9.3.7" + "phpunit/phpunit": "^9.3.7" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev", + "dev-develop": "3.4.x-dev" + } + }, "autoload": { "psr-4": { "Laminas\\Stdlib\\": "src/" @@ -3123,7 +3121,7 @@ "type": "community_bridge" } ], - "time": "2020-11-19T20:18:59+00:00" + "time": "2020-08-25T09:08:16+00:00" }, { "name": "laminas/laminas-text", @@ -3803,16 +3801,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.5", + "version": "1.14.4", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b" + "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/6ad81500d33f085ca2391f2b59e37bd34203b29b", - "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b", + "url": "https://api.github.com/repos/magento/zf1/zipball/250f35c0e80b5e6fa1a1598c144cba2fff36b565", + "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565", "shasum": "" }, "require": { @@ -3846,7 +3844,7 @@ "ZF1", "framework" ], - "time": "2020-12-02T21:12:59+00:00" + "time": "2020-05-19T23:25:07+00:00" }, { "name": "monolog/monolog", @@ -4039,16 +4037,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.14.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3" + "reference": "bbade402cbe84c69b718120911506a3aa2bae653" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", - "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653", + "reference": "bbade402cbe84c69b718120911506a3aa2bae653", "shasum": "" }, "require": { @@ -4056,7 +4054,7 @@ "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" }, "require-dev": { - "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + "phpunit/phpunit": "^3|^4|^5|^6|^7" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", @@ -4117,7 +4115,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2020-12-03T16:26:19+00:00" + "time": "2020-03-20T21:48:09+00:00" }, { "name": "pelago/emogrifier", @@ -4782,16 +4780,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.3", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", "shasum": "" }, "require": { @@ -4837,7 +4835,7 @@ "type": "tidelift" } ], - "time": "2020-11-11T09:19:24+00:00" + "time": "2020-08-25T06:56:57+00:00" }, { "name": "seld/phar-utils", @@ -4885,16 +4883,16 @@ }, { "name": "symfony/console", - "version": "v4.4.17", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470" + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c8e37f6928c19816437a4dd7bf16e3bd79941470", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470", + "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", "shasum": "" }, "require": { @@ -4967,20 +4965,20 @@ "type": "tidelift" } ], - "time": "2020-11-28T10:15:42+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" + "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", "shasum": "" }, "require": { @@ -5029,20 +5027,20 @@ "type": "tidelift" } ], - "time": "2020-10-28T21:31:18+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.17", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924" + "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f029d6f21eac61ab23198e7aca40e7638e8c8924", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4204f13d2d0b7ad09454f221bb2195fccdf1fe98", + "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98", "shasum": "" }, "require": { @@ -5109,7 +5107,7 @@ "type": "tidelift" } ], - "time": "2020-10-31T22:44:29+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5189,16 +5187,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "bb92ba7f38b037e531908590a858a04d85c0e238" + "reference": "df08650ea7aee2d925380069c131a66124d79177" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb92ba7f38b037e531908590a858a04d85c0e238", - "reference": "bb92ba7f38b037e531908590a858a04d85c0e238", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177", + "reference": "df08650ea7aee2d925380069c131a66124d79177", "shasum": "" }, "require": { @@ -5244,20 +5242,20 @@ "type": "tidelift" } ], - "time": "2020-11-12T09:58:18+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/finder", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "fd8305521692f27eae3263895d1ef1571c71a78d" + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d", - "reference": "fd8305521692f27eae3263895d1ef1571c71a78d", + "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", "shasum": "" }, "require": { @@ -5302,7 +5300,7 @@ "type": "tidelift" } ], - "time": "2020-11-18T09:42:36+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5853,16 +5851,16 @@ }, { "name": "symfony/process", - "version": "v4.4.17", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943" + "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ec1482f13d53911a8a32e54ba6f9a3b43a57d943", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943", + "url": "https://api.github.com/repos/symfony/process/zipball/2f4b049fb80ca5e9874615a2a85dc2a502090f05", + "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05", "shasum": "" }, "require": { @@ -5907,7 +5905,7 @@ "type": "tidelift" } ], - "time": "2020-11-02T15:10:16+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/service-contracts", @@ -6462,31 +6460,32 @@ }, { "name": "beberlei/assert", - "version": "v3.3.0", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab" + "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/5367e3895976b49704ae671f75bc5f0ba1b986ab", - "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab", + "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf", + "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf", "shasum": "" }, "require": { "ext-ctype": "*", - "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7.0 || ^8.0" + "php": "^7" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan": "*", - "phpunit/phpunit": ">=6.0.0", - "yoast/phpunit-polyfills": "^0.1.0" + "phpstan/phpstan-shim": "*", + "phpunit/phpunit": ">=6.0.0 <8" + }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" }, "type": "library", "autoload": { @@ -6519,7 +6518,7 @@ "assertion", "validation" ], - "time": "2020-11-13T20:02:54+00:00" + "time": "2019-12-19T17:51:41+00:00" }, { "name": "behat/gherkin", @@ -6675,16 +6674,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.12", + "version": "4.1.11", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd" + "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd", - "reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", + "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", "shasum": "" }, "require": { @@ -6762,7 +6761,7 @@ "type": "open_collective" } ], - "time": "2020-11-16T06:36:57+00:00" + "time": "2020-11-03T17:34:51+00:00" }, { "name": "codeception/lib-asserts", @@ -6909,16 +6908,16 @@ }, { "name": "codeception/module-webdriver", - "version": "1.1.4", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933" + "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/f719edc1eca033e0dc5fd8d99db122070b1fb933", - "reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/b7dc227f91730e7abb520439decc9ad0677b8a55", + "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55", "shasum": "" }, "require": { @@ -6957,7 +6956,7 @@ "browser-testing", "codeception" ], - "time": "2020-11-16T06:50:15+00:00" + "time": "2020-10-24T15:41:19+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -7421,31 +7420,36 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -7459,7 +7463,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "homepage": "http://ocramius.github.com/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -7482,7 +7486,7 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2020-05-29T17:27:14+00:00" }, { "name": "doctrine/lexer", @@ -8435,21 +8439,21 @@ }, { "name": "magento/magento-coding-standard", - "version": "6", + "version": "5", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7" + "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", - "reference": "efc9084db3d1bd145b92d6b8a2e9cb0faec54fa7", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/da46c5d57a43c950dfa364edc7f1f0436d5353a5", + "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5", "shasum": "" }, "require": { "php": ">=5.6.0", - "squizlabs/php_codesniffer": "^3.5", + "squizlabs/php_codesniffer": "^3.4", "webonyx/graphql-php": ">=0.12.6 <1.0" }, "require-dev": { @@ -8470,7 +8474,7 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2020-12-03T14:41:54+00:00" + "time": "2019-11-04T22:08:27+00:00" }, { "name": "magento/magento2-functional-testing-framework", @@ -8657,16 +8661,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { @@ -8707,7 +8711,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2020-06-29T13:22:24+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -10975,16 +10979,16 @@ }, { "name": "symfony/config", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea" + "reference": "11baeefa4c179d6908655a7b6be728f62367c193" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/fa1219ecbf96bb5db59f2599cba0960a0d9c3aea", - "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea", + "url": "https://api.github.com/repos/symfony/config/zipball/11baeefa4c179d6908655a7b6be728f62367c193", + "reference": "11baeefa4c179d6908655a7b6be728f62367c193", "shasum": "" }, "require": { @@ -11046,20 +11050,20 @@ "type": "tidelift" } ], - "time": "2020-11-16T18:02:40+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "98cec9b9f410a4832e239949a41d47182862c3a4" + "reference": "829ca6bceaf68036a123a13a979f3c89289eae78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/98cec9b9f410a4832e239949a41d47182862c3a4", - "reference": "98cec9b9f410a4832e239949a41d47182862c3a4", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/829ca6bceaf68036a123a13a979f3c89289eae78", + "reference": "829ca6bceaf68036a123a13a979f3c89289eae78", "shasum": "" }, "require": { @@ -11130,7 +11134,7 @@ "type": "tidelift" } ], - "time": "2020-11-28T11:24:18+00:00" + "time": "2020-10-27T10:11:13+00:00" }, { "name": "symfony/deprecation-contracts", @@ -11198,16 +11202,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6" + "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e4576271ee99123aa59a40564c7b5405f0ebd1e6", - "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", + "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", "shasum": "" }, "require": { @@ -11264,25 +11268,24 @@ "type": "tidelift" } ], - "time": "2020-11-27T06:13:25+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/mime", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" + "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", + "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" @@ -11292,11 +11295,7 @@ }, "require-dev": { "egulias/email-validator": "^2.1.10", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/property-access": "^4.4|^5.1", - "symfony/property-info": "^4.4|^5.1", - "symfony/serializer": "^5.2" + "symfony/dependency-injection": "^4.4|^5.0" }, "type": "library", "autoload": { @@ -11341,26 +11340,25 @@ "type": "tidelift" } ], - "time": "2020-10-30T14:55:39+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986" + "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/87a2a4a766244e796dd9cb9d6f58c123358cd986", - "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", + "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.15" }, "type": "library", @@ -11407,7 +11405,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:08:07+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/polyfill-php70", @@ -11476,16 +11474,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "2b105c0354f39a63038a1d8bf776ee92852813af" + "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2b105c0354f39a63038a1d8bf776ee92852813af", - "reference": "2b105c0354f39a63038a1d8bf776ee92852813af", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/3d9f57c89011f0266e6b1d469e5c0110513859d5", + "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5", "shasum": "" }, "require": { @@ -11531,20 +11529,20 @@ "type": "tidelift" } ], - "time": "2020-11-01T16:14:45+00:00" + "time": "2020-10-24T12:01:57+00:00" }, { "name": "symfony/yaml", - "version": "v5.2.0", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598" + "reference": "f284e032c3cefefb9943792132251b79a6127ca6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598", - "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6", + "reference": "f284e032c3cefefb9943792132251b79a6127ca6", "shasum": "" }, "require": { @@ -11603,7 +11601,7 @@ "type": "tidelift" } ], - "time": "2020-11-28T10:57:20+00:00" + "time": "2020-10-24T12:03:25+00:00" }, { "name": "thecodingmachine/safe", From 7533af278e289559f03405f39a6f1132b1f4a966 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak <oposyniak@magento.com> Date: Fri, 4 Dec 2020 07:33:27 -0600 Subject: [PATCH 427/490] MCLOUD-7366: Static test failure with AWS S3 module name --- .../Test/Integrity/_files/blacklist/composer_module_names.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer_module_names.txt diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer_module_names.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer_module_names.txt new file mode 100644 index 0000000000000..84ce58249ae36 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer_module_names.txt @@ -0,0 +1 @@ +magento/module-aws-s3 From b85ba435bba0bcfdfe47a136f239eeb3194ef938 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 4 Dec 2020 16:27:24 +0200 Subject: [PATCH 428/490] fix integration tests --- dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php | 1 + .../Controller/Adminhtml/Dashboard/IndexTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php index 63fcfbd061877..85bf40b342fb5 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php @@ -149,6 +149,7 @@ public function testGetAttributeWithCacheUserDefinedAttribute() $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); $updatedAttribute = $config->getAttribute($entityType, 'foo'); $this->assertEquals('foo', $updatedAttribute->getFrontendLabel()); + CacheCleaner::clean(['eav']); $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); // Check that attribute data has changed $updatedAttributeAfterCacheClean = $config->getAttribute($entityType, 'foo'); diff --git a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php index 63c5e04bac84a..ffe2a4d6ca1c5 100644 --- a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php @@ -34,6 +34,7 @@ protected function setUp(): void protected function tearDown(): void { $this->objectManager->removeSharedInstance(ContentProviderInterface::class); + CacheCleaner::clean(['layout']); parent::tearDown(); } From 424754fe4bc2acec733f6bc9736afde5232553c7 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 4 Dec 2020 18:27:06 +0200 Subject: [PATCH 429/490] changed naming --- ...ITest.xml => AdminMassOrdersCancelClosedAndCompleteTest.xml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename app/code/Magento/Sales/Test/Mftf/Test/{AdminMassOrdersCancelCompleteAndClosedAPITest.xml => AdminMassOrdersCancelClosedAndCompleteTest.xml} (98%) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml similarity index 98% rename from app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml rename to app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml index 5cb54f0fd5613..a4f4e006837e1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelCompleteAndClosedAPITest"> + <test name="AdminMassOrdersCancelClosedAndCompleteTest"> <annotations> <stories value="Mass Update Orders"/> <title value="Mass cancel orders in status Complete, Closed"/> From 035442d47019e7a82bc193787adce2086032f3a5 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 4 Dec 2020 18:27:58 +0200 Subject: [PATCH 430/490] updated deprecated test --- .../Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml index 793e1a07950c9..10b3ba05aa2bb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelCompleteAndClosedAPITest instead"> + <test name="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelClosedAndCompleteTest instead"> <annotations> <stories value="Mass Update Orders"/> <title value="DEPRECATED. Mass cancel orders in status Complete, Closed"/> @@ -18,7 +18,7 @@ <group value="sales"/> <group value="mtf_migrated"/> <skip> - <issueId value="DEPRECATED">Use AdminMassOrdersCancelCompleteAndClosedAPITest instead</issueId> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelClosedAndCompleteTest instead</issueId> </skip> </annotations> <before> From 01451f5bd1b2fdc403bed1c382c8dd3fd3879ee3 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Mon, 7 Dec 2020 10:58:20 +0200 Subject: [PATCH 431/490] MC-35717: Admin can not add a Product with a Customizable Option (File) to Order by SKU --- .../catalog/product/composite/configure.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index fcb193b9565ef..4040ff9d684f4 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -617,12 +617,14 @@ define([ * @param blockItem */ var _renameFields = function (method, blockItem, listType) { - var pattern = null; - var patternFlat = null; - var replacement = null; - var replacementFlat = null; - var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]]+)\]$/); - var itemId = scopeArr[1]; + var pattern = null; + var patternFlat = null; + var patternPrefix = RegExp('\\s', 'g'); + var replacement = null; + var replacementFlat = null; + var replacementPrefix = '_'; + var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]]+)\]$/); + var itemId = scopeArr[1]; if (method == 'current_confirmed_to_form') { pattern = RegExp('(\\w+)(\\[?)'); @@ -652,12 +654,15 @@ define([ var rename = function (elms) { for (var i = 0; i < elms.length; i++) { if (elms[i].name && elms[i].type == 'file') { - elms[i].name = elms[i].name.replace(patternFlat, replacementFlat); + var prefixName = 'options[files_prefix]', + prefixValue = 'item_' + itemId + '_'; + self.blockFormFields.insert(new Element('input', { type: 'hidden', - name: 'options[files_prefix]'.replace(pattern, replacement), - value: 'item_' + itemId + '_' + name: prefixName.replace(pattern, replacement), + value: prefixValue.replace(patternPrefix, replacementPrefix) })); + elms[i].name = elms[i].name.replace(patternFlat, replacementFlat); } else if (elms[i].name) { elms[i].name = elms[i].name.replace(pattern, replacement); } From beb05984b2798ffdb262bac8c65174a5f89355ad Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 7 Dec 2020 11:10:56 +0200 Subject: [PATCH 432/490] MC-38973: Duplicate address by order from admin --- .../Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml index ac0af3f5b80db..f8136a9071a1a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml @@ -47,6 +47,8 @@ <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> + <!-- By default checkbox 'Add to address book' must be unchecked --> + <dontSeeCheckboxIsChecked selector="{{AdminOrderFormBillingAddressSection.SaveAddress}}" stepKey="checkBoxAddBillingAddressIsUnchecked"/> <!-- Just in case uncheck and check 'Same as Billing Address checkbox' --> <comment userInput="Just in case uncheck and check 'Same as Billing Address checkbox'" stepKey="uncheckAndCheckAgain"/> <uncheckOption selector="{{AdminOrderFormShippingAddressSection.SameAsBilling}}" stepKey="unCheckSameAsShippingAddressCheckbox"/> From f65490bb49a827eaf345173f16dbfd93371fb554 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Mon, 7 Dec 2020 11:45:08 +0200 Subject: [PATCH 433/490] MC-36779: Product still present in the Wish List after added to order --- .../Test/CreateOrderFromEditCustomerPageTest.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 89a5fe07ced6a..e4feb033cd610 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -139,15 +139,13 @@ <!-- Move products to order from Wish List --> <waitForElementVisible selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForCheckBoxToVisible"/> <click selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectProductToAddToOrder"/> - <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesButton"/> <click selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder($$createConfigProduct.name$$)}}" stepKey="AddConfigurableProductToOrder"/> <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" stepKey="waitForConfigurablePopover"/> <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> - - <!-- After move, assert products are NOT present in Wish List section --> - <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$simpleProduct.name$" stepKey="dontSeeSimpleProductInWishList"/> - <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$createConfigProduct.name$" stepKey="dontSeeConfigurableProductInWishList"/> + <comment userInput="Click OK button to update lists" stepKey="clickOnUpdateButton"/> + <waitForPageLoad stepKey="waitForAdminOrderItemsOrderedSectionPageLoad1"/> <!-- Assert Products in Order item section --> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid"/> @@ -174,6 +172,10 @@ <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="donSeeProductInShoppingCart"/> <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="dontSeeSecondProductInShoppingCart"/> + <!-- After move, assert products are not present in Wish List section --> + <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList1"/> + <dontSee selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList1"/> + <!-- After move, assert products are present in order items section --> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid1"/> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid1"/> From edbb92b3e8e72c76e537a1d490fc870630eb2bb3 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 7 Dec 2020 12:10:22 +0200 Subject: [PATCH 434/490] MC-39128: Cannot delete second layout update in widget --- app/code/Magento/Backend/Block/Widget/Button.php | 5 ++++- .../Backend/Test/Unit/Block/Widget/ButtonTest.php | 12 ++++++++++++ .../Widget/Instance/Edit/Tab/Main/Layout.php | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Button.php b/app/code/Magento/Backend/Block/Widget/Button.php index 3b5eca6a61779..cb8269f692f02 100644 --- a/app/code/Magento/Backend/Block/Widget/Button.php +++ b/app/code/Magento/Backend/Block/Widget/Button.php @@ -5,9 +5,9 @@ */ namespace Magento\Backend\Block\Widget; +use Magento\Backend\Block\Template\Context; use Magento\Framework\App\ObjectManager; use Magento\Framework\Math\Random; -use Magento\Backend\Block\Template\Context; use Magento\Framework\View\Helper\SecureHtmlRenderer; /** @@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled) 'value' => $this->getValue(), 'disabled' => $disabled, ]; + if ($this->hasData('onclick_attribute')) { + $attributes['onclick'] = $this->getData('onclick_attribute'); + } if ($this->hasData('backend_button_widget_hook_id')) { $attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id'); } diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php index be14a51ffb27b..33667f158b9d9 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php @@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider() ] ]; } + + /** + * Verifies ability of adding button onclick attribute + * + * @return void + */ + public function testOnClickAttribute(): void + { + $this->_blockMock->setData(['onclick_attribute' => 'value']); + $attributes = $this->_blockMock->getAttributesHtml(); + $this->assertStringContainsString('onclick', $attributes); + } } diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index c48bf9e7e4c7a..1d8d1ec37494b 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -327,7 +327,7 @@ public function getRemoveLayoutButtonHtml() )->setData( [ 'label' => $this->escapeHtmlAttr(__('Remove Layout Update')), - 'onclick' => 'WidgetInstance.removePageGroup(this)', + 'onclick_attribute' => 'WidgetInstance.removePageGroup(this)', 'class' => 'action-delete', ] ); From 32b93deca198a62fc4e2e67012d63ad457c43728 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 7 Dec 2020 13:30:04 +0200 Subject: [PATCH 435/490] fix graphql test --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index 2f6fc2ee112fa..c87daafa66728 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,11 +223,10 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), - $customUrl, + $customUrl . ' ', $actualUrls->getRequestPath(), strtoupper($actualUrls->getEntityType()), 301 From a4403e9006d1bb4a4c75baa71915b7df12e3c7e8 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Mon, 7 Dec 2020 13:55:42 +0200 Subject: [PATCH 436/490] Rename AdminCheckProductQtyAfterOrderCancelling.xml to AdminCheckProductQtyAfterOrderCancellingTest.xml --- ...lling.xml => AdminCheckProductQtyAfterOrderCancellingTest.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/ConfigurableProduct/Test/Mftf/Test/{AdminCheckProductQtyAfterOrderCancelling.xml => AdminCheckProductQtyAfterOrderCancellingTest.xml} (100%) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancellingTest.xml similarity index 100% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancellingTest.xml From 2f8b94d171dbb8c0847ffe7e6b3b013431c233c3 Mon Sep 17 00:00:00 2001 From: Viktor Kopin <viktor.kopin@transoftgroup.com> Date: Mon, 7 Dec 2020 14:03:15 +0200 Subject: [PATCH 437/490] MC-39521: Random deadlocks during setting email sent flag --- app/code/Magento/Sales/Model/EmailSenderHandler.php | 5 +++-- .../Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Model/EmailSenderHandler.php b/app/code/Magento/Sales/Model/EmailSenderHandler.php index a201c1285ae49..3a7a5727d8341 100644 --- a/app/code/Magento/Sales/Model/EmailSenderHandler.php +++ b/app/code/Magento/Sales/Model/EmailSenderHandler.php @@ -132,8 +132,9 @@ public function sendEmails() /** @var \Magento\Sales\Model\AbstractModel $item */ foreach ($entityCollection->getItems() as $item) { if ($this->emailSender->send($item, true)) { - $this->entityResource->save( - $item->setEmailSent(true) + $this->entityResource->saveAttribute( + $item->setEmailSent(true), + 'email_sent' ); } } diff --git a/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php b/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php index 757a026aa5d68..2a7b44efa5261 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php @@ -100,7 +100,7 @@ protected function setUp(): void false, false, true, - ['save'] + ['saveAttribute'] ); $this->entityCollection = $this->getMockForAbstractClass( @@ -252,7 +252,7 @@ public function testExecute($configValue, $collectionItems, $emailSendingResult) $this->entityResource ->expects($this->once()) - ->method('save') + ->method('saveAttribute') ->with($collectionItem); } } From 8f40a2b8ee2e0e091573ea84c496be5808b495b7 Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Sat, 5 Dec 2020 07:59:57 -0600 Subject: [PATCH 438/490] MC-39034: GraphQL shows incorrect grand total on the Billing Step - Adding test and empty checking of shipping amount --- .../Magento/SalesRule/Model/Validator.php | 2 +- .../Test/Unit/Model/ValidatorTest.php | 83 ++++++++++++++++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index cc0333480f7b0..7b3a6b15b7a32 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -318,7 +318,7 @@ public function process(AbstractItem $item) public function processShippingAmount(Address $address) { $shippingAmount = $address->getShippingAmountForDiscount(); - if ($shippingAmount !== null) { + if (!empty($shippingAmount)) { $baseShippingAmount = $address->getBaseShippingAmountForDiscount(); } else { $shippingAmount = $address->getShippingAmount(); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php index 4224cfafb3c8c..c895802153f45 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php @@ -33,6 +33,7 @@ use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Zend_Db_Select_Exception; /** * Test sales rule model validator @@ -538,7 +539,7 @@ public function testProcessShippingAmountProcessDisabled() * @param int $ruleDiscount * @param int $shippingDiscount * @dataProvider dataProviderActions - * @throws \Zend_Db_Select_Exception + * @throws Zend_Db_Select_Exception */ public function testProcessShippingAmountActions($action, $ruleDiscount, $shippingDiscount): void { @@ -595,6 +596,86 @@ public static function dataProviderActions() ]; } + /** + * Tests shipping amount with full discount action. + * + * @dataProvider dataProviderForFullShippingDiscount + * @param string $action + * @param float $ruleDiscount + * @param float $shippingDiscount + * @param float $shippingAmount + * @param float $quoteBaseSubTotal + * @throws Zend_Db_Select_Exception + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testProcessShippingAmountWithFullFixedPercentDiscount( + string $action, + float $ruleDiscount, + float $shippingDiscount, + float $shippingAmount, + float $quoteBaseSubTotal + ): void { + $ruleMock = $this->getMockBuilder(Rule::class) + ->disableOriginalConstructor() + ->setMethods(['getApplyToShipping', 'getSimpleAction', 'getDiscountAmount']) + ->getMock(); + $ruleMock->method('getApplyToShipping') + ->willReturn(true); + $ruleMock->method('getDiscountAmount') + ->willReturn($ruleDiscount); + $ruleMock->method('getSimpleAction') + ->willReturn($action); + + $iterator = new \ArrayIterator([$ruleMock]); + $this->ruleCollection->method('getIterator') + ->willReturn($iterator); + + $this->utility->method('canProcessRule') + ->willReturn(true); + + $this->priceCurrency->method('convert') + ->willReturn($ruleDiscount); + + $this->priceCurrency->method('roundPrice') + ->willReturn(round($shippingDiscount, 2)); + + $this->model->init( + $this->model->getWebsiteId(), + $this->model->getCustomerGroupId(), + $this->model->getCouponCode() + ); + + $addressMock = $this->setupAddressMock($shippingAmount, $quoteBaseSubTotal); + + self::assertInstanceOf(Validator::class, $this->model->processShippingAmount($addressMock)); + self::assertEquals($shippingDiscount, $addressMock->getShippingDiscountAmount()); + } + + /** + * Get data provider array for full shipping discount action + * + * @return array + */ + public function dataProviderForFullShippingDiscount(): array + { + return [ + 'verify shipping discount when shipping amount is greater than zero' => [ + Rule::BY_PERCENT_ACTION, + 100.00, + 5.0, + 5.0, + 10.0 + ], + 'verify shipping discount when shipping amount is zero' => [ + Rule::BY_PERCENT_ACTION, + 100.00, + 5.0, + 0, + 10.0 + ] + ]; + } + /** * @param float $shippingAmount * @param float $quoteBaseSubTotal From 0d1c10836b6b8e5cce7ad2706845db2098387f5b Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Tue, 8 Dec 2020 02:46:29 +0200 Subject: [PATCH 439/490] Fix unit test subscription --- .../Mview/Test/Unit/View/SubscriptionTest.php | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 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 3142356d44084..3f3c326beb5a5 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -49,6 +49,16 @@ class SubscriptionTest extends TestCase /** @var string */ private $tableName; + /** + * @var Config|MockObject + */ + private $mviewConfig; + + /** + * @var DefaultProcessor|MockObject + */ + private $defaultProcessor; + protected function setUp(): void { $this->tableName = 'test_table'; @@ -59,17 +69,14 @@ protected function setUp(): void ->method('quoteIdentifier') ->willReturnArgument(0); - $this->connectionMock->expects($this->any()) - ->method('describeTable') - ->willReturn([]); - + $this->defaultProcessor = $this->createMock(DefaultProcessor::class); $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); ObjectManager::getInstance()->expects($this->any()) ->method('get') ->with(DefaultProcessor::class) - ->willReturn(2); + ->willReturn($this->defaultProcessor); $this->triggerFactoryMock = $this->createMock(TriggerFactory::class); $this->viewCollectionMock = $this->getMockForAbstractClass( CollectionInterface::class, @@ -114,6 +121,7 @@ protected function setUp(): void $this->tableName, 'columnName', [], + [], $mviewConfigMock ); } @@ -367,12 +375,24 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ] ] ]; + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'subscriptions' => [ + $tableName => [ + 'processor' => DefaultProcessor::class + ] + ] + ]); - $this->connectionMock->expects($this->once()) + $this->connectionMock->expects($this->any()) ->method('isTableExists') + ->with('cataloginventory_stock_item') ->willReturn(true); - $this->connectionMock->expects($this->once()) + $this->connectionMock->expects($this->any()) ->method('describeTable') + ->with($tableName) ->willReturn([ 'item_id' => ['COLUMN_NAME' => 'item_id'], 'product_id' => ['COLUMN_NAME' => 'product_id'], @@ -383,10 +403,14 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ]); $otherChangelogMock = $this->getMockForAbstractClass(ChangelogInterface::class); - $otherChangelogMock->expects($this->once()) + $otherChangelogMock->expects($this->any()) ->method('getViewId') ->willReturn($viewId); + $otherChangelogMock->expects($this->once()) + ->method('getColumnName') + ->willReturn('entity_id'); + $model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, @@ -395,7 +419,8 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void $tableName, 'columnName', [], - $ignoredData + $ignoredData, + $mviewConfigMock ); $method = new \ReflectionMethod($model, 'buildStatement'); From 958582ee34a6734f101074d64680ad57f9f70f50 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 8 Dec 2020 12:20:49 +0200 Subject: [PATCH 440/490] add mftf --- ...tProductOnGroupedOptionGridActionGroup.xml | 31 +++++++++++++ .../AdminGroupedProductOptionGridSection.xml | 15 +++++++ ...oupedProductNonDefaultAttributeSetTest.xml | 45 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml new file mode 100644 index 0000000000000..2f706f45f834d --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AdminAssertProductOnGroupedOptionGridActionGroup"> + <annotations> + <description>Admin assert product on grouped option grid.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <grabTextFrom selector="{{AdminGroupedProductOptionGridSection.productName}}" stepKey="grabProductName"/> + <assertEquals stepKey="assertProductName"> + <expectedResult type="string">{{product.name}}</expectedResult> + <actualResult type="variable">$grabProductName</actualResult> + </assertEquals> + + <grabTextFrom selector="{{AdminGroupedProductOptionGridSection.productSku}}" stepKey="grabProductSku"/> + <assertEquals stepKey="assertProductSku"> + <expectedResult type="string">{{product.sku}}</expectedResult> + <actualResult type="variable">$grabProductSku</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml new file mode 100644 index 0000000000000..1fff52c1d30cd --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml @@ -0,0 +1,15 @@ +<?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="AdminGroupedProductOptionGridSection"> + <element name="productName" type="text" selector=".data-row td[data-index='name']"/> + <element name="productSku" type="text" selector=".data-row td[data-index='sku']"/> + </section> +</sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml new file mode 100644 index 0000000000000..44ea267c7b5d4 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml @@ -0,0 +1,45 @@ +<?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="AdminCreateGroupedProductNonDefaultAttributeSetTest"> + <annotations> + <features value="GroupedProduct"/> + <stories value="Create product"/> + <title value="Create Grouped Product when non-default attribute set is chosen"/> + <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <group value="groupedProduct"/> + </annotations> + <before> + <createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/> + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/> + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> + </after> + + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createGroupedProduct"> + <argument name="productType" value="grouped"/> + </actionGroup> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> + <argument name="attributeSetName" value="$createAttributeSet.attribute_set_name$"/> + </actionGroup> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> + <argument name="product" value="GroupedProduct"/> + </actionGroup> + <actionGroup ref="AdminAssignProductToGroupActionGroup" stepKey="addSimpleToGroup"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <actionGroup ref="AdminAssertProductOnGroupedOptionGridActionGroup" stepKey="assertProductOptionGrid"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + </test> +</tests> From 4bdc98ef49516d2a89dc7ff61df4bcee200007a5 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:04:41 +0200 Subject: [PATCH 441/490] add severity --- .../Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml index 44ea267c7b5d4..95607a83dd26f 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml @@ -13,6 +13,7 @@ <stories value="Create product"/> <title value="Create Grouped Product when non-default attribute set is chosen"/> <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <severity value="MAJOR"/> <group value="groupedProduct"/> </annotations> <before> From 44809b951e2a96161de14132fd899098e2746e63 Mon Sep 17 00:00:00 2001 From: SmVladyslav <vlatame.tsg@gmail.com> Date: Tue, 8 Dec 2020 14:01:02 +0200 Subject: [PATCH 442/490] MC-36779: Product still present in the Wish List after added to order --- .../Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml | 2 +- .../Sales/view/adminhtml/web/order/create/scripts.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index e4feb033cd610..08d5776b79ea0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -144,7 +144,7 @@ <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" stepKey="waitForConfigurablePopover"/> <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> - <comment userInput="Click OK button to update lists" stepKey="clickOnUpdateButton"/> + <comment userInput="Action should be removed but replaced with comment due to backward compatibility" stepKey="clickOnUpdateButton"/> <waitForPageLoad stepKey="waitForAdminOrderItemsOrderedSectionPageLoad1"/> <!-- Assert Products in Order item section --> diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index f90ad563331e6..9454fe17fe2d2 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -964,17 +964,17 @@ define([ }.bind(this)); // response handler productConfigure.setOnLoadIFrameCallback(listType, function (response) { - var area = ['items', 'shipping_method', 'billing_method', 'totals', 'giftmessage']; + var areas = ['items', 'shipping_method', 'billing_method', 'totals', 'giftmessage']; if (!response.ok) { return; } if (isWishlist) { this.removeSidebarItem(itemId, 'wishlist').done(function () { - this.loadArea(area, true); + this.loadArea(areas, true); }.bind(this)); } else { - this.loadArea(area, true); + this.loadArea(areas, true); } }.bind(this)); // show item configuration From 513bb0b5ca9c107a260d7c276b01aa26a28a25b8 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 7 Dec 2020 15:09:48 -0600 Subject: [PATCH 443/490] MC-39569: Indexers invalidated when removing products from a category - Remove catalog_category_change_products observer that invalidates category product indexer --- .../Observer/CategoryProductIndexer.php | 16 ++- .../Model/Indexer/Category/ProductTest.php | 30 ---- .../Model/ResourceModel/CategoryTest.php | 136 ++++++++++++++++++ .../catalog_category_product_reindex_all.php | 16 +++ .../catalog_product_category_reindex_all.php | 16 +++ ...alog_product_reindex_schedule_rollback.php | 12 +- 6 files changed, 190 insertions(+), 36 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_category_product_reindex_all.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_product_category_reindex_all.php diff --git a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php index ca87efaa87490..bdee84762cac2 100644 --- a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php +++ b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Observer; use Magento\Catalog\Model\Indexer\Category\Product\Processor; +use Magento\Catalog\Model\Indexer\Category\Flat\State as FlatState; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; @@ -21,12 +22,21 @@ class CategoryProductIndexer implements ObserverInterface */ private $processor; + /** + * @var FlatState + */ + private $flatState; + /** * @param Processor $processor + * @param FlatState $flatState */ - public function __construct(Processor $processor) - { + public function __construct( + Processor $processor, + FlatState $flatState + ) { $this->processor = $processor; + $this->flatState = $flatState; } /** @@ -35,7 +45,7 @@ public function __construct(Processor $processor) public function execute(Observer $observer): void { $productIds = $observer->getEvent()->getProductIds(); - if (!empty($productIds) && $this->processor->isIndexerScheduled()) { + if (!empty($productIds) && $this->processor->isIndexerScheduled() && $this->flatState->isFlatEnabled()) { $this->processor->markIndexerAsInvalid(); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php index 8e11efa8790cf..5cfa07cf5d402 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php @@ -245,36 +245,6 @@ public function testCatalogCategoryProductIndexInvalidateAfterDelete(): void $this->assertEquals(StateInterface::STATUS_INVALID, $status); } - /** - * Test invalidate reindex after change product position on category - * - * @magentoAppArea adminhtml - * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php - * - * @return void - */ - public function testCatalogCategoryProductIndexInvalidateAfterChangeProductPosition(): void - { - $this->indexer->setScheduled(true); - $indexerShouldBeValid = $this->indexer->isValid(); - - $category = $this->getCategoryByName->execute('Category 999'); - - $category->setPostedProducts([ - $this->productResource->getIdBySku('simple1000') => 1, - $this->productResource->getIdBySku('simple1001') => 2 - ]); - - $this->categoryResource->save($category); - - $state = $this->indexer->getState(); - $state->loadByIndexer($this->indexer->getId()); - $status = $state->getStatus(); - - $this->assertTrue($indexerShouldBeValid); - $this->assertEquals(StateInterface::STATUS_INVALID, $status); - } - /** * @param int $count * @return Category[] diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/CategoryTest.php index c57e981f772de..66e117a61ed2c 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/CategoryTest.php @@ -10,14 +10,21 @@ use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category as CategoryModel; +use Magento\Catalog\Model\Indexer\Category\Product as CategoryProductIndexer; +use Magento\Catalog\Model\Indexer\Product\Category as ProductCategoryIndexer; use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Indexer\IndexerInterface; +use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\UrlInterface; +use Magento\Indexer\Cron\UpdateMview; use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -26,6 +33,7 @@ * Tests category resource model * * @see \Magento\Catalog\Model\ResourceModel\Category + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CategoryTest extends TestCase { @@ -54,6 +62,11 @@ class CategoryTest extends TestCase /** @var WriteInterface */ private $mediaDirectory; + /** + * @var ProductResource + */ + private $productResource; + /** * @inheritdoc */ @@ -68,6 +81,7 @@ protected function setUp(): void $this->categoryCollection = $this->objectManager->get(CategoryCollectionFactory::class)->create(); $this->filesystem = $this->objectManager->get(Filesystem::class); $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->productResource = Bootstrap::getObjectManager()->get(ProductResource::class); } /** @@ -116,6 +130,128 @@ public function testAddImageForCategory(): void $this->assertFileExists($this->mediaDirectory->getAbsolutePath($imageRelativePath)); } + /** + * Test that adding or removing products in a category should not trigger full reindex in scheduled update mode + * + * @magentoAppArea adminhtml + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/category_with_three_products.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_duplicated.php + * @magentoDataFixture Magento/Catalog/_files/catalog_category_product_reindex_all.php + * @magentoDataFixture Magento/Catalog/_files/catalog_product_category_reindex_all.php + * @magentoDataFixture Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + * @dataProvider catalogProductChangesWithScheduledUpdateDataProvider + * @param array $products + * @return void + */ + public function testCatalogProductChangesWithScheduledUpdate(array $products): void + { + // products are ordered by entity_id DESC because their positions are same and equal to 0 + $initialProducts = ['simple1002', 'simple1001', 'simple1000']; + $defaultStoreId = (int) $this->storeManager->getDefaultStoreView()->getId(); + $category = $this->getCategory(['name' => 'Category 999']); + $expectedProducts = array_keys($products); + $productIdsBySkus = $this->productResource->getProductsIdsBySkus($expectedProducts); + $postedProducts = []; + foreach ($products as $sku => $position) { + $postedProducts[$productIdsBySkus[$sku]] = $position; + } + $category->setPostedProducts($postedProducts); + $this->categoryResource->save($category); + // Indices should not be invalidated when adding/removing/reordering products in a category. + $categoryProductIndexer = $this->getIndexer(CategoryProductIndexer::INDEXER_ID); + $this->assertTrue( + $categoryProductIndexer->isValid(), + '"Indexed category/products association" indexer should not be invalidated.' + ); + $productCategoryIndexer = $this->getIndexer(ProductCategoryIndexer::INDEXER_ID); + $this->assertTrue( + $productCategoryIndexer->isValid(), + '"Indexed product/categories association" indexer should not be invalidated.' + ); + // catalog products is not update until partial reindex occurs + $collection = $this->getCategoryProducts($category, $defaultStoreId); + $this->assertEquals($initialProducts, $collection->getColumnValues('sku')); + // Execute MVIEW cron handler for cron job "indexer_update_all_views" + /** @var $mViewCron UpdateMview */ + $mViewCron = $this->objectManager->create(UpdateMview::class); + $mViewCron->execute(); + $collection = $this->getCategoryProducts($category, $defaultStoreId); + $this->assertEquals($expectedProducts, $collection->getColumnValues('sku')); + } + + /** + * @return array + */ + public function catalogProductChangesWithScheduledUpdateDataProvider(): array + { + return [ + 'change products position' => [ + [ + 'simple1002' => 1, + 'simple1000' => 2, + 'simple1001' => 3, + ] + ], + 'Add new product' => [ + [ + 'simple1002' => 1, + 'simple1000' => 2, + 'simple-1' => 3, + 'simple1001' => 4, + ] + ], + 'Delete product' => [ + [ + 'simple1002' => 1, + 'simple1000' => 2, + ] + ] + ]; + } + + /** + * @param CategoryModel $category + * @param int $defaultStoreId + * @return ProductCollection + */ + private function getCategoryProducts(CategoryModel $category, int $defaultStoreId) + { + /** @var ProductCollection $collection */ + $collection = $this->objectManager->create(ProductCollection::class); + $collection->setStoreId($defaultStoreId); + $collection->addCategoryFilter($category); + $collection->addAttributeToSort('position'); + return $collection; + } + + /** + * @param array $filters + * @return CategoryModel + */ + private function getCategory(array $filters): CategoryModel + { + /** @var CategoryCollection $categoryCollection */ + $categoryCollection = $this->objectManager->create(CategoryCollection::class); + foreach ($filters as $field => $value) { + $categoryCollection->addFieldToFilter($field, $value); + } + + return $categoryCollection->getFirstItem(); + } + + /** + * @param string $indexerId + * @return IndexerInterface + */ + private function getIndexer(string $indexerId): IndexerInterface + { + /** @var IndexerRegistry $indexerRegistry */ + $indexerRegistry = $this->objectManager->get(IndexerRegistry::class); + return $indexerRegistry->get($indexerId); + } + /** * Prepare image url for image data * diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_category_product_reindex_all.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_category_product_reindex_all.php new file mode 100644 index 0000000000000..3dfba9266cddc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_category_product_reindex_all.php @@ -0,0 +1,16 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Model\Indexer\Category\Product as CategoryProductIndexer; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var IndexerRegistry $indexRegistry */ +$indexRegistry = Bootstrap::getObjectManager()->get(IndexerRegistry::class); + +$model = $indexRegistry->get(CategoryProductIndexer::INDEXER_ID); +$model->reindexAll(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_product_category_reindex_all.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_product_category_reindex_all.php new file mode 100644 index 0000000000000..6143933ba3d6c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/catalog_product_category_reindex_all.php @@ -0,0 +1,16 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Model\Indexer\Product\Category as ProductCategoryIndexer; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var IndexerRegistry $indexRegistry */ +$indexRegistry = Bootstrap::getObjectManager()->get(IndexerRegistry::class); + +$model = $indexRegistry->get(ProductCategoryIndexer::INDEXER_ID); +$model->reindexAll(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/enable_catalog_product_reindex_schedule_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/enable_catalog_product_reindex_schedule_rollback.php index 429f89abb6ae7..8909b258b9f9c 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/enable_catalog_product_reindex_schedule_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/enable_catalog_product_reindex_schedule_rollback.php @@ -5,8 +5,14 @@ */ declare(strict_types=1); -use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Framework\Indexer\IndexerRegistry; use Magento\TestFramework\Helper\Bootstrap; -$indexerProcessor = Bootstrap::getObjectManager()->get(Processor::class); -$indexerProcessor->getIndexer()->setScheduled(false); +/** @var IndexerRegistry $indexRegistry */ +$indexRegistry = Bootstrap::getObjectManager()->get(IndexerRegistry::class); + +$model = $indexRegistry->get('catalog_category_product'); +$model->setScheduled(false); + +$model = $indexRegistry->get('catalog_product_category'); +$model->setScheduled(false); From 2195e725cb95d60dd57c717a98fc096768a695b0 Mon Sep 17 00:00:00 2001 From: Viktor Kopin <viktor.kopin@transoftgroup.com> Date: Mon, 30 Nov 2020 08:37:35 +0200 Subject: [PATCH 444/490] MC-38931: Product URL Rewrites are not removed when product removed from website --- .../GetProductUrlRewriteDataByStore.php | 76 +++ .../Products/AppendUrlRewritesToProducts.php | 159 ++++++ .../Product/GetUrlRewriteData.php | 94 ++++ ...ProductProcessUrlRewriteSavingObserver.php | 141 +++-- .../ProductToWebsiteChangeObserver.php | 104 ---- .../UpdateProductWebsiteUrlRewrites.php | 97 ++++ ...uctProcessUrlRewriteSavingObserverTest.php | 191 ++++--- .../etc/adminhtml/events.xml | 12 - app/code/Magento/CatalogUrlRewrite/etc/di.xml | 3 + .../GetStoresListByWebsiteIds.php | 45 ++ ...idByRequestPathAndStoreViewActionGroup.xml | 20 + ...SeveralWebsitesAndCheckURLRewritesTest.xml | 3 +- .../Api/ProductRepositoryInterfaceTest.php | 56 +- .../Model/ProductUrlRewriteTest.php | 7 + ...uctProcessUrlRewriteSavingObserverTest.php | 488 ++++++++++++++++-- .../UpdateProductWebsiteUrlRewritesTest.php | 72 +++ .../Model/StoreSwitcher/RewriteUrlTest.php | 2 +- 17 files changed, 1308 insertions(+), 262 deletions(-) create mode 100644 app/code/Magento/CatalogUrlRewrite/Model/Product/GetProductUrlRewriteDataByStore.php create mode 100644 app/code/Magento/CatalogUrlRewrite/Model/Products/AppendUrlRewritesToProducts.php create mode 100644 app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Product/GetUrlRewriteData.php delete mode 100644 app/code/Magento/CatalogUrlRewrite/Observer/ProductToWebsiteChangeObserver.php create mode 100644 app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php delete mode 100644 app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml create mode 100644 app/code/Magento/Store/Model/StoreResolver/GetStoresListByWebsiteIds.php create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup.xml create mode 100644 dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Product/GetProductUrlRewriteDataByStore.php b/app/code/Magento/CatalogUrlRewrite/Model/Product/GetProductUrlRewriteDataByStore.php new file mode 100644 index 0000000000000..fbacddac1ce02 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/Product/GetProductUrlRewriteDataByStore.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\Product; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\CatalogUrlRewrite\Model\ResourceModel\Product\GetUrlRewriteData; +use Magento\Store\Model\Store; + +/** + * Product data needed for url rewrite generation locator class + */ +class GetProductUrlRewriteDataByStore +{ + /** + * @var array + */ + private $urlRewriteData = []; + + /** + * @var GetUrlRewriteData + */ + private $getUrlRewriteData; + + /** + * @param GetUrlRewriteData $getUrlRewriteData + */ + public function __construct(GetUrlRewriteData $getUrlRewriteData) + { + $this->getUrlRewriteData = $getUrlRewriteData; + } + + /** + * Retrieves data for product by store + * + * @param ProductInterface $product + * @param int $storeId + * @return array + */ + public function execute(ProductInterface $product, int $storeId): array + { + $productId = $product->getId(); + if (isset($this->urlRewriteData[$productId][$storeId])) { + return $this->urlRewriteData[$productId][$storeId]; + } + if (empty($this->urlRewriteData[$productId])) { + $storesData = $this->getUrlRewriteData->execute($product); + foreach ($storesData as $storeData) { + $this->urlRewriteData[$productId][$storeData['store_id']] = [ + 'visibility' => (int)($storeData['visibility'] ?? $storesData[Store::DEFAULT_STORE_ID]['visibility']), + 'url_key' => $storeData['url_key'] ?? $storesData[Store::DEFAULT_STORE_ID]['url_key'], + ]; + } + } + + if (!isset($this->urlRewriteData[$productId][$storeId])) { + $this->urlRewriteData[$productId][$storeId] = $this->urlRewriteData[$productId][Store::DEFAULT_STORE_ID]; + } + + return $this->urlRewriteData[$productId][$storeId]; + } + + /** + * Clears product url rewrite data in local cache + * + * @param ProductInterface $product + */ + public function clearProductUrlRewriteDataCache(ProductInterface $product) + { + unset($this->urlRewriteData[$product->getId()]); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Products/AppendUrlRewritesToProducts.php b/app/code/Magento/CatalogUrlRewrite/Model/Products/AppendUrlRewritesToProducts.php new file mode 100644 index 0000000000000..15d4aabf4246b --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/Products/AppendUrlRewritesToProducts.php @@ -0,0 +1,159 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\Products; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Visibility; +use Magento\CatalogUrlRewrite\Model\Product\GetProductUrlRewriteDataByStore; +use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\CatalogUrlRewrite\Service\V1\StoreViewService; +use Magento\Store\Model\Store; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\UrlRewrite\Model\UrlPersistInterface; + +/** + * Update existing url rewrites or create new ones if needed + */ +class AppendUrlRewritesToProducts +{ + /** + * @var ProductUrlRewriteGenerator + */ + private $productUrlRewriteGenerator; + + /** + * @var StoreViewService + */ + private $storeViewService; + + /** + * @var ProductUrlPathGenerator + */ + private $productUrlPathGenerator; + + /** + * @var UrlPersistInterface + */ + private $urlPersist; + + /** + * @var GetProductUrlRewriteDataByStore + */ + private $getDataByStore; + + /** + * @param ProductUrlRewriteGenerator $urlRewriteGenerator + * @param StoreViewService $storeViewService + * @param ProductUrlPathGenerator $urlPathGenerator + * @param UrlPersistInterface $urlPersist + * @param GetProductUrlRewriteDataByStore $getDataByStore + */ + public function __construct( + ProductUrlRewriteGenerator $urlRewriteGenerator, + StoreViewService $storeViewService, + ProductUrlPathGenerator $urlPathGenerator, + UrlPersistInterface $urlPersist, + GetProductUrlRewriteDataByStore $getDataByStore + ) { + $this->productUrlRewriteGenerator = $urlRewriteGenerator; + $this->storeViewService = $storeViewService; + $this->productUrlPathGenerator = $urlPathGenerator; + $this->urlPersist = $urlPersist; + $this->getDataByStore = $getDataByStore; + } + + /** + * Update existing rewrites and add for specific stores websites + * + * @param ProductInterface[] $products + * @param array $storesToAdd + * @throws UrlAlreadyExistsException + */ + public function execute(array $products, array $storesToAdd): void + { + foreach ($products as $product) { + $forceGenerateDefault = false; + foreach ($storesToAdd as $storeId) { + if ($this->needGenerateUrlForStore($product, (int)$storeId)) { + $urls[] = $this->generateUrls($product, (int)$storeId); + } elseif ((int)$product->getStoreId() !== Store::DEFAULT_STORE_ID) { + $forceGenerateDefault = true; + } + } + if ($product->getStoreId() === Store::DEFAULT_STORE_ID + || $this->isProductAssignedToStore($product)) { + $product->unsUrlPath(); + $product->setUrlPath($this->productUrlPathGenerator->getUrlPath($product)); + $urls[] = $this->productUrlRewriteGenerator->generate($product); + } + if ($forceGenerateDefault && $product->getStoreId() !== Store::DEFAULT_STORE_ID) { + $urls[] = $this->generateUrls($product, Store::DEFAULT_STORE_ID); + } + $this->getDataByStore->clearProductUrlRewriteDataCache($product); + } + if (!empty($urls)) { + $this->urlPersist->replace(array_merge(...$urls)); + } + } + + /** + * Generate urls for specific store + * + * @param ProductInterface $product + * @param int $storeId + * @return array + */ + private function generateUrls(ProductInterface $product, int $storeId): array + { + $storeData = $this->getDataByStore->execute($product, $storeId); + $origStoreId = $product->getStoreId(); + $origVisibility = $product->getVisibility(); + $origUrlKey = $product->getUrlKey(); + $product->setStoreId($storeId); + $product->setVisibility($storeData['visibility'] ?? Visibility::VISIBILITY_NOT_VISIBLE); + $product->setUrlKey($storeData['url_key'] ?? ''); + $product->unsUrlPath(); + $product->setUrlPath($this->productUrlPathGenerator->getUrlPath($product)); + $urls = $this->productUrlRewriteGenerator->generate($product); + $product->setStoreId($origStoreId); + $product->setVisibility($origVisibility); + $product->setUrlKey($origUrlKey); + + return $urls; + } + + /** + * Does product has scope overridden url key value + * + * @param ProductInterface $product + * @param int $storeId + * @return bool + */ + private function needGenerateUrlForStore(ProductInterface $product, int $storeId): bool + { + return (int)$product->getStoreId() !== $storeId + && $this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore( + $storeId, + $product->getId(), + Product::ENTITY + ); + } + + /** + * Is product still assigned to store which request is performed from + * + * @param ProductInterface $product + * @return bool + */ + private function isProductAssignedToStore(ProductInterface $product): bool + { + return in_array($product->getStoreId(), $product->getStoreIds()); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Product/GetUrlRewriteData.php b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Product/GetUrlRewriteData.php new file mode 100644 index 0000000000000..f4cef73a040e8 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Product/GetUrlRewriteData.php @@ -0,0 +1,94 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\ResourceModel\Product; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Eav\Model\Config; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Select; +use Magento\Framework\EntityManager\MetadataPool; + +/** + * Fetch product url rewrite data from database + */ +class GetUrlRewriteData +{ + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var ResourceConnection + */ + private $resource; + + /** + * @var Config + */ + private $eavConfig; + + /** + * @param MetadataPool $metadataPool + * @param ResourceConnection $connection + * @param Config $eavConfig + */ + public function __construct( + MetadataPool $metadataPool, + ResourceConnection $connection, + Config $eavConfig + ) { + $this->metadataPool = $metadataPool; + $this->resource = $connection; + $this->eavConfig = $eavConfig; + } + + /** + * Fetches product store data required for url key generation + * + * @param ProductInterface $product + * @return array + */ + public function execute(ProductInterface $product): array + { + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $metadata->getLinkField(); + $connection = $this->resource->getConnection(); + $visibilityAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'visibility'); + $urlKeyAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'url_key'); + $visibilitySelect = $connection->select() + ->from(['visibility' => $visibilityAttribute->getBackendTable()]) + ->joinRight( + ['url_key' => $urlKeyAttribute->getBackendTable()], + 'url_key.' . $linkField . ' = visibility.' . $linkField . ' AND url_key.store_id = visibility.store_id' + . ' AND url_key.attribute_id = ' . $urlKeyAttribute->getId(), + ['url_key.value as url_key'] + ) + ->reset(Select::COLUMNS) + ->columns(['url_key.store_id', 'url_key.value AS url_key', 'visibility.value AS visibility']) + ->where('visibility.' . $linkField . ' = ?', $product->getData($linkField)) + ->where('visibility.attribute_id = ?', $visibilityAttribute->getId()); + $urlKeySelect = $connection->select() + ->from(['url_key' => $urlKeyAttribute->getBackendTable()]) + ->joinLeft( + ['visibility' => $visibilityAttribute->getBackendTable()], + 'url_key.' . $linkField . ' = visibility.' . $linkField . ' AND url_key.store_id = visibility.store_id' + . ' AND visibility.attribute_id = ' . $visibilityAttribute->getId(), + ['visibility.value as visibility'] + ) + ->reset(Select::COLUMNS) + ->columns(['url_key.store_id', 'url_key.value AS url_key', 'visibility.value as visibility']) + ->where('url_key.' . $linkField . ' = ?', $product->getData($linkField)) + ->where('url_key.attribute_id = ?', $urlKeyAttribute->getId()); + + $select = $connection->select()->union([$visibilitySelect, $urlKeySelect], Select::SQL_UNION); + + return $connection->fetchAll($select); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 6eda8dd0b61ee..512340354172e 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -3,73 +3,156 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\CatalogUrlRewrite\Observer; use Magento\Catalog\Model\Product; -use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; +use Magento\Catalog\Model\Product\Visibility; +use Magento\CatalogUrlRewrite\Model\Products\AppendUrlRewritesToProducts; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; -use Magento\Framework\App\ObjectManager; -use Magento\UrlRewrite\Model\UrlPersistInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreResolver\GetStoresListByWebsiteIds; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\UrlRewrite\Model\UrlPersistInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; /** * Class ProductProcessUrlRewriteSavingObserver + * + * Generates urls for product url rewrites */ class ProductProcessUrlRewriteSavingObserver implements ObserverInterface { /** - * @var ProductUrlRewriteGenerator + * @var UrlPersistInterface + */ + private $urlPersist; + + /** + * @var AppendUrlRewritesToProducts */ - private $productUrlRewriteGenerator; + private $appendRewrites; /** - * @var UrlPersistInterface + * @var ScopeConfigInterface */ - private $urlPersist; + private $scopeConfig; /** - * @var ProductUrlPathGenerator + * @var GetStoresListByWebsiteIds */ - private $productUrlPathGenerator; + private $getStoresList; /** - * @param ProductUrlRewriteGenerator $productUrlRewriteGenerator * @param UrlPersistInterface $urlPersist - * @param ProductUrlPathGenerator|null $productUrlPathGenerator + * @param AppendUrlRewritesToProducts|null $appendRewrites + * @param ScopeConfigInterface $scopeConfig + * @param GetStoresListByWebsiteIds $getStoresList */ public function __construct( - ProductUrlRewriteGenerator $productUrlRewriteGenerator, UrlPersistInterface $urlPersist, - ProductUrlPathGenerator $productUrlPathGenerator = null + AppendUrlRewritesToProducts $appendRewrites, + ScopeConfigInterface $scopeConfig, + GetStoresListByWebsiteIds $getStoresList ) { - $this->productUrlRewriteGenerator = $productUrlRewriteGenerator; $this->urlPersist = $urlPersist; - $this->productUrlPathGenerator = $productUrlPathGenerator ?: ObjectManager::getInstance() - ->get(ProductUrlPathGenerator::class); + $this->appendRewrites = $appendRewrites; + $this->scopeConfig = $scopeConfig; + $this->getStoresList = $getStoresList; } /** * Generate urls for UrlRewrite and save it in storage * - * @param \Magento\Framework\Event\Observer $observer + * @param Observer $observer * @return void - * @throws \Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException + * @throws UrlAlreadyExistsException */ - public function execute(\Magento\Framework\Event\Observer $observer) + public function execute(Observer $observer) { /** @var Product $product */ $product = $observer->getEvent()->getProduct(); - if ($product->dataHasChangedFor('url_key') - || $product->getIsChangedCategories() - || $product->getIsChangedWebsites() - || $product->dataHasChangedFor('visibility') - ) { - if ($product->isVisibleInSiteVisibility()) { - $product->unsUrlPath(); - $product->setUrlPath($this->productUrlPathGenerator->getUrlPath($product)); - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); - } + if ($this->isNeedUpdateRewrites($product)) { + $this->deleteObsoleteRewrites($product); + $oldWebsiteIds = $product->getOrigData('website_ids') ?? []; + $storesToAdd = $this->getStoresList->execute( + array_diff($product->getWebsiteIds(), $oldWebsiteIds) + ); + $this->appendRewrites->execute([$product], $storesToAdd); } } + + /** + * Remove obsolete Url rewrites + * + * @param Product $product + */ + private function deleteObsoleteRewrites(Product $product): void + { + //do not perform redundant delete request for new product + if ($product->getOrigData('entity_id') === null) { + return; + } + $oldWebsiteIds = $product->getOrigData('website_ids') ?? []; + $storesToRemove = $this->getStoresList->execute( + array_diff($oldWebsiteIds, $product->getWebsiteIds()) + ); + if ((int)$product->getVisibility() === Visibility::VISIBILITY_NOT_VISIBLE) { + $isGlobalScope = $product->getStoreId() == Store::DEFAULT_STORE_ID; + $storesToRemove[] = $isGlobalScope ? $product->getStoreIds() : $product->getStoreId(); + } + if ($storesToRemove) { + $this->urlPersist->deleteByData( + [ + UrlRewrite::ENTITY_ID => $product->getId(), + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::STORE_ID => $storesToRemove, + ] + ); + } + } + + /** + * Is website assignment updated + * + * @param Product $product + * @return bool + */ + private function isWebsiteChanged(Product $product) + { + $oldWebsiteIds = $product->getOrigData('website_ids'); + $newWebsiteIds = $product->getWebsiteIds(); + + return array_diff($oldWebsiteIds, $newWebsiteIds) || array_diff($newWebsiteIds, $oldWebsiteIds); + } + + + /** + * Is product rewrites need to be updated + * + * @param Product $product + * @return bool + */ + private function isNeedUpdateRewrites(Product $product): bool + { + return ($product->dataHasChangedFor('url_key') + && (int)$product->getVisibility() !== Visibility::VISIBILITY_NOT_VISIBLE) + || ($product->getIsChangedCategories() && $this->isGenerateCategoryProductRewritesEnabled()) + || $this->isWebsiteChanged($product) + || $product->dataHasChangedFor('visibility'); + } + + /** + * Return product use category path in rewrite config value + * + * @return bool + */ + private function isGenerateCategoryProductRewritesEnabled(): bool + { + return $this->scopeConfig->isSetFlag('catalog/seo/generate_category_product_rewrites'); + } } diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductToWebsiteChangeObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductToWebsiteChangeObserver.php deleted file mode 100644 index 44b47faf3d4b8..0000000000000 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductToWebsiteChangeObserver.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\CatalogUrlRewrite\Observer; - -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product\Visibility; -use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; -use Magento\Framework\App\RequestInterface; -use Magento\Framework\Event\ObserverInterface; -use Magento\Store\Model\Store; -use Magento\UrlRewrite\Model\UrlPersistInterface; -use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; -use Magento\Store\Api\StoreWebsiteRelationInterface; -use Magento\Framework\App\ObjectManager; - -/** - * Observer to assign the products to website - */ -class ProductToWebsiteChangeObserver implements ObserverInterface -{ - /** - * @var ProductUrlRewriteGenerator - */ - protected $productUrlRewriteGenerator; - - /** - * @var UrlPersistInterface - */ - protected $urlPersist; - - /** - * @var ProductRepositoryInterface - */ - protected $productRepository; - - /** - * @var RequestInterface - */ - protected $request; - - /** - * @var StoreWebsiteRelationInterface - */ - private $storeWebsiteRelation; - - /** - * @param ProductUrlRewriteGenerator $productUrlRewriteGenerator - * @param UrlPersistInterface $urlPersist - * @param ProductRepositoryInterface $productRepository - * @param RequestInterface $request - * @param StoreWebsiteRelationInterface $storeWebsiteRelation - */ - public function __construct( - ProductUrlRewriteGenerator $productUrlRewriteGenerator, - UrlPersistInterface $urlPersist, - ProductRepositoryInterface $productRepository, - RequestInterface $request, - StoreWebsiteRelationInterface $storeWebsiteRelation = null - ) { - $this->productUrlRewriteGenerator = $productUrlRewriteGenerator; - $this->urlPersist = $urlPersist; - $this->productRepository = $productRepository; - $this->request = $request; - $this->storeWebsiteRelation = $storeWebsiteRelation ?: - ObjectManager::getInstance()->get(StoreWebsiteRelationInterface::class); - } - - /** - * Generate urls for UrlRewrite and save it in storage - * - * @param \Magento\Framework\Event\Observer $observer - * @return void - */ - public function execute(\Magento\Framework\Event\Observer $observer) - { - foreach ($observer->getEvent()->getProducts() as $productId) { - $product = $this->productRepository->getById( - $productId, - false, - $this->request->getParam('store_id', Store::DEFAULT_STORE_ID) - ); - - if (!empty($this->productUrlRewriteGenerator->generate($product))) { - if ($this->request->getParam('remove_website_ids')) { - foreach ($this->request->getParam('remove_website_ids') as $webId) { - foreach ($this->storeWebsiteRelation->getStoreByWebsiteId($webId) as $storeId) { - $this->urlPersist->deleteByData([ - UrlRewrite::ENTITY_ID => $product->getId(), - UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, - UrlRewrite::STORE_ID => $storeId - ]); - } - } - } - if ($product->getVisibility() != Visibility::VISIBILITY_NOT_VISIBLE) { - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); - } - } - } - } -} diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php new file mode 100644 index 0000000000000..f9c605ab489a5 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product; + +use Magento\Catalog\Model\Product\Action as ProductAction; +use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\CatalogUrlRewrite\Model\Products\AppendUrlRewritesToProducts; +use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\Store\Api\StoreWebsiteRelationInterface; +use Magento\Store\Model\StoreResolver\GetStoresListByWebsiteIds; +use Magento\UrlRewrite\Model\UrlPersistInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; + +/** + * Update URL rewrites after website change + */ +class UpdateProductWebsiteUrlRewrites +{ + /** + * @var UrlPersistInterface + */ + private $urlPersist; + + /** + * @var Collection + */ + private $productCollection; + + /** + * @var AppendUrlRewritesToProducts + */ + private $appendRewrites; + + /** + * @var GetStoresListByWebsiteIds + */ + private $getStoresList; + + /** + * @param UrlPersistInterface $urlPersist + * @param Collection $productCollection + * @param AppendUrlRewritesToProducts $appendRewrites + * @param GetStoresListByWebsiteIds $getStoresList + */ + public function __construct( + UrlPersistInterface $urlPersist, + Collection $productCollection, + AppendUrlRewritesToProducts $appendRewrites, + GetStoresListByWebsiteIds $getStoresList + ) { + $this->urlPersist = $urlPersist; + $this->productCollection = $productCollection; + $this->appendRewrites = $appendRewrites; + $this->getStoresList = $getStoresList; + } + + /** + * Update url rewrites after website changes + * + * @param ProductAction $subject + * @param void $result + * @param array $productIds + * @param array $websiteIds + * @param string $type + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterUpdateWebsites( + ProductAction $subject, + $result, + array $productIds, + array $websiteIds, + string $type + ): void { + if (empty($websiteIds)) { + return; + } + $storeIds = $this->getStoresList->execute($websiteIds); + // Remove the URLs from websites this product no longer belongs to + if ($type == 'remove') { + $this->urlPersist->deleteByData( + [ + UrlRewrite::ENTITY_ID => $productIds, + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::STORE_ID => $storeIds, + ] + ); + } else { + $collection = $this->productCollection->addFieldToFilter('entity_id', ['in' => implode(',', $productIds)]); + $this->appendRewrites->execute($collection->getItems(), $storeIds); + } + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 30f7608504c23..64f7acb1feda2 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -1,4 +1,5 @@ <?php + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. @@ -8,11 +9,13 @@ namespace Magento\CatalogUrlRewrite\Test\Unit\Observer; use Magento\Catalog\Model\Product; -use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\CatalogUrlRewrite\Model\Products\AppendUrlRewritesToProducts; use Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Event; use Magento\Framework\Event\Observer; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Api\StoreWebsiteRelationInterface; use Magento\UrlRewrite\Model\UrlPersistInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -44,12 +47,7 @@ class ProductProcessUrlRewriteSavingObserverTest extends TestCase protected $product; /** - * @var ProductUrlRewriteGenerator|MockObject - */ - protected $productUrlRewriteGenerator; - - /** - * @var ObjectManager + * @var ObjectManagerInterface */ protected $objectManager; @@ -59,14 +57,39 @@ class ProductProcessUrlRewriteSavingObserverTest extends TestCase protected $model; /** - * Set up + * @var StoreWebsiteRelationInterface|MockObject + */ + private $storeRelation; + + /** + * @var AppendUrlRewritesToProducts|MockObject + */ + private $appendRewrites; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfig; + + /** + * @inheritdoc */ protected function setUp(): void { $this->urlPersist = $this->getMockForAbstractClass(UrlPersistInterface::class); $this->product = $this->getMockBuilder(Product::class) ->addMethods(['getIsChangedWebsites', 'getIsChangedCategories']) - ->onlyMethods(['getId', 'dataHasChangedFor', 'isVisibleInSiteVisibility', 'getStoreId']) + ->onlyMethods( + [ + 'getId', + 'dataHasChangedFor', + 'getVisibility', + 'getStoreId', + 'getWebsiteIds', + 'getOrigData', + 'getCategoryCollection', + ] + ) ->disableOriginalConstructor() ->getMock(); $this->product->expects($this->any())->method('getId')->willReturn(3); @@ -77,20 +100,26 @@ protected function setUp(): void $this->event->expects($this->any())->method('getProduct')->willReturn($this->product); $this->observer = $this->createPartialMock(Observer::class, ['getEvent']); $this->observer->expects($this->any())->method('getEvent')->willReturn($this->event); - $this->productUrlRewriteGenerator = $this->createPartialMock( - ProductUrlRewriteGenerator::class, - ['generate'] - ); - $this->productUrlRewriteGenerator->expects($this->any()) - ->method('generate') - ->willReturn([3 => 'rewrite']); - $this->objectManager = new ObjectManager($this); - $this->model = $this->objectManager->getObject( - ProductProcessUrlRewriteSavingObserver::class, - [ - 'productUrlRewriteGenerator' => $this->productUrlRewriteGenerator, - 'urlPersist' => $this->urlPersist - ] + $this->storeRelation = $this->getMockBuilder(StoreWebsiteRelationInterface::class) + ->onlyMethods(['getStoreByWebsiteId']) + ->disableOriginalConstructor() + ->getMock(); + + $this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class) + ->onlyMethods(['isSetFlag']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->appendRewrites = $this->getMockBuilder(AppendUrlRewritesToProducts::class) + ->onlyMethods(['execute']) + ->disableOriginalConstructor() + ->getMock(); + + $this->model = new ProductProcessUrlRewriteSavingObserver( + $this->urlPersist, + $this->storeRelation, + $this->appendRewrites, + $this->scopeConfig ); } @@ -103,53 +132,59 @@ public function urlKeyDataProvider() { return [ 'url changed' => [ - 'isChangedUrlKey' => true, - 'isChangedVisibility' => false, - 'isChangedWebsites' => false, - 'isChangedCategories' => false, - 'visibilityResult' => true, - 'expectedReplaceCount' => 1, + 'isChangedUrlKey' => true, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => 4, + 'expectedReplaceCount' => 1, + 'websitesWithProduct' => [1], ], 'no chnages' => [ - 'isChangedUrlKey' => false, - 'isChangedVisibility' => false, - 'isChangedWebsites' => false, - 'isChangedCategories' => false, - 'visibilityResult' => true, - 'expectedReplaceCount' => 0 + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => 4, + 'expectedReplaceCount' => 0, + 'websitesWithProduct' => [1], ], 'visibility changed' => [ - 'isChangedUrlKey' => false, - 'isChangedVisibility' => true, - 'isChangedWebsites' => false, - 'isChangedCategories' => false, - 'visibilityResult' => true, - 'expectedReplaceCount' => 1 + 'isChangedUrlKey' => false, + 'isChangedVisibility' => true, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => 4, + 'expectedReplaceCount' => 1, + 'websitesWithProduct' => [1], ], 'websites changed' => [ - 'isChangedUrlKey' => false, - 'isChangedVisibility' => false, - 'isChangedWebsites' => true, - 'isChangedCategories' => false, - 'visibilityResult' => true, - 'expectedReplaceCount' => 1 + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => true, + 'isChangedCategories' => false, + 'visibilityResult' => 4, + 'expectedReplaceCount' => 1, + 'websitesWithProduct' => [1], ], 'categories changed' => [ - 'isChangedUrlKey' => false, - 'isChangedVisibility' => false, - 'isChangedWebsites' => false, - 'isChangedCategories' => true, - 'visibilityResult' => true, - 'expectedReplaceCount' => 1 + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => true, + 'visibilityResult' => 4, + 'expectedReplaceCount' => 1, + 'websitesWithProduct' => [1], ], 'url changed invisible' => [ - 'isChangedUrlKey' => true, - 'isChangedVisibility' => false, - 'isChangedWebsites' => false, - 'isChangedCategories' => false, - 'visibilityResult' => false, - 'expectedReplaceCount' => 0 + 'isChangedUrlKey' => true, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => 1, + 'expectedReplaceCount' => 0, + 'websitesWithProduct' => [1], ], ]; } @@ -161,6 +196,7 @@ public function urlKeyDataProvider() * @param bool $isChangedCategories * @param bool $visibilityResult * @param int $expectedReplaceCount + * @param array $websitesWithProduct * * @dataProvider urlKeyDataProvider */ @@ -170,16 +206,19 @@ public function testExecuteUrlKey( $isChangedWebsites, $isChangedCategories, $visibilityResult, - $expectedReplaceCount + $expectedReplaceCount, + $websitesWithProduct ) { $this->product->expects($this->any())->method('getStoreId')->willReturn(12); $this->product->expects($this->any()) ->method('dataHasChangedFor') - ->willReturnMap([ - ['visibility', $isChangedVisibility], - ['url_key', $isChangedUrlKey] - ]); + ->willReturnMap( + [ + ['visibility', $isChangedVisibility], + ['url_key', $isChangedUrlKey], + ] + ); $this->product->expects($this->any()) ->method('getIsChangedWebsites') @@ -189,13 +228,27 @@ public function testExecuteUrlKey( ->method('getIsChangedCategories') ->willReturn($isChangedCategories); + $this->storeRelation->expects($this->any()) + ->method('getStoreByWebsiteId') + ->willReturn([3]); + + $this->product->expects($this->any())->method('getWebsiteIds')->will( + $this->returnValue($websitesWithProduct) + ); + $this->product->expects($this->any()) - ->method('isVisibleInSiteVisibility') + ->method('getVisibility') ->willReturn($visibilityResult); - $this->urlPersist->expects($this->exactly($expectedReplaceCount)) - ->method('replace') - ->with([3 => 'rewrite']); + $this->product->expects($this->any()) + ->method('getOrigData') + ->willReturn($isChangedWebsites ? [] : $websitesWithProduct); + $this->scopeConfig->expects($this->any()) + ->method('isSetFlag') + ->willReturn(true); + + $this->appendRewrites->expects($this->exactly($expectedReplaceCount)) + ->method('execute'); $this->model->execute($this->observer); } diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml deleted file mode 100644 index 9c4a8aaf41231..0000000000000 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?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:Event/etc/events.xsd"> - <event name="catalog_product_to_website_change"> - <observer name="catalog_product_to_website_change" instance="Magento\CatalogUrlRewrite\Observer\ProductToWebsiteChangeObserver"/> - </event> -</config> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index 5fb7d33546d60..d22816243f64c 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -27,6 +27,9 @@ <type name="Magento\CatalogUrlRewrite\Model\Storage\DbStorage"> <plugin name="dynamic_storage_plugin" type="Magento\CatalogUrlRewrite\Plugin\DynamicCategoryRewrites"/> </type> + <type name="Magento\Catalog\Model\Product\Action"> + <plugin name="update_url_rewrites_after_websites_update_plugin" type="Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product\UpdateProductWebsiteUrlRewrites"/> + </type> <type name="Magento\CatalogUrlRewrite\Model\Map\UrlRewriteFinder"> <arguments> <argument name="urlRewriteClassNames" xsi:type="array"> diff --git a/app/code/Magento/Store/Model/StoreResolver/GetStoresListByWebsiteIds.php b/app/code/Magento/Store/Model/StoreResolver/GetStoresListByWebsiteIds.php new file mode 100644 index 0000000000000..416537caaf0e0 --- /dev/null +++ b/app/code/Magento/Store/Model/StoreResolver/GetStoresListByWebsiteIds.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\StoreResolver; + +use Magento\Store\Api\StoreWebsiteRelationInterface; + +/** + * Retrieves store ids list array by website ids array + */ +class GetStoresListByWebsiteIds +{ + /** + * @var StoreWebsiteRelationInterface + */ + private $storeWebsiteRelation; + + /** + * @param StoreWebsiteRelationInterface $storeWebsiteRelation + */ + public function __construct(StoreWebsiteRelationInterface $storeWebsiteRelation) + { + $this->storeWebsiteRelation = $storeWebsiteRelation; + } + + /** + * Retrieve list of stores by website ids + * + * @param array $websiteIds + * @return array + */ + public function execute(array $websiteIds): array + { + $storeIdsArray = []; + foreach ($websiteIds as $websiteId) { + $storeIdsArray[] = $this->storeWebsiteRelation->getStoreByWebsiteId($websiteId); + } + + return array_merge([], ...$storeIdsArray); + } +} diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup.xml new file mode 100644 index 0000000000000..2e80fa0f798a6 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup.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="AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup" extends="AdminSearchByRequestPathActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path and StoreView name. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="storeView" type="string"/> + </arguments> + <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('store_id')}}" userInput="{{storeView}}" stepKey="fillStoreView" after="fillRedirectPathFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index c14d0b175d2c0..ccd4297312f44 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -109,10 +109,11 @@ </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Open Url Rewrite page and verify new Redirect Path, RedirectType and Target Path for the grabbed product Id --> - <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchPath1"> + <actionGroup ref="AdminFilterUrlRewriteGridByRequestPathAndStoreViewActionGroup" stepKey="searchPath1"> <argument name="redirectPath" value="$$createProduct.name$$.html"/> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> + <argument name="storeView" value="{{storeViewData.name}}"/> </actionGroup> <actionGroup ref="AssertAdminStoreValueIsSetForUrlRewriteActionGroup" stepKey="seeStoreValueForProductId"> diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php index 1b18949b0ac5b..d77737edadafa 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php @@ -25,6 +25,7 @@ use Magento\Framework\Webapi\Exception as HTTPExceptionCodes; use Magento\Integration\Api\AdminTokenServiceInterface; use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Api\StoreWebsiteRelationInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreRepository; use Magento\Store\Model\Website; @@ -254,6 +255,59 @@ public function testUpdateWithDeleteWebsites() ); } + /** + * Test removing association between product and website 1 then check url rewrite removed + * Assign website back and check rewrite generated + * + * @magentoApiDataFixture Magento/Catalog/_files/product_two_websites.php + */ + public function testUpdateRewriteWithChangeWebsites() + { + /** @var Website $website */ + $website = $this->loadWebsiteByCode('test'); + + $productBuilder[ProductInterface::SKU] = 'simple-on-two-websites'; + $productBuilder[ProductInterface::EXTENSION_ATTRIBUTES_KEY] = [ + 'website_ids' => [ + $website->getId(), + ], + ]; + $objectManager = Bootstrap::getObjectManager(); + /** @var StoreWebsiteRelationInterface $storeWebsiteRelation */ + $storeWebsiteRelation = $objectManager->get(StoreWebsiteRelationInterface::class); + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $objectManager->get(ProductRepositoryInterface::class); + + $baseWebsite = $this->loadWebsiteByCode('base'); + $storeIds = $storeWebsiteRelation->getStoreByWebsiteId($baseWebsite->getId()); + $product = $productRepository->get($productBuilder[ProductInterface::SKU], false, reset($storeIds)); + $this->assertStringContainsString( + $product->getUrlKey() . '.html', + $product->getProductUrl() + ); + + $this->updateProduct($productBuilder); + + $product->setRequestPath(''); + $this->assertStringNotContainsString( + $product->getUrlKey() . '.html', + $product->getProductUrl() + ); + $productBuilder[ProductInterface::EXTENSION_ATTRIBUTES_KEY] = [ + 'website_ids' => [ + $website->getId(), + $baseWebsite->getId(), + ], + ]; + + $this->updateProduct($productBuilder); + $product->setRequestPath(''); + $this->assertStringContainsString( + $product->getUrlKey() . '.html', + $product->getProductUrl() + ); + } + /** * Test removing all website associations * @@ -264,7 +318,7 @@ public function testDeleteAllWebsiteAssociations() $productBuilder[ProductInterface::SKU] = 'unique-simple-azaza'; $websitesData = [ - 'website_ids' => [] + 'website_ids' => [], ]; $productBuilder[ProductInterface::EXTENSION_ATTRIBUTES_KEY] = $websitesData; $response = $this->updateProduct($productBuilder); diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php index 0432649455abe..e3e3d3e3972e5 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php @@ -85,6 +85,7 @@ public function productDataProvider(): array 'sku' => 'test-product', 'name' => 'test product', 'price' => 150, + 'website_ids' => [1] ], 'expected_data' => [ [ @@ -104,6 +105,7 @@ public function productDataProvider(): array 'name' => 'test product', 'price' => 150, 'url_key' => 'test-product-url-key', + 'website_ids' => [1] ], 'expected_data' => [ [ @@ -123,6 +125,7 @@ public function productDataProvider(): array 'name' => 'test product', 'price' => 150, 'url_key' => 'test-product-url-key', + 'website_ids' => [1] ], 'expected_data' => [], ], @@ -201,6 +204,7 @@ public function existingUrlKeyProvider(): array 'name' => 'test-simple-product', 'price' => 150, 'url_key' => 'simple-product', + 'store_ids' => [1] ], 'with_autogenerated_existing_product_url_key' => [ 'type_id' => Type::TYPE_SIMPLE, @@ -208,6 +212,7 @@ public function existingUrlKeyProvider(): array 'sku' => 'test-simple-product', 'name' => 'simple product', 'price' => 150, + 'store_ids' => [1] ], 'with_specified_existing_category_url_key' => [ 'type_id' => Type::TYPE_SIMPLE, @@ -216,6 +221,7 @@ public function existingUrlKeyProvider(): array 'name' => 'test-simple-product', 'price' => 150, 'url_key' => 'category-1', + 'store_ids' => [1] ], 'with_autogenerated_existing_category_url_key' => [ 'type_id' => Type::TYPE_SIMPLE, @@ -223,6 +229,7 @@ public function existingUrlKeyProvider(): array 'sku' => 'test-simple-product', 'name' => 'category 1', 'price' => 150, + 'store_ids' => [1] ], ], ]; diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php index c3efd660792c0..82631220730de 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -5,25 +5,46 @@ */ namespace Magento\CatalogUrlRewrite\Observer; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\UrlRewrite\Model\UrlFinderInterface; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; -use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator; +use PHPUnit\Framework\TestCase; /** * @magentoAppArea adminhtml * @magentoDbIsolation disabled */ -class ProductProcessUrlRewriteSavingObserverTest extends \PHPUnit\Framework\TestCase +class ProductProcessUrlRewriteSavingObserverTest extends TestCase { - /** @var \Magento\Framework\ObjectManagerInterface */ - protected $objectManager; + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; /** * Set up */ protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); } /** @@ -32,8 +53,8 @@ protected function setUp(): void */ private function getActualResults(array $filter) { - /** @var \Magento\UrlRewrite\Model\UrlFinderInterface $urlFinder */ - $urlFinder = $this->objectManager->get(\Magento\UrlRewrite\Model\UrlFinderInterface::class); + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); $actualResults = []; foreach ($urlFinder->findAllByData($filter) as $url) { $actualResults[] = [ @@ -53,16 +74,14 @@ private function getActualResults(array $filter) */ public function testUrlKeyHasChangedInGlobalContext() { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository*/ - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - /** @var \Magento\Catalog\Model\Product $product*/ - $product = $productRepository->get('product1'); + $testStore1 = $this->storeManager->getStore('default'); + $testStore4 = $this->storeManager->getStore('test'); - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeManager->setCurrentStore(0); + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); - $testStore = $storeManager->getStore('test'); $productFilter = [ UrlRewrite::ENTITY_TYPE => 'product', ]; @@ -73,14 +92,14 @@ public function testUrlKeyHasChangedInGlobalContext() 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => $testStore->getId(), + 'store_id' => $testStore4->getId(), ], ]; $actual = $this->getActualResults($productFilter); @@ -91,7 +110,7 @@ public function testUrlKeyHasChangedInGlobalContext() $product->setData('save_rewrites_history', true); $product->setUrlKey('new-url'); $product->setUrlPath('new-path'); - $product->save(); + $this->productRepository->save($product); $expected = [ [ @@ -99,28 +118,28 @@ public function testUrlKeyHasChangedInGlobalContext() 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), ], [ 'request_path' => "new-url.html", 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => $testStore->getId(), + 'store_id' => $testStore4->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "new-url.html", 'is_auto_generated' => 0, 'redirect_type' => 301, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "new-url.html", 'is_auto_generated' => 0, 'redirect_type' => 301, - 'store_id' => $testStore->getId(), + 'store_id' => $testStore4->getId(), ], ]; @@ -136,16 +155,13 @@ public function testUrlKeyHasChangedInGlobalContext() */ public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection() { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository*/ - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - /** @var \Magento\Catalog\Model\Product $product*/ - $product = $productRepository->get('product1'); + $testStore1 = $this->storeManager->getStore('default'); + $testStore4 = $this->storeManager->getStore('test'); - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeManager->setCurrentStore(1); + $this->storeManager->setCurrentStore($testStore1); - $testStore = $storeManager->getStore('test'); + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); $productFilter = [ UrlRewrite::ENTITY_TYPE => 'product', @@ -154,7 +170,7 @@ public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection() $product->setData('save_rewrites_history', true); $product->setUrlKey('new-url'); $product->setUrlPath('new-path'); - $product->save(); + $this->productRepository->save($product); $expected = [ [ @@ -162,21 +178,21 @@ public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection() 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => $testStore->getId(), + 'store_id' => $testStore4->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "new-url.html", 'is_auto_generated' => 0, 'redirect_type' => 301, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), ], ]; @@ -192,16 +208,13 @@ public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection() */ public function testUrlKeyHasChangedInStoreviewContextWithoutPermanentRedirection() { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository*/ - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - /** @var \Magento\Catalog\Model\Product $product*/ - $product = $productRepository->get('product1'); + $testStore1 = $this->storeManager->getStore('default'); + $testStore4 = $this->storeManager->getStore('test'); - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeManager->setCurrentStore(1); + $this->storeManager->setCurrentStore(1); - $testStore = $storeManager->getStore('test'); + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); $productFilter = [ UrlRewrite::ENTITY_TYPE => 'product', @@ -210,7 +223,7 @@ public function testUrlKeyHasChangedInStoreviewContextWithoutPermanentRedirectio $product->setData('save_rewrites_history', false); $product->setUrlKey('new-url'); $product->setUrlPath('new-path'); - $product->save(); + $this->productRepository->save($product); $expected = [ [ @@ -218,17 +231,402 @@ public function testUrlKeyHasChangedInStoreviewContextWithoutPermanentRedirectio 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => 1, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ], + ]; + + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + } + + /** + * @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php + * @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_rewrite_multistore.php + * @magentoAppIsolation enabled + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testAddAndRemoveProductFromWebsite() + { + $testStore1 = $this->storeManager->getStore('default'); + $testStore2 = $this->storeManager->getStore('fixture_second_store'); + $testStore3 = $this->storeManager->getStore('fixture_third_store'); + $testStore4 = $this->storeManager->getStore('test'); + + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); + + $productFilter = [ + UrlRewrite::ENTITY_TYPE => 'product', + ]; + + //Product in 1st website. Should result in being in 1st and 4th stores. + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ], + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + + //Add product to websites corresponding to all 4 stores. + //Rewrites should be present for all stores. + $product->setWebsiteIds( + array_unique( + [ + $testStore1->getWebsiteId(), + $testStore2->getWebsiteId(), + $testStore3->getWebsiteId(), + $testStore4->getWebsiteId(), + ] + ) + ); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore2->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore3->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ] + ]; + + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + + //Remove product from stores 1 and 4 and leave assigned to stores 2 and 3. + $product->setWebsiteIds( + array_unique( + [ + $testStore2->getWebsiteId(), + $testStore3->getWebsiteId(), + ] + ) + ); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore2->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore3->getId(), + ], + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + } + + /** + * @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php + * @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_rewrite_multistore.php + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testChangeVisibilityGlobalScope() + { + $testStore1 = $this->storeManager->getStore('default'); + $testStore2 = $this->storeManager->getStore('fixture_second_store'); + $testStore3 = $this->storeManager->getStore('fixture_third_store'); + $testStore4 = $this->storeManager->getStore('test'); + + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); + + $productFilter = [ + UrlRewrite::ENTITY_TYPE => 'product', + ]; + + //Product in 1st website. Should result in being in 1st and 4th stores. + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ] + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + + //Set product to be not visible at global scope + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + $product->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE); + $this->productRepository->save($product); + $this->assertEmpty($this->getActualResults($productFilter)); + + //Add product to websites corresponding to all 4 stores. + //Rewrites should not be present as the product is hidden + //at the global scope. + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + $product->setWebsiteIds( + array_unique( + [ + $testStore1->getWebsiteId(), + $testStore2->getWebsiteId(), + $testStore3->getWebsiteId(), + $testStore4->getWebsiteId(), + ] + ) + ); + $this->productRepository->save($product); + $expected = []; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + + //Set product to be visible at global scope + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + $product->setVisibility(Visibility::VISIBILITY_BOTH); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore2->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore3->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ], + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + } + + /** + * @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php + * @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_rewrite_multistore.php + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testChangeVisibilityLocalScope() + { + $testStore1 = $this->storeManager->getStore('default'); + $testStore2 = $this->storeManager->getStore('fixture_second_store'); + $testStore3 = $this->storeManager->getStore('fixture_third_store'); + $testStore4 = $this->storeManager->getStore('test'); + + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + + /** @var Product $product*/ + $product = $this->productRepository->get('product1'); + + $productFilter = [ + UrlRewrite::ENTITY_TYPE => 'product', + ]; + + //Product in 1st website. Should result in being in 1st and 4th stores. + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ], + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + + //Set product to be not visible at store 4 scope + //Rewrite should only be present for store 1 + $this->storeManager->setCurrentStore($testStore4); + $product = $this->productRepository->get('product1'); + $product->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + self::assertCount(count($expected), $actual); + + //Add product to websites corresponding to all 4 stores. + //Rewrites should be present for stores 1,2 and 3. + //No rewrites should be present for store 4 as that is not visible + //at local scope. + $this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID); + $product = $this->productRepository->get('product1'); + $product->getExtensionAttributes()->setWebsiteIds( + array_unique( + [ + $testStore1->getWebsiteId(), + $testStore2->getWebsiteId(), + $testStore3->getWebsiteId(), + $testStore4->getWebsiteId() + ], + ) + ); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore2->getId(), ], [ 'request_path' => "product-1.html", 'target_path' => "catalog/product/view/id/" . $product->getId(), 'is_auto_generated' => 1, 'redirect_type' => 0, - 'store_id' => $testStore->getId(), + 'store_id' => $testStore3->getId(), ], ]; + $actual = $this->getActualResults($productFilter); + foreach ($expected as $row) { + $this->assertContains($row, $actual); + } + //Set product to be visible at store 4 scope only + $this->storeManager->setCurrentStore($testStore4); + $product = $this->productRepository->get('product1'); + $product->setVisibility(Visibility::VISIBILITY_BOTH); + $this->productRepository->save($product); + $expected = [ + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore1->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore2->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore3->getId(), + ], + [ + 'request_path' => "product-1.html", + 'target_path' => "catalog/product/view/id/" . $product->getId(), + 'is_auto_generated' => 1, + 'redirect_type' => 0, + 'store_id' => $testStore4->getId(), + ], + ]; $actual = $this->getActualResults($productFilter); foreach ($expected as $row) { $this->assertContainsEquals($row, $actual); diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php new file mode 100644 index 0000000000000..f958027f413e3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Action; +use Magento\Store\Api\StoreWebsiteRelationInterface; +use Magento\Store\Model\Website; +use Magento\Store\Model\WebsiteRepository; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * @magentoAppArea crontab + * @magentoDbIsolation disabled + */ +class UpdateProductWebsiteUrlRewritesTest extends TestCase +{ + /** + * @var Action + */ + private $action; + + /** + * @var StoreWebsiteRelationInterface + */ + private $storeWebsiteRelation; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->action = $objectManager->get(Action::class); + $this->storeWebsiteRelation = $objectManager->get(StoreWebsiteRelationInterface::class); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDataFixture Magento/Store/_files/second_website_with_store_group_and_store.php + */ + public function testUpdateUrlRewrites() + { + /** @var Website $website */ + $websiteRepository = Bootstrap::getObjectManager()->get(WebsiteRepository::class); + $website = $websiteRepository->get('test'); + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $product = $productRepository->get('simple1', false, null, true); + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'add'); + $storeIds = $this->storeWebsiteRelation->getStoreByWebsiteId($website->getId()); + + $this->assertStringContainsString( + $product->getUrlKey() . '.html', + $product->setStoreId(reset($storeIds))->getProductUrl() + ); + + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'remove'); + $product->setRequestPath(''); + $url = $product->setStoreId(reset($storeIds))->getProductUrl(); + $this->assertStringNotContainsString( + $product->getUrlKey() . '.html', + $url + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php index a9ce1d4b181a9..6d635d01b2f48 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php @@ -65,8 +65,8 @@ protected function setUp(): void /** * Test switching stores with non-existent cms pages and then redirecting to the homepage * - * @magentoDataFixture Magento/UrlRewrite/_files/url_rewrite.php * @magentoDataFixture Magento/Catalog/_files/category_product.php + * @magentoDataFixture Magento/UrlRewrite/_files/url_rewrite.php * @magentoDbIsolation disabled * @magentoAppIsolation enabled * @return void From 5602710848756d2918837e1a81c9f77c03a7ec2a Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 8 Dec 2020 11:24:53 -0600 Subject: [PATCH 445/490] MC-38913: Associate to Website Functionality - Fix customer associated website should not be editable in customer grid --- .../AdminCustomerGridInlineEditorSection.xml | 3 + ...minChangeCustomerAssociatedWebsiteTest.xml | 85 +++++++++++++++++++ .../ui_component/customer_listing.xml | 3 - 3 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml index d010844cfffcf..f074217224372 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml @@ -11,5 +11,8 @@ <section name="AdminCustomerGridInlineEditorSection"> <element name="customerGenderEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='gender']"/> <element name="saveInGrid" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/> + <element name="customerEmailEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) input[name='email']"/> + <element name="customerWebsiteEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) select[name='website_id']"/> + <element name="cellContent" type="select" selector="//tr[@class='data-grid-editable-row' and not(contains(@style,'display:none'))]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{col}}')]/preceding-sibling::th) +1 ]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml new file mode 100644 index 0000000000000..2f4898921d0b6 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml @@ -0,0 +1,85 @@ +<?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="AdminChangeCustomerAssociatedWebsiteTest"> + <annotations> + <features value="Customer"/> + <title value="Admin should not be able to change customer assigned website ID"/> + <description value="Admin should not be able to change customer assigned website ID"/> + <severity value="AVERAGE"/> + <useCaseId value="MC-38913"/> + <testCaseId value="MC-39764"/> + <stories value="Customer Edit"/> + <group value="customer"/> + </annotations> + + <before> + <!--Login to admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Create second website--> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> + <argument name="websiteCode" value="{{NewWebSiteData.code}}"/> + </actionGroup> + <!--Create store group and associate it to second website--> + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> + <argument name="website" value="{{NewWebSiteData.name}}"/> + <argument name="storeGroupName" value="{{NewStoreData.name}}"/> + <argument name="storeGroupCode" value="{{NewStoreData.code}}"/> + </actionGroup> + <!--Create store view and associate it to second store group--> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="NewStoreData"/> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <!--Create customer--> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + </before> + <after> + <!--Delete customer--> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!--Reset customer grid filter--> + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomersPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomersGridFilter"/> + <!--Delete custom website--> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> + </actionGroup> + <!--Logout from admin--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--Open customer grid--> + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomersPage"/> + <!--Filter customers grid by email--> + <actionGroup ref="AdminFilterCustomerGridByEmail" stepKey="filterCustomer"> + <argument name="email" value="$createCustomer.email$"/> + </actionGroup> + <!--Click on customer row to open inline editor--> + <click selector="{{AdminDataGridTableSection.rowTemplate($createCustomer.email$)}}" stepKey="clickCustomersGridRow"/> + <!--Wait for inline editor to open--> + <waitForElementVisible selector="{{AdminCustomerGridInlineEditorSection.customerEmailEditor}}" stepKey="waitForEditor"/> + <!--Assert that website is not editable--> + <dontSeeElement selector="{{AdminCustomerGridInlineEditorSection.customerWebsiteEditor}}" stepKey="dontSeeWebsiteEditor"/> + <!--Assert that "Main Website" is displayed in website cell--> + <see selector="{{AdminCustomerGridInlineEditorSection.cellContent('Web Site')}}" userInput="{{_defaultWebsite.name}}" stepKey="assertThatMainWebsiteIsDisplayedInWebsiteCell"/> + <!--Open customer edit page--> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + <!--Navigate to "Account Information" tab--> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="openAccountInformationEditPage"/> + <!--Assert that "Main Website" is selected in website selector--> + <seeOptionIsSelected selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{_defaultWebsite.name}}" stepKey="assertThatMainWebsiteIsSelected"/> + <!--Assert that website selector is disabled--> + <assertElementContainsAttribute stepKey="assertThatWebsiteSelectorIsDisabled"> + <expectedResult selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" attribute="disabled" type="string"/> + </assertElementContainsAttribute> + </test> +</tests> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index 97ae9a9953eb6..b60506ab856c4 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -190,9 +190,6 @@ <column name="website_id" class="Magento\Customer\Ui\Component\Listing\Column\Websites" component="Magento_Ui/js/grid/columns/select" sortOrder="110"> <settings> <filter>select</filter> - <editor> - <editorType>select</editorType> - </editor> <dataType>select</dataType> <label translate="true">Web Site</label> </settings> From 9ce704accb9fc4d732abcc77d0629879d31aa461 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <dhorytskyi@magento.com> Date: Tue, 8 Dec 2020 20:28:37 -0600 Subject: [PATCH 446/490] MC-39747: catalog:images:resize stops when cannot process image --- .../MediaStorage/Service/ImageResize.php | 11 +++- .../Test/Unit/Service/ImageResizeTest.php | 62 ++++++++++++++++--- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/MediaStorage/Service/ImageResize.php b/app/code/Magento/MediaStorage/Service/ImageResize.php index d5ce1a7e20f98..9b0adcd161339 100644 --- a/app/code/Magento/MediaStorage/Service/ImageResize.php +++ b/app/code/Magento/MediaStorage/Service/ImageResize.php @@ -195,14 +195,18 @@ public function resizeFromThemes(array $themes = null): Generator $this->fileStorageDatabase->saveFileToFilesystem($mediastoragefilename); } if ($this->mediaDirectory->isFile($originalImagePath)) { - foreach ($viewImages as $viewImage) { - $this->resize($viewImage, $originalImagePath, $originalImageName); + try { + foreach ($viewImages as $viewImage) { + $this->resize($viewImage, $originalImagePath, $originalImageName); + } + } catch (\Exception $e) { + $error = $e->getMessage(); } } else { $error = __('Cannot resize image "%1" - original image not found', $originalImagePath); } - yield ['filename' => $originalImageName, 'error' => $error] => $count; + yield ['filename' => $originalImageName, 'error' => (string) $error] => $count; } } @@ -276,6 +280,7 @@ private function getUniqueImageIndex(array $imageData): string * @param string $originalImagePath * @param array $imageParams * @return Image + * @throws \InvalidArgumentException */ private function makeImage(string $originalImagePath, array $imageParams): Image { diff --git a/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php b/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php index b8c4aded8a047..5df2269f8f80e 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php @@ -60,11 +60,6 @@ class ImageResizeTest extends TestCase */ protected $imageFactoryMock; - /** - * @var Image|MockObject - */ - protected $imageMock; - /** * @var ParamsBuilder|MockObject */ @@ -141,7 +136,6 @@ protected function setUp(): void $this->appStateMock = $this->createMock(State::class); $this->imageConfigMock = $this->createMock(MediaConfig::class); $this->productImageMock = $this->createMock(ProductImage::class); - $this->imageMock = $this->createMock(Image::class); $this->imageFactoryMock = $this->createMock(ImageFactory::class); $this->paramsBuilderMock = $this->createMock(ParamsBuilder::class); $this->viewMock = $this->createMock(View::class); @@ -164,9 +158,6 @@ protected function setUp(): void ->with(DirectoryList::MEDIA) ->willReturn($this->mediaDirectoryMock); - $this->imageFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->imageMock); $this->assetImageMock->expects($this->any()) ->method('getPath') ->willReturn($this->testfilepath); @@ -256,6 +247,11 @@ public function testResizeFromThemesMediaStorageDatabase() ->method('fileExists') ->willReturn(false); + $imageMock = $this->createMock(Image::class); + $this->imageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($imageMock); + $this->productImageMock->expects($this->any()) ->method('getCountUsedProductImages') ->willReturn(1); @@ -284,6 +280,49 @@ function () { $generator = $this->service->resizeFromThemes(['test-theme']); while ($generator->valid()) { + $resizeInfo = $generator->key(); + $this->assertEquals('image.jpg', $resizeInfo['filename']); + $this->assertEmpty($resizeInfo['error']); + $generator->next(); + } + } + + public function testResizeFromThemesUnsupportedImage() + { + $this->databaseMock->expects($this->any()) + ->method('checkDbUsage') + ->willReturn(true); + $this->databaseMock->expects($this->any()) + ->method('fileExists') + ->willReturn(false); + + $this->imageFactoryMock->expects($this->once()) + ->method('create') + ->willThrowException(new \InvalidArgumentException('Unsupported image format.')); + + $this->productImageMock->expects($this->any()) + ->method('getCountUsedProductImages') + ->willReturn(1); + $this->productImageMock->expects($this->any()) + ->method('getUsedProductImages') + ->willReturnCallback( + function () { + $data = [[ 'filepath' => $this->testfilename ]]; + foreach ($data as $e) { + yield $e; + } + } + ); + + $this->mediaDirectoryMock->expects($this->any()) + ->method('isFile') + ->with($this->testfilepath) + ->willReturn(true); + + $generator = $this->service->resizeFromThemes(['test-theme']); + while ($generator->valid()) { + $resizeInfo = $generator->key(); + $this->assertEquals('Unsupported image format.', $resizeInfo['error']); $generator->next(); } } @@ -297,6 +336,11 @@ public function testResizeFromImageNameMediaStorageDatabase() ->method('fileExists') ->willReturn(false); + $imageMock = $this->createMock(Image::class); + $this->imageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($imageMock); + $this->mediaDirectoryMock->expects($this->any()) ->method('isFile') ->with($this->testfilepath) From 69c26af51b38754144eedf1ad73b44e479f4f29a Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <dhorytskyi@magento.com> Date: Tue, 8 Dec 2020 21:04:52 -0600 Subject: [PATCH 447/490] MC-39776: JS error on Create New Customer Account page --- .../templates/shopping-assistance.phtml | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/LoginAsCustomerAssistance/view/frontend/templates/shopping-assistance.phtml b/app/code/Magento/LoginAsCustomerAssistance/view/frontend/templates/shopping-assistance.phtml index 7765975863485..5551ea1baba70 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/view/frontend/templates/shopping-assistance.phtml +++ b/app/code/Magento/LoginAsCustomerAssistance/view/frontend/templates/shopping-assistance.phtml @@ -11,20 +11,18 @@ use Magento\LoginAsCustomerAssistance\ViewModel\ShoppingAssistanceViewModel; /** @var Escaper $escaper */ /** @var ShoppingAssistanceViewModel $viewModel */ $viewModel = $block->getViewModel(); -?> -<script type="text/x-magento-init"> -{ - ".form-create-account, .form-edit-account": { - "Magento_LoginAsCustomerAssistance/js/opt-in": { - "allowAccess": "<?= /* @noEscape */ IsAssistanceEnabledInterface::ALLOWED ?>", - "denyAccess": "<?= /* @noEscape */ IsAssistanceEnabledInterface::DENIED ?>" +if ($viewModel->isLoginAsCustomerEnabled()): ?> + <script type="text/x-magento-init"> + { + ".form-create-account, .form-edit-account": { + "Magento_LoginAsCustomerAssistance/js/opt-in": { + "allowAccess": "<?= /* @noEscape */ IsAssistanceEnabledInterface::ALLOWED ?>", + "denyAccess": "<?= /* @noEscape */ IsAssistanceEnabledInterface::DENIED ?>" + } } } -} -</script> - -<?php if ($viewModel->isLoginAsCustomerEnabled()): ?> + </script> <div class="field choice"> <input type="checkbox" name="assistance_allowed_checkbox" From 780419693249f6fae17d4702cd203c2ab4aae61a Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Wed, 9 Dec 2020 11:35:17 +0200 Subject: [PATCH 448/490] fix mftf stepKeys order --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 594eb320e439a..143fa6657cd3b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -43,8 +43,8 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From fe6298b0ae448de156a317545463e773a2166258 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:24:53 +0200 Subject: [PATCH 449/490] refactored AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest --- ...AssertManageStockOnEditPageActionGroup.xml | 22 +++ ...AssertProductInfoOnEditPageActionGroup.xml | 32 ++++ ...ProductIsAssignedToCategoryActionGroup.xml | 22 +++ ...ssignTwoCategoriesToProductActionGroup.xml | 26 +++ .../AdminFillMainProductFormActionGroup.xml | 21 +++ ...uctStockStatusOnProductPageActionGroup.xml | 20 +++ .../AdminProductFormSection.xml | 1 + ...WithRegularPriceInStockEnabledFlatTest.xml | 166 ++++++++---------- 8 files changed, 218 insertions(+), 92 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..f9c9098732476 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminAssertManageStockOnEditPageActionGroup"> + <annotations> + <description>Check if manageStock value is correct (the Product Edit page 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/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..b70c7a4d62dcf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Validates next fields on the Edit Product Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="seeProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="seeProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="seeProductTaxClass"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="seeSimpleProductWeight"/> + <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{product.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="seeVisibility"/> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="seeUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml new file mode 100644 index 0000000000000..b33e319adc1f4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminAssertProductIsAssignedToCategoryActionGroup"> + <annotations> + <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml new file mode 100644 index 0000000000000..06b4b68630326 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminAssignTwoCategoriesToProductActionGroup" extends="AdminAssignCategoryToProductAndSaveActionGroup"> + <annotations> + <description>Extends AdminAssignCategoryToProductAndSaveActionGroup + assigns the second category and prevents product saving (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryTwoName" type="string"/> + </arguments> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown2" after="waitForApplyCategory"/> + <checkOption selector="{{AdminProductFormSection.selectCategory(categoryTwoName)}}" stepKey="selectCategoryTwo"/> + <click selector="{{AdminProductFormSection.done}}" stepKey="clickDone2"/> + <waitForPageLoad stepKey="waitForApplyCategoryTwo"/> + <remove keyForRemoval="clickSave"/> + <remove keyForRemoval="waitForSavingProduct"/> + <remove keyForRemoval="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml new file mode 100644 index 0000000000000..c5818a4eea51b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.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="AdminFillMainProductFormActionGroup" extends="FillMainProductFormActionGroup"> + <annotations> + <description>Extends FillMainProductFormActionGroup with filling the next fields: Tax Class, Visibility, SEO->URL </description> + </annotations> + + <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="selectProductTaxClass"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="selectVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..356302ef26b9c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.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="StorefrontAssertProductStockStatusOnProductPageActionGroup"> + <annotations> + <description>Validate 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/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index 1ca051e2f6669..d70c48f2b00e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -77,5 +77,6 @@ <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> + <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index aa1b1ae702914..4bf15199f0db5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.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="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest"> <annotations> @@ -37,104 +37,86 @@ <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> </after> - <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> - <!-- Update simple product with regular price --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="fillSimpleProductPrice"/> - <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="selectProductTaxClass"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="fillSimpleProductQuantity"/> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> - <conditionalClick selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" visible="true" stepKey="checkUseConfigSettingsCheckBox"/> - <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="selectManageStock"/> + <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> + <argument name="value" value="No"/> + </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="fillSimpleProductWeight"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="selectProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <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" /> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> - <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="fillUrlKey"/> - <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> + + <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> - <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> - - <!-- Search updated simple product(from above step) in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <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="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="seeProductTaxClass"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="seeSimpleProductQuantity"/> - <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink"/> - <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="seeManageStock"/> - <click selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="clickDoneButtonOnAdvancedInventory"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="seeSimpleProductWeight"/> - <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="seeVisibility"/> - <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> - <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> - - <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> - - <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> + <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <argument name="manageStock" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="category" value="$categoryEntity$"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductEnabledFlat.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductEnabledFlat.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(simpleProductEnabledFlat.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> + <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> + <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + </test> </tests> From e4fde6b8c5005c984c7f8dab1c6106c7f5649be5 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:47:29 +0200 Subject: [PATCH 450/490] added deprecation, refactored --- ...AssertManageStockOnEditPageActionGroup.xml | 3 +- ...AssertProductInfoOnEditPageActionGroup.xml | 2 +- ...uctStockStatusOnProductPageActionGroup.xml | 3 +- ...ularPriceInStockEnabledFlatCatalogTest.xml | 122 ++++++++++++ ...WithRegularPriceInStockEnabledFlatTest.xml | 173 ++++++++++-------- 5 files changed, 224 insertions(+), 79 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml index f9c9098732476..67df650a24228 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml @@ -10,7 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertManageStockOnEditPageActionGroup"> <annotations> - <description>Check if manageStock value is correct (the Product Edit page should be opened in Admin prior this check).</description> + <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"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml index b70c7a4d62dcf..bbfbcf584fa0a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> <annotations> - <description>Validates next fields on the Edit Product Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> </annotations> <arguments> <argument name="product" type="entity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml index 356302ef26b9c..5af46bcd734d1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml @@ -9,7 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontAssertProductStockStatusOnProductPageActionGroup"> <annotations> - <description>Validate that the provided Product Stock Status is present and correct (the Product Detail page should be opened on Storefront prior this check)</description> + <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"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml new file mode 100644 index 0000000000000..c083f827e8930 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml @@ -0,0 +1,122 @@ +<?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="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest"> + <annotations> + <stories value="Update Simple Product"/> + <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"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <magentoCLI stepKey="setFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 1"/> + <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> + <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> + <requiredEntity createDataKey="initialCategoryEntity"/> + </createData> + <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> + </before> + <after> + <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> + <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> + <argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> + </after> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$initialSimpleProduct$$"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> + <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> + <argument name="value" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> + + <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> + + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> + <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <argument name="manageStock" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="category" value="$categoryEntity$"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> + <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> + <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index 4bf15199f0db5..fd8be7be2ea5b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -6,17 +6,20 @@ */ --> -<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="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest"> + <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead"> <annotations> <stories value="Update Simple Product"/> - <title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <title value="DEPREACTED. 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"/> @@ -37,86 +40,104 @@ <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> </after> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <!-- Search default simple product in the grid page --> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> + <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <!-- Update simple product with regular price --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="fillSimpleProductPrice"/> + <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="selectProductTaxClass"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="fillSimpleProductQuantity"/> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> - <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> - <argument name="value" value="No"/> - </actionGroup> + <conditionalClick selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" visible="true" stepKey="checkUseConfigSettingsCheckBox"/> + <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="selectManageStock"/> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> - - <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> - <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> - <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - + <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="selectStockStatusInStock"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="fillSimpleProductWeight"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="selectProductWeight"/> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> + <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" /> + <waitForPageLoad stepKey="waitForCategory2"/> + <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="selectVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="fillUrlKey"/> + <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> - - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - - <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> - <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> - <argument name="manageStock" value="No"/> - </actionGroup> - <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> - - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> - <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> - <argument name="categoryName" value="$$categoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - - <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> - <argument name="category" value="$categoryEntity$"/> - </actionGroup> - - <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - </actionGroup> - - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> + <!-- Verify customer see success message --> + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + + <!-- Search updated simple product(from above step) in the grid page --> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductNameInNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillProductSku"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <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="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="seeSimpleProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="seeProductTaxClass"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="seeSimpleProductQuantity"/> + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink"/> + <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="seeManageStock"/> + <click selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="clickDoneButtonOnAdvancedInventory"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="seeSimpleProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="seeSimpleProductWeight"/> + <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="seeVisibility"/> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> + + <!--Verify customer see updated simple product link on category page --> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> + <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> + + <!-- Verify customer see updated simple product (from the above step) on the storefront page --> + <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> - <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> - </actionGroup> - - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> - <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> - </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> - </actionGroup> - + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductEnabledFlat.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductEnabledFlat.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(simpleProductEnabledFlat.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> </test> </tests> From 1dd1046fba15c8b72e50cd2114a554fd65b06eea Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:55:09 +0200 Subject: [PATCH 451/490] fixed a typo --- .../AdminAssertProductInfoOnEditPageActionGroup.xml | 3 ++- ...dateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml index bbfbcf584fa0a..ba67168958fca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -10,7 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> <annotations> - <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + <description>Validates next fields on the Product Edit Page: + name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> </annotations> <arguments> <argument name="product" type="entity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index fd8be7be2ea5b..c1b80b94179fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -11,7 +11,7 @@ <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead"> <annotations> <stories value="Update Simple Product"/> - <title value="DEPREACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <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"/> From ff979509acc574f3f95a3cdd19c685eba7645a49 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 9 Dec 2020 13:27:07 +0200 Subject: [PATCH 452/490] fix for document type --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 0f853561571af..513e15c2a4dc4 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1776,7 +1776,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') $nodeShipmentDetails->addChild('DoorTo', 'DD'); $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(), 0, 1)); $contentType = isset($package['params']['container']) ? $package['params']['container'] : ''; - $packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : ''; + $packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE'; $nodeShipmentDetails->addChild('PackageType', $packageType); if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) { $nodeShipmentDetails->addChild('IsDutiable', 'Y'); From c5d2d01e33958ac4d1fdffa5dd0c95aac3c474cc Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Wed, 9 Dec 2020 16:16:25 +0200 Subject: [PATCH 453/490] Removed usage or changed value of CliIndexerReindexActionGroup action group for Catalog module --- ...utOfStockProductIsVisibleInCategoryTest.xml | 5 +---- .../AdminCreateCategoryWithAnchorFieldTest.xml | 5 +---- ...tiveFlatCategoryAndUpdateAsInactiveTest.xml | 14 +++----------- .../AdminCreateInactiveFlatCategoryTest.xml | 12 +++--------- ...minCreateInactiveInMenuFlatCategoryTest.xml | 12 +++--------- ...eateProductAttributeFromProductPageTest.xml | 5 +---- ...AdminCreateSimpleProductWithUnicodeTest.xml | 4 +--- ...hCustomOptionsSuiteAndImportOptionsTest.xml | 4 +--- ...inCreateVirtualProductWithTierPriceTest.xml | 5 +---- ...ProductsImageInCaseOfMultipleStoresTest.xml | 9 ++------- ...tCustomizableOptionToProductWithSKUTest.xml | 5 +---- ...veAnchoredCategoryToDefaultCategoryTest.xml | 5 +---- ...dminMoveCategoryAndCheckUrlRewritesTest.xml | 5 +---- ...eCategoryFromParentAnchoredCategoryTest.xml | 5 +---- ...signedToCategoryWithoutCustomURLKeyTest.xml | 5 +---- .../AdminRemoveImageAffectsAllScopesTest.xml | 4 +--- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +--- ...minUpdateFlatCategoryAndAddProductsTest.xml | 18 ++++-------------- ...dateFlatCategoryIncludeInNavigationTest.xml | 3 +-- ...torefrontProductNameWithDoubleQuoteTest.xml | 5 +---- 20 files changed, 30 insertions(+), 104 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml index 9c1ff43587a27..db789d3512acf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml @@ -69,10 +69,7 @@ </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify product is visible in category front page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 3332bc66653e5..8d0534891a29b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -70,10 +70,7 @@ <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> - <!--Clear cache and reindex--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 500c95d1120f3..7447c75a778af 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> @@ -68,10 +63,7 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{CatNotActive.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveCategory"/> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index 2394b41502f84..df2124759686d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> @@ -69,9 +64,8 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveIncludeInMenu"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 35e53273aebf2..2f86209da1eba 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> </actionGroup> @@ -70,9 +65,8 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="verifyInactiveIncludeInMenu"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 61ef389c7909e..2619e5e415686 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -88,10 +88,7 @@ <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveTheProduct"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <!--Run Re-Index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify product attribute added in product form --> <scrollTo selector="{{AdminProductFormSection.contentTab}}" stepKey="scrollToContentTab"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 54c3a05651c44..a00714e412b0a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -31,9 +31,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 7871f4305575a..3141db87f6976 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -117,9 +117,7 @@ <!-- Verify we see success message --> <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index 994ea76ca33df..f2840758d59a6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -95,10 +95,7 @@ <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index 7e5ee977d679b..3514f53e8b937 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -65,9 +65,7 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -96,10 +94,7 @@ <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> - <!--Reindex and flush cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index af31b7c1d5c07..4dd76e55f9330 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -31,10 +31,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index 809a015369ea9..3da19eb598012 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -65,10 +65,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory2"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage2"/> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index 9100e6027a52f..1c55b09151cf3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -22,10 +22,7 @@ <createData entity="FirstLevelSubCat" stepKey="createDefaultCategory"> <field key="is_active">true</field> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index 0e056e4bb7078..fe3ffbb4fc1d7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -56,10 +56,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory1"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Run re-index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify category displayed in store front page--> <amOnPage url="/$$createDefaultCategory.name$$/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml index 8e728fc6e1f27..e06a7f3c5679c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml @@ -34,10 +34,7 @@ <argument name="customStore" value="storeViewData"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value="full_page"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 1707fda9e3edb..e989aa3758cf3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -65,9 +65,7 @@ </actionGroup> <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 73aeed3af4fb0..f5046faf82b6f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -45,9 +45,7 @@ <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index 208b588493112..f7f87da77b401 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -35,9 +35,7 @@ <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -48,9 +46,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexersMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> </actionGroup> @@ -61,10 +57,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Select Created Category--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexBeforeFlow"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexBeforeFlow"/> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/> <actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="selectCreatedCategory"/> @@ -82,10 +75,7 @@ <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Open Index Management Page and verify flat categoryIndex status--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index a688dea47a0c4..b316e3194c986 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -64,9 +64,8 @@ <click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="enableIncludeInMenuOption"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml index 67ca04a0a4594..1032c322053da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -39,10 +39,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToCategoryPage"/> From 8749553fca0ce2b626bd45d4af2f72815a46c458 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 9 Dec 2020 17:51:56 +0200 Subject: [PATCH 454/490] test dhl request when product name contains special chars --- .../Magento/Dhl/Model/CarrierTest.php | 45 ++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php index f9a1d2923e5be..552040489e253 100644 --- a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php +++ b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php @@ -17,19 +17,22 @@ use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Quote\Model\Quote\Address\RateResult\Error; use Magento\Shipping\Model\Shipment\Request; +use Magento\Shipping\Model\Simplexml\Element as ShippingElement; use Magento\Shipping\Model\Tracking\Result\Status; use Magento\Store\Model\ScopeInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\HTTP\AsyncClientInterfaceMock; -use Magento\Shipping\Model\Simplexml\Element as ShippingElement; +use PHPUnit\Framework\TestCase; /** * Test for DHL integration. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class CarrierTest extends \PHPUnit\Framework\TestCase +class CarrierTest extends TestCase { + private const PRODUCT_NAME_SPECIAL_CHARS = 'Φυστίκι Ψημένο με Αλάτι Συσκευασία'; + /** * @var Carrier */ @@ -254,10 +257,16 @@ private function assertTrackingResult($expectedTrackingData, $trackingResults): * @param string $origCountryId * @param string $expectedRegionCode * @param string $destCountryId + * @param bool|null $isProductNameContainsSpecialChars + * @return void * @dataProvider requestToShipmentDataProvider */ - public function testRequestToShip(string $origCountryId, string $expectedRegionCode, string $destCountryId): void - { + public function testRequestToShip( + string $origCountryId, + string $expectedRegionCode, + string $destCountryId, + bool $isProductNameContainsSpecialChars = false + ): void { $this->config->setValue( 'shipping/origin/country_id', $origCountryId, @@ -274,6 +283,8 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC ) ] ); + $productName = $isProductNameContainsSpecialChars ? self::PRODUCT_NAME_SPECIAL_CHARS : 'item_name'; + //phpcs:enable Magento2.Functions.DiscouragedFunction $request = new Request( [ @@ -291,7 +302,7 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC ], 'items' => [ 'item1' => [ - 'name' => 'item_name', + 'name' => $productName, ], ], ], @@ -329,10 +340,15 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_28TO32_Char_CHECKED'; $requestElement->Request->ServiceHeader->MessageTime = 'currentTime'; $requestElement->ShipmentDetails->Date = 'currentTime'; - $this->assertXmlStringEqualsXmlString( - $this->getExpectedLabelRequestXml($origCountryId, $destCountryId, $expectedRegionCode), - $requestElement->asXML() + + $expectedLabelRequest = $this->getExpectedLabelRequestXml( + $origCountryId, + $destCountryId, + $expectedRegionCode, + $isProductNameContainsSpecialChars ); + + $this->assertXmlStringEqualsXmlString($expectedLabelRequest, $requestElement->asXML()); } /** @@ -351,7 +367,10 @@ public function requestToShipmentDataProvider(): array ], [ 'DE', 'EU', 'DE' - ] + ], + [ + 'GB', 'EU', 'US', true + ], ]; } @@ -361,12 +380,14 @@ public function requestToShipmentDataProvider(): array * @param string $origCountryId * @param string $destCountryId * @param string $regionCode + * @param bool $isProductNameContainsSpecialChars * @return string */ private function getExpectedLabelRequestXml( string $origCountryId, string $destCountryId, - string $regionCode + string $regionCode, + bool $isProductNameContainsSpecialChars ): string { $countryNames = [ 'US' => 'United States Of America', @@ -387,6 +408,10 @@ private function getExpectedLabelRequestXml( $expectedRequestElement->Shipper->CountryName = $countryNames[$origCountryId]; $expectedRequestElement->RegionCode = $regionCode; + if ($isProductNameContainsSpecialChars) { + $expectedRequestElement->ShipmentDetails->Pieces->Piece->PieceContents = self::PRODUCT_NAME_SPECIAL_CHARS; + } + return $expectedRequestElement->asXML(); } From 50535cf17ac47a384aec9af2bab22b1968869a5a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 9 Dec 2020 17:57:48 +0200 Subject: [PATCH 455/490] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- app/code/Magento/Backend/App/Area/FrontNameResolver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index 6c586781f2d81..6f78a3d055299 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -120,10 +120,10 @@ public function getFrontName($checkHost = false) */ public function isHostBackend() { - if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) { - $backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE); + if ($this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL)) { + $backendUrl = $this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_URL); } else { - $backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE); + $backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL); } $host = $this->request->getServer('HTTP_HOST', ''); return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; From a857a796df15bdb338eb4d7982c1a47fd8ee07ff Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 9 Dec 2020 22:36:07 +0200 Subject: [PATCH 456/490] =?UTF-8?q?MC-36425:=20=E2=80=9CSelect=20Shipping?= =?UTF-8?q?=20Method=E2=80=9D=20page=20of=20Multishipping=20Checkout=20is?= =?UTF-8?q?=20corrupted=20if=20a=20Customer=20use=20=E2=80=9Cgo=20back?= =?UTF-8?q?=E2=80=9D=20browser=20button=20to=20return=20to=20the=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/Multishipping/Model/Cart/Controller/CartPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php index ea3e765ebb5cc..03587f71036f2 100644 --- a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php +++ b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php @@ -74,6 +74,7 @@ public function beforeDispatch(Cart $subject, RequestInterface $request) /** @var Quote $quote */ $quote = $this->checkoutSession->getQuote(); if ($quote->isMultipleShippingAddresses() && $this->isCheckoutComplete()) { + $this->disableMultishipping->execute($quote); foreach ($quote->getAllShippingAddresses() as $address) { $quote->removeAddress($address->getId()); } From c33bb8ea7679bc069bb857ad469b09c3bc8c2680 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Thu, 10 Dec 2020 07:21:21 +0200 Subject: [PATCH 457/490] =?UTF-8?q?MC-36425:=20=E2=80=9CSelect=20Shipping?= =?UTF-8?q?=20Method=E2=80=9D=20page=20of=20Multishipping=20Checkout=20is?= =?UTF-8?q?=20corrupted=20if=20a=20Customer=20use=20=E2=80=9Cgo=20back?= =?UTF-8?q?=E2=80=9D=20browser=20button=20to=20return=20to=20the=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oginAsCustomerMultishippingLoggingTest.xml | 13 ++-- ...teToShippingInformationPageActionGroup.xml | 20 +++++ ...MultipleAddressesOnCheckoutActionGroup.xml | 29 +++++++ ...toreFrontCheckingWithMultishipmentTest.xml | 2 +- ...oreFrontCheckingWithSingleShipmentTest.xml | 2 +- ...toreFrontMinicartWithMultishipmentTest.xml | 2 +- ...hMultishippingAfterReturningToCartTest.xml | 78 +++++++++++++++++++ .../StorefrontOrderWithMultishippingTest.xml | 8 +- ...heckMoneyOrderPaymentMethodActionGroup.xml | 18 +++++ ...heckMoneyOrderPaymentMethodActionGroup.xml | 18 +++++ ...sableFlatRateShippingMethodActionGroup.xml | 18 +++++ ...liDisableFreeShippingMethodActionGroup.xml | 18 +++++ ...nableFlatRateShippingMethodActionGroup.xml | 18 +++++ ...CliEnableFreeShippingMethodActionGroup.xml | 18 +++++ ...ontPaypalSmartButtonInCheckoutPageTest.xml | 2 +- 15 files changed, 251 insertions(+), 13 deletions(-) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontNavigateToShippingInformationPageActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectMultipleAddressesOnCheckoutActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCreateOrderWithMultishippingAfterReturningToCartTest.xml create mode 100644 app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliDisableCheckMoneyOrderPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliEnableCheckMoneyOrderPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFlatRateShippingMethodActionGroup.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFreeShippingMethodActionGroup.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFlatRateShippingMethodActionGroup.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFreeShippingMethodActionGroup.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml index 79c7571a08cfb..79a224c4f4bc6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml @@ -23,14 +23,17 @@ </annotations> <before> - <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/> - <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/> - <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShipping"/> + <actionGroup ref="CliEnableFlatRateShippingMethodActionGroup" stepKey="enableFlatRateShipping"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestRun"> + <argument name="tags" value="config"/> + </actionGroup> + <createData entity="SimpleProduct2" stepKey="createProduct1"/> <createData entity="SimpleProduct2" stepKey="createProduct2"/> <createData entity="Simple_US_Customer_Assistance_Allowed_Two_Addresses" stepKey="createCustomer"/> @@ -43,7 +46,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> - <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/> + <actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/> <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontNavigateToShippingInformationPageActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontNavigateToShippingInformationPageActionGroup.xml new file mode 100644 index 0000000000000..1ca3b20af6a84 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontNavigateToShippingInformationPageActionGroup.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="StorefrontNavigateToShippingInformationPageActionGroup"> + <annotations> + <description>Navigate to shipping information page. Starts on multishipping addressees page.</description> + </annotations> + + <waitForElementVisible selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="waitForButton"/> + <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> + <waitForPageLoad stepKey="waitForShippingInfoPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectMultipleAddressesOnCheckoutActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectMultipleAddressesOnCheckoutActionGroup.xml new file mode 100644 index 0000000000000..f5e76a0d146fc --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectMultipleAddressesOnCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?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="StorefrontSelectMultipleAddressesOnCheckoutActionGroup"> + <annotations> + <description>Select addresses for multinshipping checkout. Start on multishipping addresses page.</description> + </annotations> + <arguments> + <argument name="addressOption1" type="string" defaultValue="1"/> + <argument name="addressOption2" type="string" defaultValue="2"/> + </arguments> + + <waitForElementVisible selector="{{MultishippingSection.shippingAddressOptions(addressOption1,addressOption1)}}" stepKey="waitForMultishippingPage"/> + <grabTextFrom selector="{{MultishippingSection.shippingAddressOptions(addressOption1,addressOption1)}}" stepKey="firstShippingAddressValue"/> + <selectOption selector="{{MultishippingSection.shippingAddressSelector(addressOption1)}}" userInput="{$firstShippingAddressValue}" stepKey="selectFirstShippingMethod"/> + <waitForPageLoad after="selectFirstShippingMethod" stepKey="waitForSecondShippingAddresses"/> + <grabTextFrom selector="{{MultishippingSection.shippingAddressOptions(addressOption2,addressOption2)}}" stepKey="secondShippingAddressValue"/> + <selectOption selector="{{MultishippingSection.shippingAddressSelector(addressOption2)}}" userInput="{$secondShippingAddressValue}" stepKey="selectSecondShippingMethod"/> + <click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/> + <waitForPageLoad stepKey="waitForShippingInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 7ae23e8f871eb..5e1c14c57f533 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -30,7 +30,7 @@ <createData entity="Simple_US_Customer_Two_Addresses" stepKey="customer"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> - <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index 27876df8caefe..dcdc9203a2075 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -30,7 +30,7 @@ <createData entity="Simple_US_Customer_Two_Addresses" stepKey="customer"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> - <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index f21a8d32d8841..043d0fc41abe7 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -30,7 +30,7 @@ <createData entity="Simple_US_Customer_Two_Addresses" stepKey="customer"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> - <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCreateOrderWithMultishippingAfterReturningToCartTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCreateOrderWithMultishippingAfterReturningToCartTest.xml new file mode 100644 index 0000000000000..f0a97d240aa69 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCreateOrderWithMultishippingAfterReturningToCartTest.xml @@ -0,0 +1,78 @@ +<?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="StorefrontCreateOrderWithMultishippingAfterReturningToCartTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Checkout with multiple addresses."/> + <title value="Checkout with multiple addresses after returning on cart page during checkout."/> + <description value="Verify customer able to checkout with multiple addresses after returning to cart page and continue checkout with browser 'back' button."/> + <severity value="AVERAGE"/> + <testCaseId value="MC-39583"/> + <useCaseId value="MC-36425"/> + <group value="multishipping"/> + </annotations> + + <before> + <!--Create test data.--> + <createData entity="SimpleProduct2" stepKey="product"/> + <createData entity="Simple_US_Customer_Two_Addresses" stepKey="customer"/> + <!--Set up configuration.--> + <actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShipping"/> + <actionGroup ref="CliEnableFlatRateShippingMethodActionGroup" stepKey="enableFlatRateShipping"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> + </before> + + <after> + <!--Clean up test data, revert configuration.--> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/> + </after> + + <!--Add product to cart and proceed to multishipping checkout. --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="navigateToProductPage"> + <argument name="productUrl" value="$product.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> + <argument name="productName" value="$product.name$"/> + <argument name="productQty" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <actionGroup ref="CheckingWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> + <actionGroup ref="SelectMultiShippingInfoActionGroup" stepKey="checkoutWithMultipleShipping"/> + <waitForPageLoad stepKey="waitForShippingInfoPage"/> + <!--Open cart page before place order.--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToCartPage"/> + <waitForPageLoad stepKey="waitForCartPageLoad"/> + <!--Go back to continue checkout with multiple addresses again.--> + <moveBack stepKey="navigateBackToMultishippingCheckout"/> + <actionGroup ref="StorefrontSelectMultipleAddressesOnCheckoutActionGroup" stepKey="selectAddresses"/> + <actionGroup ref="StorefrontNavigateToShippingInformationPageActionGroup" stepKey="navigateToShippingInformationPage"/> + <actionGroup ref="SelectMultiShippingInfoActionGroup" stepKey="checkoutWithMultipleShippingAgain"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPaymentAgain"/> + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="checkoutWithPaymentMethodAgain"/> + <actionGroup ref="ReviewOrderForMultiShipmentActionGroup" stepKey="reviewOrderForMultiShipment"> + <argument name="totalNameForFirstOrder" value="Shipping & Handling"/> + <argument name="totalPositionForFirstOrder" value="1"/> + <argument name="totalNameForSecondOrder" value="Shipping & Handling"/> + <argument name="totalPositionForSecondOrder" value="2"/> + </actionGroup> + <waitForPageLoad stepKey="waitForPlaceOrderPageLoad"/> + <actionGroup ref="StorefrontPlaceOrderForMultipleAddressesActionGroup" stepKey="placeOrder"> + <argument name="firstOrderPosition" value="1"/> + <argument name="secondOrderPosition" value="2"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml index 2e5c0acc32053..cdf9c5683c57b 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml @@ -27,9 +27,9 @@ <createData entity="SimpleProduct2" stepKey="createProduct2"/> <createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/> <!-- Set configurations --> - <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/> - <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/> - <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShipping"/> + <actionGroup ref="CliEnableFlatRateShippingMethodActionGroup" stepKey="enableFlatRateShipping"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$createCustomer$$"/> @@ -42,7 +42,7 @@ <!-- Need logout before customer delete. Fatal error appears otherwise --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/> + <actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> diff --git a/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliDisableCheckMoneyOrderPaymentMethodActionGroup.xml b/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliDisableCheckMoneyOrderPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..4189a28e6746a --- /dev/null +++ b/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliDisableCheckMoneyOrderPaymentMethodActionGroup.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="CliDisableCheckMoneyOrderPaymentMethodActionGroup"> + <annotations> + <description>Disable Check/Money order payment method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{DisableCheckMoneyOrderPaymentMethod.path}} {{DisableCheckMoneyOrderPaymentMethod.value}}" stepKey="disableCheckMoneyOrderPaymentMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliEnableCheckMoneyOrderPaymentMethodActionGroup.xml b/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliEnableCheckMoneyOrderPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..155633b0772fd --- /dev/null +++ b/app/code/Magento/OfflinePayments/Test/Mftf/ActionGroup/CliEnableCheckMoneyOrderPaymentMethodActionGroup.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="CliEnableCheckMoneyOrderPaymentMethodActionGroup"> + <annotations> + <description>Enable Check/Money order payment method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFlatRateShippingMethodActionGroup.xml b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFlatRateShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..3b3e3d597e9f7 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFlatRateShippingMethodActionGroup.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="CliDisableFlatRateShippingMethodActionGroup"> + <annotations> + <description>Disable Flat Rate shipping method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{DisableFlatRateShippingMethod.path}} {{DisableFlatRateShippingMethod.value}}" stepKey="disableFlatRateShippingMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFreeShippingMethodActionGroup.xml b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFreeShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..38f2176a95986 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliDisableFreeShippingMethodActionGroup.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="CliDisableFreeShippingMethodActionGroup"> + <annotations> + <description>Disable Free Shipping method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShippingMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFlatRateShippingMethodActionGroup.xml b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFlatRateShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..f138a9b616289 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFlatRateShippingMethodActionGroup.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="CliEnableFlatRateShippingMethodActionGroup"> + <annotations> + <description>Enable Flat Rate shipping method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShippingMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFreeShippingMethodActionGroup.xml b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFreeShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..05b7378466b6f --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/ActionGroup/CliEnableFreeShippingMethodActionGroup.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="CliEnableFreeShippingMethodActionGroup"> + <annotations> + <description>Enable Free Shipping method by CLI command config:set</description> + </annotations> + + <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShippingMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml index cea228ac7a344..d43e894b014ff 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml @@ -41,7 +41,7 @@ <after> <magentoCLI command="config:set {{StorefrontPaypalEnableTransferCartLineConfigData.path}} {{StorefrontPaypalEnableTransferCartLineConfigData.value}}" stepKey="enableTransferCartLine"/> <magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="setPaymentAction"/> - <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/> + <actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/> <!-- Delete product --> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> From 706e63d8995daedacdfcb42dc1c7de700e8f1eb2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 10:38:37 +0200 Subject: [PATCH 458/490] renamed Action Groups --- ...=> AssertAdminManageStockOnEditPageActionGroup.xml} | 2 +- ...=> AssertAdminProductInfoOnEditPageActionGroup.xml} | 2 +- ...ertAdminProductIsAssignedToCategoryActionGroup.xml} | 2 +- ...rontProductStockStatusOnProductPageActionGroup.xml} | 2 +- ...ctWithRegularPriceInStockEnabledFlatCatalogTest.xml | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertManageStockOnEditPageActionGroup.xml => AssertAdminManageStockOnEditPageActionGroup.xml} (92%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertProductInfoOnEditPageActionGroup.xml => AssertAdminProductInfoOnEditPageActionGroup.xml} (97%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertProductIsAssignedToCategoryActionGroup.xml => AssertAdminProductIsAssignedToCategoryActionGroup.xml} (92%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{StorefrontAssertProductStockStatusOnProductPageActionGroup.xml => AssertStorefrontProductStockStatusOnProductPageActionGroup.xml} (93%) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml similarity index 92% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml index 67df650a24228..eca989a5de41f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAssertManageStockOnEditPageActionGroup"> + <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> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml similarity index 97% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml index ba67168958fca..d91cdfee0489c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> + <actionGroup name="AssertAdminProductInfoOnEditPageActionGroup"> <annotations> <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml similarity index 92% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml index b33e319adc1f4..e6b178937a2cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAssertProductIsAssignedToCategoryActionGroup"> + <actionGroup name="AssertAdminProductIsAssignedToCategoryActionGroup"> <annotations> <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml similarity index 93% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml index 5af46bcd734d1..857d88ebc197c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.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="StorefrontAssertProductStockStatusOnProductPageActionGroup"> + <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> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml index c083f827e8930..3af6de07e561d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml @@ -67,20 +67,20 @@ </actionGroup> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> - <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <actionGroup ref="AssertAdminManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> <argument name="manageStock" value="No"/> </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <actionGroup ref="AssertAdminProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> <argument name="product" value="simpleProductEnabledFlat"/> </actionGroup> @@ -105,7 +105,7 @@ <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> </actionGroup> From 2c4d9b1f0604d2462ea4d231168e8783ce226ff4 Mon Sep 17 00:00:00 2001 From: Sergio Vera <svera@adobe.com> Date: Thu, 10 Dec 2020 11:35:58 +0100 Subject: [PATCH 459/490] MC-39542: : Change LiveCodeTest php stability test - Return error if not PHP supported versions are defined in composer.json --- dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index f294e2c2f55e1..65358cd785066 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -414,6 +414,7 @@ public function testStrictTypes() public function testPhpCompatibility() { $targetVersions = $this->getTargetPhpVersions(); + $this->assertNotEmpty($targetVersions, 'No supported versions information in composer.json'); $reportFile = self::$reportDir . '/phpcompatibility_report.txt'; $rulesetDir = __DIR__ . '/_files/PHPCompatibilityMagento'; From e85f913ce5e87bcdef7bf265b5b7e04c4b060535 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 13:05:20 +0200 Subject: [PATCH 460/490] adding AssertAdminProductIsAssignedToCategoryActionGroup --- ...ProductIsAssignedToCategoryActionGroup.xml | 22 +++++++++++++++++++ .../AdminProductFormSection.xml | 1 + ...dminUpdateSimpleProductTieredPriceTest.xml | 8 +++++-- ...PriceInStockNotVisibleIndividuallyTest.xml | 8 +++++-- ...ceInStockVisibleInCatalogAndSearchTest.xml | 8 +++++-- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 8 +++++-- ...larPriceInStockVisibleInSearchOnlyTest.xml | 8 +++++-- ...gularPriceInStockWithCustomOptionsTest.xml | 8 +++++-- ...eProductWithRegularPriceOutOfStockTest.xml | 8 +++++-- 9 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml new file mode 100644 index 0000000000000..e6b178937a2cc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertAdminProductIsAssignedToCategoryActionGroup"> + <annotations> + <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index 1ca051e2f6669..d70c48f2b00e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -77,5 +77,6 @@ <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> + <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..338df481e3794 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -110,8 +110,12 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductTierPrice300InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="seeSimpleProductWeight"/> <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <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"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 86fac835ce44d..3d53501ede4cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <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"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..e121e239ad334 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice245InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <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" /> + + <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="{{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 77c3e7548a3cf..6ad01e59eea51 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -84,8 +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"/> - <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> + <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 39dab0b08915c..ec4b0296e82c1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice325InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <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" /> + + <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="{{simpleProductRegularPrice325InStock.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/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 670030d1d98ea..2a7d5c6c18a02 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -97,8 +97,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPriceCustomOptions.quantity}}" stepKey="seeSimpleProductQuantity"/> <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" /> + + <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> + <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"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..170e731f38ba3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -84,8 +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"/> - <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> + <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 2587e3221f56d237588d1fc23dd4aa4e3b076fca Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 15:24:56 +0200 Subject: [PATCH 461/490] updated with OpenEditProductOnBackendActionGroup --- ...tNameToVerifyDataOverridingOnStoreViewLevelTest.xml | 10 +++++----- ...PriceToVerifyDataOverridingOnStoreViewLevelTest.xml | 10 +++++----- .../Test/AdminUpdateSimpleProductTieredPriceTest.xml | 10 +++++----- ...oductWithRegularPriceInStockDisabledProductTest.xml | 10 +++++----- ...leProductWithRegularPriceInStockEnabledFlatTest.xml | 10 +++++----- ...thRegularPriceInStockNotVisibleIndividuallyTest.xml | 10 +++++----- ...WithRegularPriceInStockUnassignFromCategoryTest.xml | 10 +++++----- ...egularPriceInStockVisibleInCatalogAndSearchTest.xml | 10 +++++----- ...WithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 10 +++++----- ...tWithRegularPriceInStockVisibleInSearchOnlyTest.xml | 10 +++++----- ...uctWithRegularPriceInStockWithCustomOptionsTest.xml | 10 +++++----- ...dateSimpleProductWithRegularPriceOutOfStockTest.xml | 10 +++++----- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 5f7cecfde188a..70d6932f6fc17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -42,12 +42,12 @@ </after> <!-- Search default simple product in grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Assign simple product to created store view --> <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="clickCategoryStoreViewDropdownToggle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index 8a05ed9d64b8b..f9c90b1190611 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -42,12 +42,12 @@ </after> <!-- Search default simple product in grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Assign simple product to created store view --> <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="clickCategoryStoreViewDropdownToggle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..73ceed8489f7a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -44,12 +44,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with tier price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index a9630aba467c6..9cae9cc3f1f42 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -34,12 +34,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index aa1b1ae702914..4aa1f694a0a24 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -38,12 +38,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 86fac835ce44d..4c4c46c6579c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml index af3861e4e0b64..7bb5f090edf5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml @@ -34,12 +34,12 @@ </after> <!--Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product by unselecting categories --> <scrollTo selector="{{AdminProductFormSection.productStockStatus}}" stepKey="scroll"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..36b6711e25c25 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 77c3e7548a3cf..f3e73845e4a81 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 39dab0b08915c..5303d489a8235 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 670030d1d98ea..914e261115cf6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..bd2d3c239792e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <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> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(out of stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductName"/> From d30fd1fbed12e593f168629c22f117f58e6dd156 Mon Sep 17 00:00:00 2001 From: Viktor Kopin <viktor.kopin@transoftgroup.com> Date: Thu, 10 Dec 2020 17:20:03 +0200 Subject: [PATCH 462/490] MC-38931: Product URL Rewrites are not removed when product removed from website --- ...uctProcessUrlRewriteSavingObserverTest.php | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 64f7acb1feda2..0ceff2aeff5e5 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -14,8 +14,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Event; use Magento\Framework\Event\Observer; -use Magento\Framework\ObjectManagerInterface; -use Magento\Store\Api\StoreWebsiteRelationInterface; +use Magento\Store\Model\StoreResolver\GetStoresListByWebsiteIds; use Magento\UrlRewrite\Model\UrlPersistInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -46,21 +45,11 @@ class ProductProcessUrlRewriteSavingObserverTest extends TestCase */ protected $product; - /** - * @var ObjectManagerInterface - */ - protected $objectManager; - /** * @var ProductProcessUrlRewriteSavingObserver */ protected $model; - /** - * @var StoreWebsiteRelationInterface|MockObject - */ - private $storeRelation; - /** * @var AppendUrlRewritesToProducts|MockObject */ @@ -100,10 +89,6 @@ protected function setUp(): void $this->event->expects($this->any())->method('getProduct')->willReturn($this->product); $this->observer = $this->createPartialMock(Observer::class, ['getEvent']); $this->observer->expects($this->any())->method('getEvent')->willReturn($this->event); - $this->storeRelation = $this->getMockBuilder(StoreWebsiteRelationInterface::class) - ->onlyMethods(['getStoreByWebsiteId']) - ->disableOriginalConstructor() - ->getMock(); $this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class) ->onlyMethods(['isSetFlag']) @@ -115,11 +100,16 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMock(); + $getStoresList = $this->getMockBuilder(GetStoresListByWebsiteIds::class) + ->onlyMethods(['execute']) + ->disableOriginalConstructor() + ->getMock(); + $this->model = new ProductProcessUrlRewriteSavingObserver( $this->urlPersist, - $this->storeRelation, $this->appendRewrites, - $this->scopeConfig + $this->scopeConfig, + $getStoresList ); } @@ -228,10 +218,6 @@ public function testExecuteUrlKey( ->method('getIsChangedCategories') ->willReturn($isChangedCategories); - $this->storeRelation->expects($this->any()) - ->method('getStoreByWebsiteId') - ->willReturn([3]); - $this->product->expects($this->any())->method('getWebsiteIds')->will( $this->returnValue($websitesWithProduct) ); From e726f1c75393d38640751a66815618cbe66f9ad8 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 10 Dec 2020 17:52:33 +0200 Subject: [PATCH 463/490] Add integration test --- .../Magento/TestModuleMview/etc/module.xml | 10 ++++ .../Magento/TestModuleMview/etc/mview.xml | 18 +++++++ .../Magento/TestModuleMview/registration.php | 12 +++++ .../Framework/Mview/View/ChangelogTest.php | 49 +++++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/registration.php diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml b/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml new file mode 100644 index 0000000000000..9808d90ace49c --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml @@ -0,0 +1,10 @@ +<?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:Module/etc/module.xsd"> + <module name="Magento_TestModuleMview"/> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml b/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml new file mode 100644 index 0000000000000..1cabda7a626bf --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * 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:Mview/etc/mview.xsd"> + <view id="test_view_with_additional_columns" class="Magento\Framework\Indexer\Action\Dummy" group="indexer"> + <subscriptions> + <table name="test_mview_table" entity_column="entity_id"> + <additionalColumns> + <column name="additional_column" cl_name="test_additional_column" /> + </additionalColumns> + </table> + </subscriptions> + </view> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/registration.php b/dev/tests/integration/_files/Magento/TestModuleMview/registration.php new file mode 100644 index 0000000000000..5c5453c1bd413 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleMview') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMview', __DIR__); +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php b/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php index ba2225fbe5eac..b77807a11da9b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Mview\View; /** * Test Class for \Magento\Framework\Mview\View\Changelog @@ -123,6 +124,54 @@ public function testClear() $this->assertEquals(1, $this->model->getVersion()); //the same that a table is empty } + /** + * Create entity table for MView + * + * @param string $tableName + * @return void + */ + private function createEntityTable(string $tableName) + { + $table = $this->resource->getConnection()->newTable( + $tableName + )->addColumn( + 'entity_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Version ID' + )->addColumn( + 'additional_column', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Entity ID' + ); + $this->resource->getConnection()->createTable($table); + } + + public function testAdditionalColumns() + { + $tableName = 'test_mview_table'; + $this->createEntityTable($tableName); + $view = $this->objectManager->create(View::class); + $view->load('test_view_with_additional_columns'); + $view->subscribe(); + $this->connection->insert($tableName, ['entity_id' => 12, 'additional_column' => 13]); + $select = $this->connection->select() + ->from($view->getChangelog()->getName(), ['entity_id', 'test_additional_column']); + $actual = $this->connection->fetchAll($select); + $this->assertEquals( + [ + 'entity_id' => "12", + 'test_additional_column' => "13" + ], + reset($actual) + ); + $this->connection->dropTable($tableName); + $this->connection->dropTable($view->getChangelog()->getName()); + } + /** * Test for getList() method * From 646cfbfc08dc5fd956a26bbccf286d01babd0e82 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Wed, 9 Dec 2020 16:03:06 -0600 Subject: [PATCH 464/490] MC-39571: [MAGENTO CLOUD] Minimum order value with discount blocking checkout - Fix hidden tax should be taken into account in minimum order amount validation --- .../Model/Checkout/Type/Multishipping.php | 4 +- app/code/Magento/Quote/Model/Quote.php | 8 ++- .../Magento/Quote/Model/Quote/Address.php | 6 ++- .../Magento/Quote/Model/QuoteTest.php | 24 +++++++++ ...rt_rule_with_coupon_5_off_no_condition.php | 49 +++++++++++++++++++ ...ith_coupon_5_off_no_condition_rollback.php | 36 ++++++++++++++ 6 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition.php create mode 100644 dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition_rollback.php diff --git a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php index 8845395be406e..8bfff09aa73b2 100644 --- a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php +++ b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php @@ -1185,7 +1185,9 @@ private function validateMinimumAmountForAddressItems() $baseTotal = 0; foreach ($addresses as $address) { - $taxes = $taxInclude ? $address->getBaseTaxAmount() : 0; + $taxes = $taxInclude + ? $address->getBaseTaxAmount() + $address->getBaseDiscountTaxCompensationAmount() + : 0; $baseTotal += $address->getBaseSubtotalWithDiscount() + $taxes; } diff --git a/app/code/Magento/Quote/Model/Quote.php b/app/code/Magento/Quote/Model/Quote.php index d2e900138cd06..48cd4b2eb2fad 100644 --- a/app/code/Magento/Quote/Model/Quote.php +++ b/app/code/Magento/Quote/Model/Quote.php @@ -2312,7 +2312,9 @@ public function validateMinimumAmount($multishipping = false) if (!$minOrderMulti) { foreach ($addresses as $address) { - $taxes = ($taxInclude) ? $address->getBaseTaxAmount() : 0; + $taxes = $taxInclude + ? $address->getBaseTaxAmount() + $address->getBaseDiscountTaxCompensationAmount() + : 0; foreach ($address->getQuote()->getItemsCollection() as $item) { /** @var \Magento\Quote\Model\Quote\Item $item */ $amount = $includeDiscount ? @@ -2327,7 +2329,9 @@ public function validateMinimumAmount($multishipping = false) } else { $baseTotal = 0; foreach ($addresses as $address) { - $taxes = ($taxInclude) ? $address->getBaseTaxAmount() : 0; + $taxes = $taxInclude + ? $address->getBaseTaxAmount() + $address->getBaseDiscountTaxCompensationAmount() + : 0; $baseTotal += $includeDiscount ? $address->getBaseSubtotalWithDiscount() + $taxes : $address->getBaseSubtotal() + $taxes; diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index aee86eb1f8935..7f1ada710ffb7 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -139,7 +139,7 @@ class Address extends AbstractAddress implements const ADDRESS_TYPE_BILLING = 'billing'; const ADDRESS_TYPE_SHIPPING = 'shipping'; - + private const CACHED_ITEMS_ALL = 'cached_items_all'; /** @@ -1217,7 +1217,9 @@ public function validateMinimumAmount() $storeId ); - $taxes = $taxInclude ? $this->getBaseTaxAmount() : 0; + $taxes = $taxInclude + ? $this->getBaseTaxAmount() + $this->getBaseDiscountTaxCompensationAmount() + : 0; return $includeDiscount ? ($this->getBaseSubtotalWithDiscount() + $taxes >= $amount) : diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php index 081cae5f98ee5..94cf6ef108474 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php @@ -737,4 +737,28 @@ private function getCustomerDataArray(): array CustomerInterface::WEBSITE_ID => 1, ]; } + + /** + * @magentoConfigFixture current_store sales/minimum_order/active 1 + * @magentoConfigFixture current_store sales/minimum_order/amount 5 + * @magentoConfigFixture current_store sales/minimum_order/tax_including 1 + * @magentoConfigFixture current_store sales/minimum_order/include_discount_amount 1 + * @magentoConfigFixture current_store tax/calculation/price_includes_tax 1 + * @magentoConfigFixture current_store tax/calculation/apply_after_discount 1 + * @magentoConfigFixture current_store tax/calculation/cross_border_trade_enabled 1 + * @magentoDataFixture Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition.php + * @magentoDataFixture Magento/Tax/_files/tax_rule_region_1_al.php + * @magentoDataFixture Magento/Checkout/_files/quote_with_taxable_product_and_customer.php + */ + public function testValidateMinimumAmountWithPriceInclTaxAndDiscount() + { + /** @var $quote \Magento\Quote\Model\Quote */ + $quote = $this->getQuoteByReservedOrderId->execute('test_order_with_taxable_product'); + $quote->setCouponCode('CART_FIXED_DISCOUNT_5'); + $quote->collectTotals(); + $this->assertEquals(-5, $quote->getShippingAddress()->getBaseDiscountAmount()); + $this->assertEquals(9.3, $quote->getShippingAddress()->getBaseSubtotal()); + $this->assertEquals(5, $quote->getShippingAddress()->getBaseGrandTotal()); + $this->assertTrue($quote->validateMinimumAmount()); + } } diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition.php new file mode 100644 index 0000000000000..6ce2e0789e478 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Model\GroupManagement; +use Magento\Customer\Model\ResourceModel\Group\Collection; +use Magento\SalesRule\Api\CouponRepositoryInterface; +use Magento\SalesRule\Model\Coupon; +use Magento\SalesRule\Model\Rule; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Collection $groupCollection */ +$groupCollection = $objectManager->get(Collection::class); +$customerGroupIds = $groupCollection->getAllIds(); +/** @var Rule $salesRule */ +$salesRule = $objectManager->create(Rule::class); +$salesRule->setData( + [ + 'name' => 'cart_rule_with_coupon_5_off_no_condition', + 'is_active' => 1, + 'customer_group_ids' => $groupCollection->getAllIds(), + 'coupon_type' => Rule::COUPON_TYPE_SPECIFIC, + 'simple_action' => Rule::CART_FIXED_ACTION, + 'discount_amount' => 5, + 'discount_step' => 0, + 'stop_rules_processing' => 1, + 'website_ids' => [ + $objectManager->get(StoreManagerInterface::class)->getWebsite()->getId(), + ], + 'store_labels' => [ + + 'store_id' => 0, + 'store_label' => 'cart_rule_with_coupon_5_off_no_condition', + ] + ] +); +$objectManager->get(\Magento\SalesRule\Model\ResourceModel\Rule::class)->save($salesRule); + +// Create coupon and assign "5$ fixed discount" rule to this coupon. +$coupon = $objectManager->create(Coupon::class); +$coupon->setRuleId($salesRule->getId()) + ->setCode('CART_FIXED_DISCOUNT_5') + ->setType(0); +$objectManager->get(CouponRepositoryInterface::class)->save($coupon); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition_rollback.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition_rollback.php new file mode 100644 index 0000000000000..7ecf7a915b1ea --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_with_coupon_5_off_no_condition_rollback.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\Registry; +use Magento\SalesRule\Api\RuleRepositoryInterface; +use Magento\SalesRule\Model\Rule; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var SearchCriteriaBuilder $searchCriteriaBuilder */ +$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class); +$searchCriteria = $searchCriteriaBuilder->addFilter('name', 'cart_rule_with_coupon_5_off_no_condition') + ->create(); +/** @var RuleRepositoryInterface $ruleRepository */ +$ruleRepository = $objectManager->get(RuleRepositoryInterface::class); +$items = $ruleRepository->getList($searchCriteria) + ->getItems(); +/** @var Rule $salesRule */ +$salesRule = array_pop($items); +if ($salesRule !== null) { + $ruleRepository->deleteById($salesRule->getRuleId()); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 830f4a35214e4fd5c2bb7b04663203a79e85153a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 11 Dec 2020 11:18:23 +0200 Subject: [PATCH 465/490] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- .../Magento/Backend/App/Area/FrontNameResolver.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index 6f78a3d055299..a927f52b59d95 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -120,10 +120,16 @@ public function getFrontName($checkHost = false) */ public function isHostBackend() { - if ($this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL)) { - $backendUrl = $this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_URL); + if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) { + $backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE); } else { $backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL); + if ($backendUrl === null) { + $backendUrl = $this->scopeConfig->getValue( + Store::XML_PATH_UNSECURE_BASE_URL, + ScopeInterface::SCOPE_STORE + ); + } } $host = $this->request->getServer('HTTP_HOST', ''); return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; From f5cc98e68c00ff0e66d1dcc40b706e3bed1b7c98 Mon Sep 17 00:00:00 2001 From: korovitskyi <o.korovitskyi@atwix.com> Date: Fri, 11 Dec 2020 12:05:16 +0200 Subject: [PATCH 466/490] #31168 fix for customer which have more than two subscriptions --- .../Model/Plugin/CustomerPlugin.php | 21 ------------------- .../Newsletter/etc/extension_attributes.xml | 6 +----- .../Newsletter/Model/Plugin/PluginTest.php | 14 +++++++++++++ 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 6bdaa40019f8a..6c42875f5b32d 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -234,27 +234,6 @@ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInter return $customer; } - /** - * Add subscription status to customer list - * - * @param CustomerRepositoryInterface $subject - * @param SearchResults $searchResults - * @return SearchResults - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $searchResults): SearchResults - { - foreach ($searchResults->getItems() as $customer) { - /** @var CustomerExtensionInterface $extensionAttributes */ - $extensionAttributes = $customer->getExtensionAttributes(); - - $isSubscribed = (int) $extensionAttributes->getIsSubscribed() === Subscriber::STATUS_SUBSCRIBED ?: false; - $extensionAttributes->setIsSubscribed($isSubscribed); - } - - return $searchResults; - } - /** * Set Is Subscribed extension attribute * diff --git a/app/code/Magento/Newsletter/etc/extension_attributes.xml b/app/code/Magento/Newsletter/etc/extension_attributes.xml index 09925024e97d5..5c38c02c032b0 100644 --- a/app/code/Magento/Newsletter/etc/extension_attributes.xml +++ b/app/code/Magento/Newsletter/etc/extension_attributes.xml @@ -8,10 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface"> - <attribute code="is_subscribed" type="boolean" > - <join reference_table="newsletter_subscriber" reference_field="customer_id" join_on_field="entity_id"> - <field>subscriber_status</field> - </join> - </attribute> + <attribute code="is_subscribed" type="boolean"/> </extension_attributes> </config> diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php index 97f59e94d9cfe..133d74aec03da 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php @@ -205,4 +205,18 @@ public function testCustomerWithZeroStoreIdIsSubscribed() $this->assertEquals($customer->getId(), (int)$subscriber->getCustomerId()); $this->assertEquals($currentStore, (int)$subscriber->getStoreId()); } + + /** + * Test get list customer, which have more then 2 subscribes in newsletter_subscriber. + * + * @magentoAppArea frontend + * @magentoDataFixture Magento/Newsletter/_files/subscribers.php + */ + public function testCustomerWithTwoNewsLetterSubscriptions() + { + /** @var \Magento\Framework\Api\SearchCriteriaBuilder $searchBuilder */ + $searchBuilder = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); + $searchCriteria = $searchBuilder->addFilter('entity_id', 1)->create(); + $this->customerRepository->getList($searchCriteria); + } } From 62da7cb6912b4a36845f4e0a8cb2de4dff615202 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 11 Dec 2020 15:53:28 +0200 Subject: [PATCH 467/490] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- .../App/Area/FrontNameResolverTest.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php diff --git a/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php b/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php new file mode 100644 index 0000000000000..979e8db19efb9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\App\Area; + +use PHPUnit\Framework\TestCase; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * @magentoAppArea adminhtml + */ +class FrontNameResolverTest extends TestCase +{ + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + protected $objectManager; + + /** + * @var FrontNameResolver + */ + protected $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->model = $this->objectManager->create( + FrontNameResolver::class + ); + $_SERVER['HTTP_HOST'] = 'localhost'; + } + + /** + * @magentoDbIsolation enabled + * @magentoConfigFixture current_store web/unsecure/base_url http://example.com/ + */ + public function testIsHostBackend() + { + $this->assertTrue($this->model->isHostBackend()); + } +} From f9445ccaf7fe3300acf451c6950ecee08643f981 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:05:00 +0200 Subject: [PATCH 468/490] fix stepKey name --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 143fa6657cd3b..0b29d2edb6615 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -44,7 +44,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From f70063cabec8db464636408f7999d7f48fa9654d Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 11 Dec 2020 17:27:17 +0200 Subject: [PATCH 469/490] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- app/code/Magento/Catalog/Model/Product/Type/Price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 74a6c7f634f81..111e616897d58 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -379,7 +379,7 @@ public function getTierPrices($product) if (array_key_exists('website_price', $price)) { $value = $price['website_price']; } else { - $value = $price['price']; + $value = $price['price'] ?: null; } $tierPrice->setValue($value); $tierPrice->setQty($price['price_qty']); From b58d1f91f7f45024e06f19cd109899a864c7620e Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 11 Dec 2020 18:06:35 +0200 Subject: [PATCH 470/490] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- app/code/Magento/Catalog/Model/Product/Type/Price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 111e616897d58..206f3dba0ee60 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -379,7 +379,7 @@ public function getTierPrices($product) if (array_key_exists('website_price', $price)) { $value = $price['website_price']; } else { - $value = $price['price'] ?: null; + $value = $price['price'] ?? 0; } $tierPrice->setValue($value); $tierPrice->setQty($price['price_qty']); From 11d4a9f35f093f9b7c7eb4ed60a833ab7c841851 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 14 Dec 2020 10:52:08 +0200 Subject: [PATCH 471/490] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- .../Unit/Model/Product/Type/PriceTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php index 09ad8bb41de7c..c14bb7f524d03 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php @@ -263,4 +263,40 @@ function () { ); } } + + /** + * Get tier price with percent value type + * + * @return void + */ + public function testGetPricesWithPercentType(): void + { + $tierPrices = [ + 0 => [ + 'record_id' => 0, + 'cust_group' => 3200, + 'price_qty' => 3, + 'website_id' => 0, + 'value_type' => 'percent', + 'percentage_value' => 10, + ], + ]; + $this->product->setData('tier_price', $tierPrices); + $this->tpFactory->expects($this->any()) + ->method('create') + ->willReturnCallback( + function () { + return $this->objectManagerHelper->getObject(TierPrice::class); + } + ); + $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) + ->onlyMethods(['getPercentageValue', 'setPercentageValue']) + ->getMockForAbstractClass(); + $tierPriceExtensionMock->method('getPercentageValue') + ->willReturn(50); + $this->tierPriceExtensionFactoryMock->method('create') + ->willReturn($tierPriceExtensionMock); + + $this->assertInstanceOf(TierPrice::class, $this->model->getTierPrices($this->product)[0]); + } } From b54e7ae78916d215288b4ddb89d7351b5e183cef Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk <vova.yatsyuk@gmail.com> Date: Mon, 14 Dec 2020 13:35:14 +0200 Subject: [PATCH 472/490] Declare optional argument after required. This prevents PHP fatal error when plugin is added to the one of parent classes. Error example: 'Error: Cannot instantiate interface Magento\Framework\Data\OptionSourceInterface' --- .../MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php b/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php index f61e34512bfe3..57a59ad800469 100644 --- a/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php +++ b/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php @@ -33,8 +33,8 @@ class Asset extends Select * @param UiComponentFactory $uiComponentFactory * @param FilterBuilder $filterBuilder * @param FilterModifier $filterModifier - * @param OptionSourceInterface $optionsProvider * @param GetContentByAssetIdsInterface $getContentIdentities + * @param OptionSourceInterface $optionsProvider * @param array $components * @param array $data * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -44,8 +44,8 @@ public function __construct( UiComponentFactory $uiComponentFactory, FilterBuilder $filterBuilder, FilterModifier $filterModifier, - OptionSourceInterface $optionsProvider = null, GetContentByAssetIdsInterface $getContentIdentities, + OptionSourceInterface $optionsProvider = null, array $components = [], array $data = [] ) { From b82cae9b4c7c4e356bd19bc8cfc64011612ff702 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 14 Dec 2020 15:47:16 +0200 Subject: [PATCH 473/490] MC-39531: guest-carts/{cart_id}/items returns incorrect product name on non-default website --- .../Model/Quote/Plugin/UpdateQuoteStoreId.php | 61 +++++++++++++++++++ app/code/Magento/Quote/etc/webapi_rest/di.xml | 3 + 2 files changed, 64 insertions(+) create mode 100644 app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php diff --git a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php new file mode 100644 index 0000000000000..4ed347b1eb06d --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Plugin; + +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteRepository; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Updates quote store id. + */ +class UpdateQuoteStoreId +{ + /** + * @var QuoteRepository + */ + private $quoteRepository; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @param QuoteRepository $quoteRepository + * @param StoreManagerInterface $storeManager + */ + public function __construct( + QuoteRepository $quoteRepository, + StoreManagerInterface $storeManager + ) { + $this->quoteRepository = $quoteRepository; + $this->storeManager = $storeManager; + } + + /** + * Update store id in requested quote by store id from request. + * + * @param Quote $subject + * @param null $result + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterLoadByIdWithoutStore( + Quote $subject, + $result + ) { + $quoteStoreId = (int) $subject->getStoreId(); + $storeId = $this->storeManager->getStore() + ->getId() ?: $this->storeManager->getDefaultStoreView() + ->getId(); + if ($storeId !== $quoteStoreId) { + $subject->setStoreId($storeId); + } + } +} diff --git a/app/code/Magento/Quote/etc/webapi_rest/di.xml b/app/code/Magento/Quote/etc/webapi_rest/di.xml index a55d2146be156..6ed9909f04eb9 100644 --- a/app/code/Magento/Quote/etc/webapi_rest/di.xml +++ b/app/code/Magento/Quote/etc/webapi_rest/di.xml @@ -16,4 +16,7 @@ <type name="Magento\Quote\Api\GuestCartItemRepositoryInterface"> <plugin name="updateCartIdFromRequest" type="Magento\Quote\Plugin\UpdateCartId" /> </type> + <type name="Magento\Quote\Model\Quote"> + <plugin name="updateQuoteStoreId" type="Magento\Quote\Model\Quote\Plugin\UpdateQuoteStoreId" /> + </type> </config> From d013abf276cb688657de42d0de6b82abd65cfd45 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 14 Dec 2020 09:23:59 -0600 Subject: [PATCH 474/490] MC-38913: Associate to Website Functionality - Fix customer associated website should be editable in customer information page --- ...teInCustomerInformationPageActionGroup.xml | 20 +++++++++ .../AdminCustomerGridInlineEditorSection.xml | 3 -- ...minChangeCustomerAssociatedWebsiteTest.xml | 42 ++++++++----------- .../ui_component/customer_listing.xml | 3 ++ .../view/base/web/js/form/element/website.js | 4 -- 5 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup.xml new file mode 100644 index 0000000000000..bad564c6c9387 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup.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="AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup"> + <annotations> + <description>Update customer website in customer information page</description> + </annotations> + <arguments> + <argument name="websiteName" defaultValue="{{_defaultWebsite.name}}" type="string"/> + </arguments> + <selectOption selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{websiteName}}" stepKey="changeWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml index f074217224372..d010844cfffcf 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml @@ -11,8 +11,5 @@ <section name="AdminCustomerGridInlineEditorSection"> <element name="customerGenderEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='gender']"/> <element name="saveInGrid" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/> - <element name="customerEmailEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) input[name='email']"/> - <element name="customerWebsiteEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) select[name='website_id']"/> - <element name="cellContent" type="select" selector="//tr[@class='data-grid-editable-row' and not(contains(@style,'display:none'))]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{col}}')]/preceding-sibling::th) +1 ]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml index 2f4898921d0b6..469e27129d2c5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerAssociatedWebsiteTest.xml @@ -11,15 +11,14 @@ <test name="AdminChangeCustomerAssociatedWebsiteTest"> <annotations> <features value="Customer"/> - <title value="Admin should not be able to change customer assigned website ID"/> - <description value="Admin should not be able to change customer assigned website ID"/> + <title value="Admin should be able to change customer associated website ID"/> + <description value="Admin should be able to change customer associated website ID"/> <severity value="AVERAGE"/> <useCaseId value="MC-38913"/> <testCaseId value="MC-39764"/> <stories value="Customer Edit"/> <group value="customer"/> </annotations> - <before> <!--Login to admin--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -45,9 +44,6 @@ <after> <!--Delete customer--> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <!--Reset customer grid filter--> - <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomersPage"/> - <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomersGridFilter"/> <!--Delete custom website--> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="{{NewWebSiteData.name}}"/> @@ -55,31 +51,27 @@ <!--Logout from admin--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <!--Open customer grid--> - <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomersPage"/> - <!--Filter customers grid by email--> - <actionGroup ref="AdminFilterCustomerGridByEmail" stepKey="filterCustomer"> - <argument name="email" value="$createCustomer.email$"/> - </actionGroup> - <!--Click on customer row to open inline editor--> - <click selector="{{AdminDataGridTableSection.rowTemplate($createCustomer.email$)}}" stepKey="clickCustomersGridRow"/> - <!--Wait for inline editor to open--> - <waitForElementVisible selector="{{AdminCustomerGridInlineEditorSection.customerEmailEditor}}" stepKey="waitForEditor"/> - <!--Assert that website is not editable--> - <dontSeeElement selector="{{AdminCustomerGridInlineEditorSection.customerWebsiteEditor}}" stepKey="dontSeeWebsiteEditor"/> - <!--Assert that "Main Website" is displayed in website cell--> - <see selector="{{AdminCustomerGridInlineEditorSection.cellContent('Web Site')}}" userInput="{{_defaultWebsite.name}}" stepKey="assertThatMainWebsiteIsDisplayedInWebsiteCell"/> <!--Open customer edit page--> <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> <argument name="customerId" value="$createCustomer.id$"/> </actionGroup> <!--Navigate to "Account Information" tab--> <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="openAccountInformationEditPage"/> - <!--Assert that "Main Website" is selected in website selector--> + <!--Verify that "Main Website" is selected in website selector--> <seeOptionIsSelected selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{_defaultWebsite.name}}" stepKey="assertThatMainWebsiteIsSelected"/> - <!--Assert that website selector is disabled--> - <assertElementContainsAttribute stepKey="assertThatWebsiteSelectorIsDisabled"> - <expectedResult selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" attribute="disabled" type="string"/> - </assertElementContainsAttribute> + <!--Change customer website to "Second Website"--> + <actionGroup ref="AdminUpdateCustomerWebsiteInCustomerInformationPageActionGroup" stepKey="updateCustomerWebsite"> + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> + </actionGroup> + <!--Verify that changes are saved successfully--> + <actionGroup ref="AdminSaveCustomerAndAssertSuccessMessage" stepKey="assertThatChangesAreSavedSuccessfully"/> + <!--Open customer edit page--> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage2"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + <!--Navigate to "Account Information" tab--> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="openAccountInformationEditPage2"/> + <!--Verify that "Second Website" is selected in website selector--> + <seeOptionIsSelected selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{NewWebSiteData.name}}" stepKey="assertThatSecondWebsiteIsSelected"/> </test> </tests> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index b60506ab856c4..97ae9a9953eb6 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -190,6 +190,9 @@ <column name="website_id" class="Magento\Customer\Ui\Component\Listing\Column\Websites" component="Magento_Ui/js/grid/columns/select" sortOrder="110"> <settings> <filter>select</filter> + <editor> + <editorType>select</editorType> + </editor> <dataType>select</dataType> <label translate="true">Web Site</label> </settings> diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/website.js b/app/code/Magento/Ui/view/base/web/js/form/element/website.js index 3c99cc0874cf9..0d1ed2d9961a1 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/website.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/website.js @@ -26,10 +26,6 @@ define([ initialize: function () { this._super(); - if (this.customerId || this.isGlobalScope) { - this.disable(true); - } - return this; } }); From 66c3bff0b4c5aff1cfd1dd26bd7719bd622d8862 Mon Sep 17 00:00:00 2001 From: korovitskyi <o.korovitskyi@atwix.com> Date: Tue, 15 Dec 2020 00:04:52 +0200 Subject: [PATCH 475/490] #31168 updated after get list method --- .../Model/Plugin/CustomerPlugin.php | 31 +++++++++++++++++++ .../Newsletter/Model/Plugin/PluginTest.php | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 6c42875f5b32d..d3f8bcb8765c3 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -234,6 +234,37 @@ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInter return $customer; } + /** + * Add subscription status to customer list + * + * @param CustomerRepositoryInterface $subject + * @param SearchResults $searchResults + * @return SearchResults + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $searchResults): SearchResults + { + $customerEmails = []; + + foreach ($searchResults->getItems() as $customer) { + $customerEmails[] = $customer->getEmail(); + } + + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter('subscriber_email', ['in' => $customerEmails]); + + foreach ($searchResults->getItems() as $customer) { + /** @var CustomerExtensionInterface $extensionAttributes */ + $extensionAttributes = $customer->getExtensionAttributes(); + /** @var Subscriber $subscribe */ + $subscribe = $collection->getItemByColumnValue('subscriber_email', $customer->getEmail()); + $isSubscribed = $subscribe && (int) $subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; + $extensionAttributes->setIsSubscribed($isSubscribed); + } + + return $searchResults; + } + /** * Set Is Subscribed extension attribute * diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php index 133d74aec03da..719d78b07ca3c 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php @@ -217,6 +217,10 @@ public function testCustomerWithTwoNewsLetterSubscriptions() /** @var \Magento\Framework\Api\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); $searchCriteria = $searchBuilder->addFilter('entity_id', 1)->create(); - $this->customerRepository->getList($searchCriteria); + $items = $this->customerRepository->getList($searchCriteria)->getItems(); + /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ + $customer = $items[0]; + $extensionAttributes = $customer->getExtensionAttributes(); + $this->assertTrue($extensionAttributes->getIsSubscribed()); } } From bc231ce31a22b9f8120d1a9542a066cbc61ba70a Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 15 Dec 2020 09:56:53 +0200 Subject: [PATCH 476/490] updated testCaseId --- .../Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml index a4f4e006837e1..794d09226d87f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml @@ -14,7 +14,7 @@ <title value="Mass cancel orders in status Complete, Closed"/> <description value="Try to cancel orders in status Complete, Closed"/> <severity value="MAJOR"/> - <testCaseId value="MC-16183"/> + <testCaseId value="MC-39905"/> <group value="sales"/> <group value="mtf_migrated"/> </annotations> From 8752d9ccbc1a5786078bacb23507213b454a5634 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 15 Dec 2020 14:20:55 +0200 Subject: [PATCH 477/490] MC-39531: guest-carts/{cart_id}/items returns incorrect product name on non-default website --- .../Model/Quote/Plugin/UpdateQuoteStoreId.php | 26 ++-- app/code/Magento/Quote/etc/webapi_soap/di.xml | 3 + .../Quote/Api/GuestCartItemRepositoryTest.php | 113 ++++++++++++++---- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php index 4ed347b1eb06d..bffa0084e35bd 100644 --- a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php +++ b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php @@ -8,7 +8,6 @@ namespace Magento\Quote\Model\Quote\Plugin; use Magento\Quote\Model\Quote; -use Magento\Quote\Model\QuoteRepository; use Magento\Store\Model\StoreManagerInterface; /** @@ -16,25 +15,17 @@ */ class UpdateQuoteStoreId { - /** - * @var QuoteRepository - */ - private $quoteRepository; - /** * @var StoreManagerInterface */ private $storeManager; /** - * @param QuoteRepository $quoteRepository * @param StoreManagerInterface $storeManager */ public function __construct( - QuoteRepository $quoteRepository, StoreManagerInterface $storeManager ) { - $this->quoteRepository = $quoteRepository; $this->storeManager = $storeManager; } @@ -42,20 +33,17 @@ public function __construct( * Update store id in requested quote by store id from request. * * @param Quote $subject - * @param null $result - * @return void + * @param Quote $result + * @return Quote * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterLoadByIdWithoutStore( - Quote $subject, - $result - ) { - $quoteStoreId = (int) $subject->getStoreId(); + public function afterLoadByIdWithoutStore(Quote $subject, Quote $result): Quote + { $storeId = $this->storeManager->getStore() ->getId() ?: $this->storeManager->getDefaultStoreView() ->getId(); - if ($storeId !== $quoteStoreId) { - $subject->setStoreId($storeId); - } + $result->setStoreId($storeId); + + return $result; } } diff --git a/app/code/Magento/Quote/etc/webapi_soap/di.xml b/app/code/Magento/Quote/etc/webapi_soap/di.xml index 27d5ff7753425..4b7646b6e1ef3 100644 --- a/app/code/Magento/Quote/etc/webapi_soap/di.xml +++ b/app/code/Magento/Quote/etc/webapi_soap/di.xml @@ -13,4 +13,7 @@ <plugin name="accessControl" type="Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl" /> <plugin name="authorization" type="Magento\Quote\Model\QuoteRepository\Plugin\Authorization" /> </type> + <type name="Magento\Quote\Model\Quote"> + <plugin name="updateQuoteStoreId" type="Magento\Quote\Model\Quote\Plugin\UpdateQuoteStoreId" /> + </type> </config> 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 373ad64ba39d4..1054706819e95 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php @@ -5,8 +5,13 @@ */ namespace Magento\Quote\Api; +use Magento\Catalog\Model\Product; use Magento\CatalogInventory\Api\StockRegistryInterface; use Magento\CatalogInventory\Model\Stock; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteIdMask; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\WebapiAbstract; @@ -40,14 +45,14 @@ protected function setUp(): void */ public function testGetList() { - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id @@ -92,17 +97,17 @@ public function testGetList() */ public function testAddItem() { - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class)->load(2); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class)->load(2); $productSku = $product->getSku(); - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_1', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id @@ -141,20 +146,20 @@ public function testAddItem() */ public function testRemoveItem() { - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id $cartId = $quoteIdMask->getMaskedId(); - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + $product = $this->objectManager->create(Product::class); $productId = $product->getIdBySku('simple_one'); $product->load($productId); $itemId = $quote->getItemByProduct($product)->getId(); @@ -175,7 +180,7 @@ public function testRemoveItem() "itemId" => $itemId, ]; $this->assertTrue($this->_webApiCall($serviceInfo, $requestData)); - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $this->assertFalse($quote->hasProductId($productId)); } @@ -189,20 +194,20 @@ public function testRemoveItem() public function testUpdateItem(array $stockData, string $errorMessage = null) { $this->updateStockData('simple_one', $stockData); - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id $cartId = $quoteIdMask->getMaskedId(); - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + $product = $this->objectManager->create(Product::class); $productId = $product->getIdBySku('simple_one'); $product->load($productId); $itemId = $quote->getItemByProduct($product)->getId(); @@ -229,7 +234,7 @@ public function testUpdateItem(array $stockData, string $errorMessage = null) $this->expectExceptionMessage($errorMessage); } $this->_webApiCall($serviceInfo, $requestData); - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $this->assertTrue($quote->hasProductId(1)); $item = $quote->getItemByProduct($product); @@ -237,6 +242,62 @@ public function testUpdateItem(array $stockData, string $errorMessage = null) $this->assertEquals($itemId, $item->getItemId()); } + /** + * Verifies that store id for quote and quote item is being changed accordingly to the requested store code + * + * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php + * @magentoApiDataFixture Magento/Store/_files/second_store.php + */ + public function testUpdateItemWithChangingStoreId() + { + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); + $quote->load('test_order_item_with_items', 'reserved_order_id'); + $cartId = $quote->getId(); + + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) + ->create(); + $quoteIdMask->load($cartId, 'quote_id'); + $cartId = $quoteIdMask->getMaskedId(); + + $product = $this->objectManager->create(Product::class); + $productId = $product->getIdBySku('simple'); + $product->load($productId); + $itemId = $quote->getItemByProduct($product)->getId(); + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $cartId . '/items/' . $itemId, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + + $requestData['cartItem']['qty'] = 5; + if (TESTS_WEB_API_ADAPTER === self::ADAPTER_SOAP) { + $requestData['cartItem'] += [ + 'quote_id' => $cartId, + 'itemId' => $itemId, + ]; + } + $this->_webApiCall($serviceInfo, $requestData, null, 'fixture_second_store'); + $quote = $this->objectManager->create(Quote::class); + $quote->load('test_order_item_with_items', 'reserved_order_id'); + $this->assertTrue($quote->hasProductId(1)); + $item = $quote->getItemByProduct($product); + /** @var StoreManagerInterface $storeManager */ + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $storeId = $storeManager->getStore('fixture_second_store') + ->getId(); + $this->assertEquals($storeId, $quote->getStoreId()); + $this->assertEquals($storeId, $item->getStoreId()); + } + /** * @return array */ From c2698626c27275a50a248d25092b1b93c9c1b3b3 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 14 Dec 2020 12:16:23 -0600 Subject: [PATCH 478/490] MC-39827: Problem on Coupon Report with splited database - Fix sql error when trying to view coupon report with split database setup --- .../Model/ResourceModel/Report/Rule.php | 5 ++- .../Model/ResourceModel/Report/RuleTest.php | 21 +++++++---- .../Model/ResourceModel/Report/RuleTest.php | 37 +++++++++++++++++++ 3 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/SalesRule/Model/ResourceModel/Report/RuleTest.php diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Report/Rule.php b/app/code/Magento/SalesRule/Model/ResourceModel/Report/Rule.php index fb3f420a325e6..907d2c0494364 100644 --- a/app/code/Magento/SalesRule/Model/ResourceModel/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/ResourceModel/Report/Rule.php @@ -90,8 +90,9 @@ public function aggregate($from = null, $to = null) */ public function getUniqRulesNamesList() { - $connection = $this->getConnection(); - $tableName = $this->getTable('salesrule_coupon_aggregated'); + $resourceModel = $this->_createdatFactory->create(); + $connection = $resourceModel->getConnection(); + $tableName = $resourceModel->getMainTable(); $select = $connection->select()->from( $tableName, new \Zend_Db_Expr('DISTINCT rule_name') diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Report/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Report/RuleTest.php index 1a302747fe454..9cb9767f47932 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Report/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Report/RuleTest.php @@ -7,13 +7,13 @@ namespace Magento\SalesRule\Test\Unit\Model\ResourceModel\Report; -use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Select; use Magento\Framework\DB\Select\SelectRenderer; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Reports\Model\FlagFactory; use Magento\SalesRule\Model\ResourceModel\Report\Rule; +use Magento\SalesRule\Model\ResourceModel\Report\Rule\Createdat; use Magento\SalesRule\Model\ResourceModel\Report\Rule\CreatedatFactory; use Magento\SalesRule\Model\ResourceModel\Report\Rule\UpdatedatFactory; use PHPUnit\Framework\TestCase; @@ -84,14 +84,20 @@ function ($value) { [$this, 'fetchAllCallback'] ); - $resourceMock = $this->createMock(ResourceConnection::class); - $resourceMock->expects($this->any())->method('getConnection')->willReturn($connectionMock); - $resourceMock->expects($this->once())->method('getTableName')->willReturn(self::TABLE_NAME); - $flagFactory = $this->createMock(FlagFactory::class); - $createdatFactoryMock = $this->createPartialMock( + + $createdatResourceModel = $this->createConfiguredMock( + Createdat::class, + [ + 'getConnection' => $connectionMock, + 'getMainTable' => self::TABLE_NAME, + ] + ); + $createdatFactoryMock = $this->createConfiguredMock( CreatedatFactory::class, - ['create'] + [ + 'create' => $createdatResourceModel + ] ); $updatedatFactoryMock = $this->createPartialMock( UpdatedatFactory::class, @@ -102,7 +108,6 @@ function ($value) { $model = $objectHelper->getObject( Rule::class, [ - 'resource' => $resourceMock, 'reportsFlagFactory' => $flagFactory, 'createdatFactory' => $createdatFactoryMock, 'updatedatFactory' => $updatedatFactoryMock diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/ResourceModel/Report/RuleTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/ResourceModel/Report/RuleTest.php new file mode 100644 index 0000000000000..58b82375cfbe9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/ResourceModel/Report/RuleTest.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\SalesRule\Model\ResourceModel\Report; + +use Magento\Sales\Model\Order; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test for salesrule report model + */ +class RuleTest extends TestCase +{ + /** + * @magentoDataFixture Magento/SalesRule/_files/order_with_coupon.php + */ + public function testGetUniqRulesNamesList() + { + $ruleName = uniqid('cart_price_rule_'); + $orderIncrementId = '100000001'; + $objectManager = Bootstrap::getObjectManager(); + /** @var Order $order */ + $order = $objectManager->create(Order::class); + $order->loadByIncrementId($orderIncrementId) + ->setCouponRuleName($ruleName) + ->save(); + /** @var Rule $reportResource */ + $reportResource = $objectManager->create(Rule::class); + $reportResource->aggregate(); + $this->assertContains($ruleName, $reportResource->getUniqRulesNamesList()); + } +} From cece001e28889b66b2b36daf129fa20bf6ef2c17 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 15 Dec 2020 16:46:20 +0200 Subject: [PATCH 479/490] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...uctAttributesFilteredByCodeActionGroup.xml | 35 +++++++++++ .../Test/Mftf/Helper/CatalogHelper.php | 61 +++++++++++++++++++ .../AdminProductAttributeGridSection.xml | 1 + .../Section/AdminDataGridTableSection.xml | 1 + .../Mftf/Data/FixedProductAttributeData.xml | 4 +- .../Weee/Test/Mftf/Data/FrontendLabelData.xml | 15 +++++ 6 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php create mode 100644 app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml new file mode 100644 index 0000000000000..4d4314827da1c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminDeleteAllProductAttributesFilteredByCodeActionGroup"> + <annotations> + <description>Open product attributes grid filter it by attribute code and delete all found attributes one by one.</description> + </annotations> + <arguments> + <argument name="codeFilter" type="string" defaultValue="fake-code"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <!-- It sometimes is loading too long for default 10s --> + <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> + <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> + <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> + <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> + <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> + <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> + <argument name="successMessage">You deleted the product attribute.</argument> + </helper> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFiltersAgain"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php new file mode 100644 index 0000000000000..2ac8ef35dc8a7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Mftf\Helper; + +use Facebook\WebDriver\Remote\RemoteWebDriver as FacebookWebDriver; +use Facebook\WebDriver\WebDriverBy; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; + +/** + * Class for MFTF helpers for Catalog module. + */ +class CatalogHelper extends Helper +{ + /** + * Delete all product attributes one by one. + * + * @param string $firstNotEmptyRow + * @param string $modalAcceptButton + * @param string $deleteButton + * @param string $successMessageContainer + * @param string $successMessage + * @retrun void + */ + public function deleteAllProductAttributesOneByOne( + string $firstNotEmptyRow, + string $modalAcceptButton, + string $deleteButton, + string $successMessageContainer, + string $successMessage + ): void { + try { + /** @var MagentoWebDriver $webDriver */ + $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + /** @var FacebookWebDriver $webDriver */ + $webDriver = $magentoWebDriver->webDriver; + $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + while (!empty($rows)) { + $rows[0]->click(); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->click($deleteButton); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->click($modalAcceptButton); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->waitForLoadingMaskToDisappear(); + $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); + $magentoWebDriver->see($successMessage, $successMessageContainer); + $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + } + } catch (\Exception $e) { + $this->fail($e->getMessage()); + } + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml index e4b33ac795559..295f6da6cf215 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml @@ -17,6 +17,7 @@ <element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/> <element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/> <element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/> + <element name="attributeCodeFilter" type="input" selector=".data-grid-filters input[name='attribute_code']"/> <element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/> <element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//table[@id='attributeGrid_table']//tbody//td[contains(@class,'col-label col-frontend_label')]"/> <element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/> diff --git a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml index c5b000259e265..d2d39076bcfbb 100644 --- a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml +++ b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml @@ -22,5 +22,6 @@ <element name="rowTemplateStrict" type="block" selector="//tbody/tr[td[*[text()[normalize-space()='{{text}}']]]]" parameterized="true" /> <element name="rowTemplate" type="block" selector="//tbody/tr[td[*[contains(.,normalize-space('{{text}}'))]]]" parameterized="true" timeout="30" /> <element name="firstNotEmptyRow" type="block" selector="table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)" timeout="30"/> + <element name="firstNotEmptyRow2" type="block" selector="table.data-grid tbody tr:not(.data-grid-tr-no-data):nth-of-type(1)" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml index b8b45d84242c9..b5736479fac42 100644 --- a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml +++ b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml @@ -9,12 +9,12 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="productFPTAttribute" type="ProductAttribute"> - <data key="attribute_code" unique="suffix">attribute</data> + <data key="attribute_code" unique="suffix">weee_attribute</data> <data key="is_unique">true</data> <data key="frontend_input">weee</data> <data key="is_used_in_grid">true</data> <data key="is_visible_in_grid">true</data> <data key="is_filterable_in_grid">true</data> - <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelWeee</requiredEntity> </entity> </entities> diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml new file mode 100644 index 0000000000000..7c362ba0ee303 --- /dev/null +++ b/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml @@ -0,0 +1,15 @@ +<?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="ProductAttributeFrontendLabelWeee" type="FrontendLabel"> + <data key="store_id">0</data> + <data key="label" unique="suffix">weee-attribute</data> + </entity> +</entities> From f612499f4177ea79f553b13d9e3458e9cdd65a55 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 15 Dec 2020 19:19:40 +0200 Subject: [PATCH 480/490] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...AllProductAttributesFilteredByCodeActionGroup.xml | 2 +- .../Catalog/Test/Mftf/Helper/CatalogHelper.php | 12 +++++------- .../Test/Mftf/Data/FixedProductAttributeData.xml | 11 ++++++++++- .../AdminFixedTaxValSavedForSpecificWebsiteTest.xml | 2 +- .../AdminRemoveProductWeeeAttributeOptionTest.xml | 2 +- ...ionInShoppingCartForCustomerPhysicalQuoteTest.xml | 2 +- ...tionInShoppingCartForCustomerVirtualQuoteTest.xml | 2 +- ...mationInShoppingCartForGuestPhysicalQuoteTest.xml | 2 +- ...rmationInShoppingCartForGuestVirtualQuoteTest.xml | 2 +- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index 4d4314827da1c..12249d6cb946b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -22,7 +22,7 @@ <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> - <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> + <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php index 2ac8ef35dc8a7..f72a41b46298e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -28,7 +28,7 @@ class CatalogHelper extends Helper * @retrun void */ public function deleteAllProductAttributesOneByOne( - string $firstNotEmptyRow, + string $notEmptyRow, string $modalAcceptButton, string $deleteButton, string $successMessageContainer, @@ -39,20 +39,18 @@ public function deleteAllProductAttributesOneByOne( $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); /** @var FacebookWebDriver $webDriver */ $webDriver = $magentoWebDriver->webDriver; - $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); - while (!empty($rows)) { - $rows[0]->click(); + $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); + while (!empty($gridRows)) { + $gridRows[0]->click(); $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->click($deleteButton); $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); - $magentoWebDriver->waitForPageLoad(60); $magentoWebDriver->click($modalAcceptButton); $magentoWebDriver->waitForPageLoad(60); - $magentoWebDriver->waitForLoadingMaskToDisappear(); $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); $magentoWebDriver->see($successMessage, $successMessageContainer); - $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); } } catch (\Exception $e) { $this->fail($e->getMessage()); diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml index b5736479fac42..071f96bb65266 100644 --- a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml +++ b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml @@ -8,7 +8,16 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="productFPTAttribute" type="ProductAttribute"> + <entity name="productFPTAttribute" type="ProductAttribute" deprecated="Use FPTProductAttribute instead"> + <data key="attribute_code" unique="suffix">attribute</data> + <data key="is_unique">true</data> + <data key="frontend_input">weee</data> + <data key="is_used_in_grid">true</data> + <data key="is_visible_in_grid">true</data> + <data key="is_filterable_in_grid">true</data> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity> + </entity> + <entity name="FPTProductAttribute" type="ProductAttribute"> <data key="attribute_code" unique="suffix">weee_attribute</data> <data key="is_unique">true</data> <data key="frontend_input">weee</data> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index 0f4a7f9a55d26..ccbd431848dbc 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -22,7 +22,7 @@ <before> <!-- Create product attribute and add it to default attribute set />--> <comment userInput="Create product attribute and add it to default attribute set" stepKey="createAttrAndAddToDefaultAttrSet"/> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addToDefaultAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml index 0d7c21b6efffc..4e70c9ba87d64 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml @@ -18,7 +18,7 @@ <group value="weee"/> </annotations> <before> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index e78036458301b..833f619888bfb 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml index dda125835110a..8e8667cb7e13d 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index 74ba7c1f2bff3..3a3f9c7e8931a 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 495b9a990a465..0d54991f84395 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> From ad5f3fa48e0402702d0b1339f8737028dc8aa27c Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 11:36:31 +0200 Subject: [PATCH 481/490] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Observer/EmulateCustomerObserver.php | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index 8429eabd19e8a..0b978b9822345 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -6,6 +6,7 @@ namespace Magento\Persistent\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\NoSuchEntityException; /** * Class EmulateCustomer @@ -86,9 +87,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ $customer = $this->customerRepository->getById($this->_persistentSession->getSession()->getCustomerId()); if ($defaultShipping = $customer->getDefaultShipping()) { - /** @var \Magento\Customer\Model\Data\Address $address */ - $address = $this->addressRepository->getById($defaultShipping); - if ($address) { + $address = $this->getCustomerAddressById($defaultShipping); + + if ($address !== null) { $this->_customerSession->setDefaultTaxShippingAddress( [ 'country_id' => $address->getCountryId(), @@ -102,8 +103,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->addressRepository->getById($defaultBilling); - if ($address) { + $address = $this->getCustomerAddressById($defaultShipping); + + if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ 'country_id' => $address->getCountryId(), 'region_id' => $address->getRegion() ? $address->getRegionId() : null, @@ -118,4 +120,19 @@ public function execute(\Magento\Framework\Event\Observer $observer) } return $this; } + + /** + * Returns customer address by id + * + * @param int $addressId + * @return \Magento\Customer\Api\Data\AddressInterface|null + */ + private function getCustomerAddressById($addressId) + { + try { + return $this->addressRepository->getById($addressId); + } catch (NoSuchEntityException $exception) { + return null; + } + } } From b2508014d7da9ef4019214a44dcd9c1447397f0e Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 16 Dec 2020 11:55:49 +0200 Subject: [PATCH 482/490] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...nDeleteAllProductAttributesFilteredByCodeActionGroup.xml | 2 +- app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php | 6 +++--- .../Test/Mftf/Section/AdminProductAttributeGridSection.xml | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index 12249d6cb946b..fe5b0ae1a64ce 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -19,7 +19,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> - <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php index f72a41b46298e..dcba3b1bf68de 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -20,7 +20,7 @@ class CatalogHelper extends Helper /** * Delete all product attributes one by one. * - * @param string $firstNotEmptyRow + * @param string $notEmptyRow * @param string $modalAcceptButton * @param string $deleteButton * @param string $successMessageContainer @@ -45,10 +45,10 @@ public function deleteAllProductAttributesOneByOne( $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->click($deleteButton); $magentoWebDriver->waitForPageLoad(30); - $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->waitForElementVisible($modalAcceptButton); $magentoWebDriver->click($modalAcceptButton); $magentoWebDriver->waitForPageLoad(60); - $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); + $magentoWebDriver->waitForElementVisible($successMessageContainer); $magentoWebDriver->see($successMessage, $successMessageContainer); $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); } diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml index 295f6da6cf215..e4b33ac795559 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml @@ -17,7 +17,6 @@ <element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/> <element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/> <element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/> - <element name="attributeCodeFilter" type="input" selector=".data-grid-filters input[name='attribute_code']"/> <element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/> <element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//table[@id='attributeGrid_table']//tbody//td[contains(@class,'col-label col-frontend_label')]"/> <element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/> From b4a14812aff90e5658a9cd6570ba0c2b66d29260 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:59:34 +0200 Subject: [PATCH 483/490] update testCaseId --- .../Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml index 95607a83dd26f..d5dcd7f48b956 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml @@ -13,6 +13,7 @@ <stories value="Create product"/> <title value="Create Grouped Product when non-default attribute set is chosen"/> <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <testCaseId value="MC-39950"/> <severity value="MAJOR"/> <group value="groupedProduct"/> </annotations> From 3bb857f8d60e45a40931bb99085c7d8f841ce922 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 14:44:52 +0200 Subject: [PATCH 484/490] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Magento/Persistent/Observer/EmulateCustomerObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index 0b978b9822345..c991836a287d2 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -103,7 +103,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->getCustomerAddressById($defaultShipping); + $address = $this->getCustomerAddressById($defaultBilling); if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ From 92ecbbfeabd9edd0b137915f61bbacfa123a7e8e Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 17:21:05 +0200 Subject: [PATCH 485/490] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Magento/Persistent/Observer/EmulateCustomerObserver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index c991836a287d2..1ff81137de57b 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -87,7 +87,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ $customer = $this->customerRepository->getById($this->_persistentSession->getSession()->getCustomerId()); if ($defaultShipping = $customer->getDefaultShipping()) { - $address = $this->getCustomerAddressById($defaultShipping); + $address = $this->getCustomerAddressById((int) $defaultShipping); if ($address !== null) { $this->_customerSession->setDefaultTaxShippingAddress( @@ -103,7 +103,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->getCustomerAddressById($defaultBilling); + $address = $this->getCustomerAddressById((int) $defaultBilling); if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ @@ -127,7 +127,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) * @param int $addressId * @return \Magento\Customer\Api\Data\AddressInterface|null */ - private function getCustomerAddressById($addressId) + private function getCustomerAddressById(int $addressId) { try { return $this->addressRepository->getById($addressId); From 3ce3b50dcb755a12a512f5df011f6754cb5d1acb Mon Sep 17 00:00:00 2001 From: ruslankostiv <rkostiv@adobe.com> Date: Wed, 16 Dec 2020 16:47:51 -0600 Subject: [PATCH 486/490] SFAPP-188: ComposetTest fails on blacklisted modules --- .../testsuite/Magento/Test/Integrity/ComposerTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 1c0f451de71dc..f57a29e9bda0d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -266,8 +266,10 @@ private function assertAutoloadRegistrar(\StdClass $json, $dir) */ private function assertNoVersionSpecified(\StdClass $json) { - $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git'; - $this->assertObjectNotHasAttribute('version', $json, $errorMessage); + if (!in_array($json->name, self::$rootComposerModuleBlacklist)) { + $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git'; + $this->assertObjectNotHasAttribute('version', $json, $errorMessage); + } } /** From 80fee6d722839ed48963ebfd16bff99167ebcad8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transogtgroup.com> Date: Thu, 17 Dec 2020 15:50:46 +0200 Subject: [PATCH 487/490] MC-38822: stabilising test --- ...efrontAssertFixedCartDiscountAmountForBundleProductTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 65c8a4416c1a1..2a735fd196e76 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -18,6 +18,9 @@ <testCaseId value="MC-39480"/> </annotations> <before> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCatalogInventory"> + <argument name="indices" value="cataloginventory_stock"/> + </actionGroup> <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> </before> From c2c9b3684b410e76e0e29ece21997ea96e2727e9 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transogtgroup.com> Date: Thu, 17 Dec 2020 17:43:23 +0200 Subject: [PATCH 488/490] MC-38822: stabilising test --- ...frontAssertFixedCartDiscountAmountForBundleProductTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 2a735fd196e76..42e6d9e1d5b09 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -18,11 +18,11 @@ <testCaseId value="MC-39480"/> </annotations> <before> + <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> + <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCatalogInventory"> <argument name="indices" value="cataloginventory_stock"/> </actionGroup> - <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> - <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> </before> <after> <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> From 7448e601404e849b2902556bd4e338a19f873bb6 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 16 Dec 2020 11:24:36 +0200 Subject: [PATCH 489/490] Fix length for additional column --- .../Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php index 96d9865998131..55e9924eb7fa0 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php @@ -66,7 +66,7 @@ public function processColumnForCLTable(Table $table, string $columnName): void $table->addColumn( $columnName, \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - null, + 255, ['unsigned' => true, 'nullable' => true, 'default' => null], $columnName ); From 59b446956348c8fdb421a1c61174cee018122fda Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Fri, 18 Dec 2020 15:13:00 +0200 Subject: [PATCH 490/490] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Test/Unit/Observer/EmulateCustomerObserverTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php index 6c35ade65451b..2df36577b2931 100644 --- a/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php @@ -131,14 +131,14 @@ public function testExecuteWhenSessionPersistAndCustomerNotLoggedIn() $customerMock ->expects($this->once()) ->method('getDefaultShipping') - ->willReturn('shippingId'); + ->willReturn(12345); $customerMock ->expects($this->once()) ->method('getDefaultBilling') - ->willReturn('billingId'); + ->willReturn(12346); $valueMap = [ - ['shippingId', $defaultShippingAddressMock], - ['billingId', $defaultBillingAddressMock] + [12345, $defaultShippingAddressMock], + [12346, $defaultBillingAddressMock] ]; $this->addressRepositoryMock->expects($this->any())->method('getById')->willReturnMap($valueMap); $this->customerSessionMock