From dcc6381a921ee5225e46ef05b6d9e2386e663a1c Mon Sep 17 00:00:00 2001 From: Shawn Abramson Date: Mon, 13 Apr 2020 11:23:49 -0400 Subject: [PATCH 001/155] 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/155] 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/155] 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/155] 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/155] 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/155] 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 11ccb291f24c23b6c2602bfcdc44c096ada7e14b Mon Sep 17 00:00:00 2001 From: Matias Hidalgo Date: Fri, 21 Aug 2020 16:22:41 -0300 Subject: [PATCH 007/155] 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 008/155] 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 009/155] 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 010/155] 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 e7cde72591b81895e8b02e1de3e8f88a4ede80b1 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 9 Sep 2020 13:14:54 +0300 Subject: [PATCH 011/155] 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 012/155] 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 1bf790a4ca2be7fa255c8173132bb47134021def Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 11 Sep 2020 14:59:05 +0300 Subject: [PATCH 013/155] 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 cc0c94263c7c73e8f84adaa5ea0045211f5e76b7 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Tue, 29 Sep 2020 11:16:17 +0300 Subject: [PATCH 014/155] 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 @@ -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 @@ -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 @@ +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 @@ */ --> - + 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 @@ - + From 74709d2e4fcaec39fd1726c005e0efe69d0992a8 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Tue, 29 Sep 2020 12:32:47 +0300 Subject: [PATCH 015/155] 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 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 016/155] 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 2716339b3c3c97e9af35ef6aecaf634b1fce8f8d Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 28 Oct 2020 17:25:55 -0500 Subject: [PATCH 017/155] 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 @@ +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 @@ +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 @@ + + + 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 @@ + + + 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 @@ --> + 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 @@ + + + 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 @@ + From 47d016b09da639508939187506300bf47f3e1e10 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 29 Oct 2020 10:45:55 -0500 Subject: [PATCH 018/155] 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 Date: Thu, 29 Oct 2020 10:48:16 -0500 Subject: [PATCH 019/155] 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 Date: Thu, 29 Oct 2020 10:49:56 -0500 Subject: [PATCH 020/155] 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 Date: Thu, 29 Oct 2020 17:16:29 -0500 Subject: [PATCH 021/155] 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 @@ + + + Magento\Catalog\CategoryImageUpload + + 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 a72c0431710c8136b185b17dea059217dee49b53 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 2 Nov 2020 14:54:37 -0600 Subject: [PATCH 022/155] 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 986ac9904fd303ddc6025caed33863a32e6e2242 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 2 Nov 2020 15:48:07 -0600 Subject: [PATCH 023/155] 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 024/155] 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 Date: Tue, 3 Nov 2020 06:35:29 -0600 Subject: [PATCH 025/155] 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 @@ - - - Magento\Catalog\CategoryImageUpload - - From 09655eb97e40757b46d6efa596294143bd0a4eea Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Tue, 3 Nov 2020 06:45:48 -0600 Subject: [PATCH 026/155] 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 Date: Tue, 3 Nov 2020 07:07:17 -0600 Subject: [PATCH 027/155] 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 @@ + + + + + + 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 @@ 1 0 + + sales.rule.update.coupon.usage + 100 + From fbad9a1e8d953f9424bea28492e77ebc663a7e8f Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Tue, 3 Nov 2020 10:26:59 -0600 Subject: [PATCH 028/155] 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 @@ - - + + From 79a82bb212b5b8e274b75d52c815844dbc12b417 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 5 Nov 2020 16:02:13 -0600 Subject: [PATCH 029/155] 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 @@ 1 0 - - sales.rule.update.coupon.usage - 100 - From 895f88bdb193ab3aff733764527e6614a3240f93 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 5 Nov 2020 17:11:36 -0600 Subject: [PATCH 030/155] 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 @@ - - - - - + + From ef7d78ff7b4cda909c0fe7d8e9c35a2b609a2f60 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Fri, 6 Nov 2020 08:41:00 -0600 Subject: [PATCH 031/155] 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 @@ + + + From f5d692ffa6c1e81f9528686a20cfa556677b0fd5 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 6 Nov 2020 17:20:30 +0100 Subject: [PATCH 032/155] 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 Date: Fri, 6 Nov 2020 11:21:16 -0600 Subject: [PATCH 033/155] 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 @@ + + + From e39d6e93b01a7b88dc7f13c4968f21fb6a714daf Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Fri, 6 Nov 2020 11:44:03 -0600 Subject: [PATCH 034/155] 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 @@ + + + + + - - - From 01ee9ea91b73ffe83452a4fe4fc2011163a3afdb Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Fri, 6 Nov 2020 15:25:41 -0600 Subject: [PATCH 035/155] 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 @@ - + - + From 83e45ae5fd20f8aa167c970bf4b25eb0cde9df98 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 9 Nov 2020 13:52:49 -0600 Subject: [PATCH 036/155] 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 @@ - - - @@ -50,10 +47,6 @@ - - - - @@ -70,7 +63,6 @@ - From 1143af933f5cf6ab4a2c49d583fb3cd0a1c46c02 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 9 Nov 2020 13:54:07 -0600 Subject: [PATCH 037/155] 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 @@ + + From a8c96887994a53e0503f49a64a689fcd76d69c7b Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 9 Nov 2020 17:08:04 -0600 Subject: [PATCH 038/155] 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 @@ 10.00 - + @@ -62,14 +62,18 @@ - + + + + - + - + + From 396ab4de86c1fcd9952c691a29d5a01acd208e79 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 9 Nov 2020 17:08:22 -0600 Subject: [PATCH 039/155] 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 @@ + + + + + + sales.rule.update.coupon.usage + 100 + + From b77d2296a68b16fd8a102b1216de5803293486cd Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 9 Nov 2020 17:11:11 -0600 Subject: [PATCH 040/155] 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 @@ - + + + + + Date: Wed, 11 Nov 2020 12:38:12 +0200 Subject: [PATCH 041/155] 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 @@ + '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" Date: Wed, 11 Nov 2020 14:22:18 +0200 Subject: [PATCH 042/155] 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 c93616132bc8c3e0d934e217ab98f83607cf04b2 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Thu, 12 Nov 2020 10:58:58 +0200 Subject: [PATCH 043/155] 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 5512626bfdfdede24ded8095998c647092d60ebb Mon Sep 17 00:00:00 2001 From: Lachlan Turner Date: Fri, 13 Nov 2020 10:04:38 +1030 Subject: [PATCH 044/155] 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 @@ +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 @@ +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 8fcac9d9bd81270a717f5311f774850a42980d5a Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Fri, 13 Nov 2020 14:39:07 +0200 Subject: [PATCH 045/155] 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 @@ + [ + '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 e8294f84c1fde1072fecf197eee71737be7faf29 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Mon, 16 Nov 2020 11:42:50 +0200 Subject: [PATCH 046/155] 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 Date: Fri, 23 Oct 2020 16:30:49 +0200 Subject: [PATCH 047/155] 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 b65b86c6497686fed0316a1af45ede3cdc567f57 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 16 Nov 2020 17:27:38 -0600 Subject: [PATCH 048/155] 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 3c9341e0f6716aad5585cea50e88df387b7054f9 Mon Sep 17 00:00:00 2001 From: Andrii Dimov Date: Mon, 16 Nov 2020 23:50:51 -0600 Subject: [PATCH 049/155] 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 @@ admin_password - ${__P(admin_password,123123q)} + ${__P(admin_password,)} = @@ -436,7 +436,7 @@ customer_password - ${__P(customer_password,123123q)} + ${__P(customer_password,)} = @@ -775,7 +775,7 @@ - mpaf/tool/fragments/ce/view_results_tree.jmx + tool/fragments/ce/view_results_tree.jmx @@ -810,7 +810,7 @@ /tmp/aggregate-jmeter-results.jtl - mpaf/tool/fragments/ce/aggregate_report.jmx + tool/fragments/ce/aggregate_report.jmx @@ -826,7 +826,7 @@ Java 4 - mpaf/tool/fragments/ce/http_request_default.jmx + tool/fragments/ce/http_request_default.jmx @@ -848,7 +848,7 @@ gzip, deflate - mpaf/tool/fragments/ce/http_header_manager.jmx + tool/fragments/ce/http_header_manager.jmx @@ -864,7 +864,7 @@ false - mpaf/tool/fragments/ce/setup/setup.jmx + tool/fragments/ce/setup/setup.jmx @@ -888,7 +888,7 @@ true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -918,7 +918,7 @@ props.put("environment", environment); false - mpaf/tool/fragments/ce/setup/initialize.jmx + tool/fragments/ce/setup/initialize.jmx @@ -942,7 +942,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr false - mpaf/tool/fragments/ce/setup/validate_user_defined_variables.jmx + tool/fragments/ce/setup/validate_user_defined_variables.jmx @@ -1046,7 +1046,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr Java false - mpaf/tool/fragments/ce/setup/login.jmx + tool/fragments/ce/setup/login.jmx @@ -1071,7 +1071,7 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr - mpaf/tool/fragments/ce/setup/extract_admin_users.jmx + tool/fragments/ce/setup/extract_admin_users.jmx @@ -1129,52 +1129,10 @@ if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substr - mpaf/tool/fragments/ce/setup/extract_customers.jmx + tool/fragments/ce/setup/extract_customers.jmx - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/ - GET - true - false - true - false - false - - - - - - - true - 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); - - - - - Customers - <title>Customers / Customers / Magento Admin</title> - - Assertion.response_data - false - 2 - - - - + @@ -1265,8 +1223,6 @@ manager.add(cookie); - 60000 - 200000 ${request_protocol} ${base_path}${admin_path}/mui/index/render/ @@ -1275,113 +1231,45 @@ manager.add(cookie); false true false - false + 60000 + 200000 - - $.totalRecords - 0 - true - false - true - true - - - - customer_emails - $.items[*].email - - - BODY - - - - customer_ids - $.items[*].entity_id - - - BODY - - - - false + + groovy - import java.util.LinkedList; -LinkedList emailsList = new LinkedList(); -props.put("customer_emails_list", emailsList); - - - - - customer_emails - customer_email - true - - - - 1 - - 1 - email_counter - - false - - - - -try { + true + 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); -} - - - - false - - - - - customer_ids - customer_id - true - - - - 1 - - 1 - id_counter - - false - - - - 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")); - - - false - + +props.put("customer_emails_list", emailsList); +props.put("customer_ids_list", idsList); +// +log.info("Cust IDs: " + idsList); +log.info("Emails: " + emailsList); + + - mpaf/tool/fragments/ce/setup/extract_region_ids.jmx + tool/fragments/ce/setup/extract_region_ids.jmx @@ -1434,7 +1322,7 @@ regionResponse.each { region -> - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -1448,7 +1336,7 @@ regionResponse.each { region -> */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -1476,7 +1364,7 @@ regionResponse.each { region -> false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -1506,7 +1394,7 @@ regionResponse.each { region -> Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -1544,7 +1432,7 @@ regionResponse.each { region -> false false - mpaf/tool/fragments/ce/setup/get_cms_pages.jmx + tool/fragments/ce/setup/get_cms_pages.jmx @@ -1577,139 +1465,97 @@ props.put("cms_pages", cmsPages); - mpaf/tool/fragments/ce/setup/extract_configurable_products.jmx + tool/fragments/ce/setup/extract_configurable_products.jmx - - - - - true - type_id - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - configurable - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - ${configurable_products_count} - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - false - - - - - false - configurable_products_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_ids - \"id\":(\d+),\"sku\" - $1$ - - -1 - - - - false - configurable_product_names - name\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_skus - sku\":\"(.*?)\" - $1$ - - -1 - - - - - - configurable_product_ids - configurable_product_id - true - + + + + + true + type_id + = + true + searchCriteria[filterGroups][0][filters][0][field] + + + true + configurable + = + true + searchCriteria[filterGroups][0][filters][0][value] + + + true + ${configurable_products_count} + = + true + searchCriteria[pageSize] + + + + + + ${request_protocol} + + ${base_path}rest/V1/products + GET + true + false + true + false + + 60000 + 200000 + - - 1 - - 1 - configurable_products_counter - - false - - - - import java.util.ArrayList; -import java.util.HashMap; + + groovy + + + true + 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); - - - false - +log.info("Products: " + productList); + + + + + + + - mpaf/tool/fragments/ce/setup/extract_configurable_products_for_edit.jmx + tool/fragments/ce/setup/extract_configurable_products_for_edit.jmx @@ -1847,7 +1693,7 @@ editProductList.add(editProductMap); - mpaf/tool/fragments/ce/setup/extract_simple_products.jmx + tool/fragments/ce/setup/extract_simple_products.jmx @@ -1992,7 +1838,7 @@ productList.add(productMap); - mpaf/tool/fragments/ce/setup/extract_simple_products_for_edit.jmx + tool/fragments/ce/setup/extract_simple_products_for_edit.jmx @@ -2144,7 +1990,7 @@ editProductList.add(editProductMap); - mpaf/tool/fragments/ce/setup/extract_categories.jmx + tool/fragments/ce/setup/extract_categories.jmx @@ -2244,7 +2090,7 @@ props.put("category_names_list",categoryNames); - mpaf/tool/fragments/ce/setup/extract_categories_id_of_last_level.jmx + tool/fragments/ce/setup/extract_categories_id_of_last_level.jmx @@ -2352,7 +2198,7 @@ adminCategoryIdsList.add(vars.get("category_id")); - mpaf/tool/fragments/ce/setup/extract_coupon_codes.jmx + tool/fragments/ce/setup/extract_coupon_codes.jmx @@ -2441,7 +2287,7 @@ if (props.get("cms_pages") == null) { false - mpaf/tool/fragments/ce/setup/validate_properties.jmx + tool/fragments/ce/setup/validate_properties.jmx @@ -2491,7 +2337,7 @@ if (props.get("cms_pages") == null) { false false - mpaf/tool/fragments/ce/setup/warmup_add_to_cart.jmx + tool/fragments/ce/setup/warmup_add_to_cart.jmx @@ -2508,7 +2354,7 @@ if (props.get("cms_pages") == null) { false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx javascript @@ -2531,7 +2377,7 @@ function doCache(){ } } - mpaf/tool/fragments/ce/common/cache_hit_miss.jmx + tool/fragments/ce/common/cache_hit_miss.jmx @@ -2539,7 +2385,7 @@ function doCache(){ false 1 ${browseCatalogByCustomerPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -2555,7 +2401,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -2587,11 +2433,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -2670,7 +2516,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -2730,7 +2576,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -2823,7 +2669,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -2854,7 +2700,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -2891,7 +2737,7 @@ vars.put("customer_email", customerUser); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -2921,7 +2767,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -2942,7 +2788,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -2959,7 +2805,7 @@ vars.put("product_sku", product.get("sku")); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -2989,7 +2835,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -3010,7 +2856,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -3042,7 +2888,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -3062,7 +2908,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -3073,7 +2919,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${browseCatalogByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -3089,7 +2935,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -3121,11 +2967,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -3178,7 +3024,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -3209,7 +3055,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -3246,7 +3092,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -3276,7 +3122,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -3297,7 +3143,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -3314,7 +3160,7 @@ vars.put("product_sku", product.get("sku")); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -3344,7 +3190,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -3365,7 +3211,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -3386,7 +3232,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${siteSearchPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -3402,7 +3248,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -3421,7 +3267,7 @@ if (testLabel true false shareMode.thread - mpaf/tool/fragments/ce/search/search_terms.jmx + tool/fragments/ce/search/search_terms.jmx @@ -3445,7 +3291,7 @@ function doCache(){ } } - mpaf/tool/fragments/ce/common/cache_hit_miss.jmx + tool/fragments/ce/common/cache_hit_miss.jmx @@ -3453,7 +3299,7 @@ function doCache(){ false 1 ${searchQuickPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -3469,7 +3315,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -3501,7 +3347,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -3522,7 +3368,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -3561,7 +3407,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_quick.jmx + tool/fragments/ce/search/search_quick.jmx @@ -3596,7 +3442,7 @@ if (testLabel "${isPageCacheable}" != "0" false - mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx + tool/fragments/ce/search/if_page_cacheable_controller.jmx @@ -3624,7 +3470,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_terms_log_save.jmx + tool/fragments/ce/search/search_terms_log_save.jmx @@ -3652,13 +3498,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -3672,7 +3518,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -3703,7 +3549,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -3724,7 +3570,7 @@ vars.put("product_url_key", product); false 1 ${searchQuickFilterPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -3740,7 +3586,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -3772,7 +3618,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -3793,7 +3639,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -3832,7 +3678,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_quick_filter.jmx + tool/fragments/ce/search/search_quick_filter.jmx @@ -3894,7 +3740,7 @@ if (testLabel "${isPageCacheable}" != "0" false - mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx + tool/fragments/ce/search/if_page_cacheable_controller.jmx @@ -3922,7 +3768,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_terms_log_save.jmx + tool/fragments/ce/search/search_terms_log_save.jmx @@ -3940,7 +3786,7 @@ if (testLabel ${attribute_1_options_count} > 0 false - mpaf/tool/fragments/ce/search/search_quick_filter-first-attribute.jmx + tool/fragments/ce/search/search_quick_filter-first-attribute.jmx vars.put("search_url", vars.get("attribute_1_filter_url")); @@ -4012,7 +3858,7 @@ if (testLabel ${attribute_2_options_count} > 0 false - mpaf/tool/fragments/ce/search/search_quick_filter-second-attribute.jmx + tool/fragments/ce/search/search_quick_filter-second-attribute.jmx vars.put("search_url", vars.get("attribute_2_filter_url")); @@ -4076,13 +3922,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -4096,7 +3942,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -4127,7 +3973,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -4148,7 +3994,7 @@ vars.put("product_url_key", product); false 1 ${searchAdvancedPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -4164,7 +4010,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -4196,7 +4042,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -4217,7 +4063,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -4249,7 +4095,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/open_advanced_search_page.jmx + tool/fragments/ce/search/open_advanced_search_page.jmx @@ -4360,7 +4206,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_advanced.jmx + tool/fragments/ce/search/search_advanced.jmx @@ -4395,13 +4241,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -4415,7 +4261,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -4446,7 +4292,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -4469,7 +4315,7 @@ vars.put("product_url_key", product); false 1 ${addToCartByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -4485,7 +4331,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -4517,11 +4363,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -4539,7 +4385,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -4564,7 +4410,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -4585,7 +4431,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -4616,7 +4462,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -4653,7 +4499,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -4683,11 +4529,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -4718,7 +4564,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -4778,7 +4624,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -4787,7 +4633,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -4831,7 +4677,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -4868,7 +4714,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -4876,7 +4722,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -4906,11 +4752,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -4941,7 +4787,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -4957,7 +4803,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -5114,7 +4960,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -5143,7 +4989,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -5153,7 +4999,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -5197,7 +5043,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -5234,7 +5080,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -5246,7 +5092,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${addToWishlistPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -5262,7 +5108,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -5294,11 +5140,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -5317,11 +5163,11 @@ vars.putObject("randomIntGenerator", random); get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -5359,7 +5205,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -5419,7 +5265,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -5497,7 +5343,7 @@ vars.put("customer_email", customerUser); true 5 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -5527,7 +5373,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -5548,7 +5394,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -5602,7 +5448,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/wishlist/add_to_wishlist.jmx + tool/fragments/ce/wishlist/add_to_wishlist.jmx @@ -5664,7 +5510,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/wishlist/load_wishlist_section.jmx + tool/fragments/ce/wishlist/load_wishlist_section.jmx @@ -5686,7 +5532,7 @@ vars.put("product_sku", product.get("sku")); wishListItems wishListItem true - mpaf/tool/fragments/ce/wishlist/clear_wishlist.jmx + tool/fragments/ce/wishlist/clear_wishlist.jmx 1 @@ -5754,7 +5600,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -5774,7 +5620,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -5785,7 +5631,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${compareProductsPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -5801,7 +5647,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -5833,11 +5679,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -5855,7 +5701,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -5880,7 +5726,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -5901,7 +5747,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/product_compare/open_category.jmx + tool/fragments/ce/product_compare/open_category.jmx @@ -5937,7 +5783,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -5967,11 +5813,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6002,7 +5848,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -6055,7 +5901,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx + tool/fragments/ce/product_compare/product_compare_add.jmx @@ -6098,7 +5944,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx + tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx @@ -6115,7 +5961,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -6145,11 +5991,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6180,7 +6026,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -6233,7 +6079,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx + tool/fragments/ce/product_compare/product_compare_add.jmx @@ -6276,7 +6122,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx + tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx @@ -6308,14 +6154,14 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/compare_products.jmx + tool/fragments/ce/product_compare/compare_products.jmx 1 0 ${__javaScript(Math.round(${productCompareDelay}*1000))} - mpaf/tool/fragments/ce/product_compare/compare_products_pause.jmx + tool/fragments/ce/product_compare/compare_products_pause.jmx @@ -6344,7 +6190,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/compare_products_clear.jmx + tool/fragments/ce/product_compare/compare_products_clear.jmx @@ -6354,7 +6200,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${checkoutByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -6370,7 +6216,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -6402,11 +6248,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -6424,7 +6270,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -6449,7 +6295,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -6470,7 +6316,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -6501,7 +6347,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -6538,7 +6384,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -6568,11 +6414,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6603,7 +6449,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -6663,7 +6509,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -6672,7 +6518,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -6716,7 +6562,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -6753,7 +6599,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -6761,7 +6607,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -6791,11 +6637,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -6826,7 +6672,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -6842,7 +6688,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -6999,7 +6845,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -7028,7 +6874,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -7038,7 +6884,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -7082,7 +6928,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -7119,13 +6965,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx @@ -7158,7 +7004,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_start.jmx + tool/fragments/ce/guest_checkout/checkout_start.jmx @@ -7225,7 +7071,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_email_available.jmx + tool/fragments/ce/guest_checkout/checkout_email_available.jmx @@ -7284,7 +7130,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx + tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx @@ -7343,7 +7189,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx + tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx @@ -7402,7 +7248,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx + tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx @@ -7473,7 +7319,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_success.jmx + tool/fragments/ce/guest_checkout/checkout_success.jmx @@ -7495,7 +7341,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${checkoutByCustomerPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -7511,7 +7357,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -7543,11 +7389,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -7565,7 +7411,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -7590,16 +7436,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -7637,7 +7483,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -7668,7 +7514,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -7728,7 +7574,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -7821,7 +7667,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -7858,7 +7704,7 @@ vars.put("customer_email", customerUser); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -7888,11 +7734,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -7923,7 +7769,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -7983,7 +7829,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -7992,7 +7838,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -8036,7 +7882,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -8073,7 +7919,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -8081,7 +7927,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -8111,11 +7957,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -8146,7 +7992,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -8162,7 +8008,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -8319,7 +8165,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -8348,7 +8194,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -8358,7 +8204,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -8402,7 +8248,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -8439,13 +8285,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx @@ -8478,7 +8324,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_start.jmx + tool/fragments/ce/customer_checkout/checkout_start.jmx @@ -8585,7 +8431,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx + tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx @@ -8644,7 +8490,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx + tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx @@ -8703,7 +8549,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx + tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx @@ -8755,7 +8601,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_success.jmx + tool/fragments/ce/customer_checkout/checkout_success.jmx @@ -8788,7 +8634,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -8810,7 +8656,7 @@ if(curSampler.getName().contains("Checkout success")) { manager.clear(); } - mpaf/tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx + tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx @@ -8821,7 +8667,7 @@ if(curSampler.getName().contains("Checkout success")) { customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -8832,7 +8678,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${reviewByCustomerPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -8848,7 +8694,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -8880,11 +8726,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -8903,11 +8749,11 @@ vars.putObject("randomIntGenerator", random); get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -8945,7 +8791,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -9005,7 +8851,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -9083,7 +8929,7 @@ vars.put("customer_email", customerUser); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -9113,7 +8959,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -9134,7 +8980,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -9208,7 +9054,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_review/product_review.jmx + tool/fragments/ce/product_review/product_review.jmx @@ -9261,14 +9107,14 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_review/load_review.jmx + tool/fragments/ce/product_review/load_review.jmx 1 0 ${__javaScript(Math.round(${reviewDelay}*1000))} - mpaf/tool/fragments/ce/product_review/product_review_pause.jmx + tool/fragments/ce/product_review/product_review_pause.jmx @@ -9290,7 +9136,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -9310,7 +9156,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -9321,7 +9167,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${addToCartByCustomerPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -9337,7 +9183,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -9369,11 +9215,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -9391,7 +9237,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -9416,16 +9262,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -9463,7 +9309,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -9523,7 +9369,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -9616,7 +9462,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -9647,7 +9493,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -9684,7 +9530,7 @@ vars.put("customer_email", customerUser); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -9714,11 +9560,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -9749,7 +9595,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -9809,7 +9655,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -9818,7 +9664,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -9862,7 +9708,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -9899,7 +9745,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -9907,7 +9753,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -9937,11 +9783,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -9972,7 +9818,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -9988,7 +9834,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -10145,7 +9991,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -10174,7 +10020,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -10184,7 +10030,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -10228,7 +10074,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -10265,13 +10111,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -10292,7 +10138,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/open_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/open_cart.jmx @@ -10317,7 +10163,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true ${cart_items_qty_inputs_matchNr} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -10339,7 +10185,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart_setup.jmx @@ -10382,7 +10228,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart.jmx @@ -10425,7 +10271,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/check_cart_is_empty.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/check_cart_is_empty.jmx @@ -10457,7 +10303,7 @@ vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -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")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -10488,7 +10334,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${accountManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -10504,7 +10350,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -10536,16 +10382,16 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -10583,7 +10429,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -10614,7 +10460,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -10674,7 +10520,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -10767,7 +10613,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/my_orders.jmx + tool/fragments/ce/account_management/my_orders.jmx @@ -10790,7 +10636,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_orders.jmx + tool/fragments/ce/account_management/if_orders.jmx "${orderId}" != "NOT_FOUND" false @@ -10930,7 +10776,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/my_downloadable_products.jmx + tool/fragments/ce/account_management/my_downloadable_products.jmx @@ -10962,7 +10808,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_downloadables.jmx + tool/fragments/ce/account_management/if_downloadables.jmx "${orderId}" != "NOT_FOUND" false @@ -10985,7 +10831,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/view_downloadable_products.jmx + tool/fragments/ce/account_management/view_downloadable_products.jmx @@ -11016,7 +10862,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/download_product.jmx + tool/fragments/ce/account_management/download_product.jmx @@ -11056,7 +10902,7 @@ vars.put("customer_email", customerUser); $1$ 1 - mpaf/tool/fragments/ce/account_management/my_wish_list.jmx + tool/fragments/ce/account_management/my_wish_list.jmx @@ -11071,7 +10917,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_wishlist.jmx + tool/fragments/ce/account_management/if_wishlist.jmx "${buttonTitle}" === "FOUND" false @@ -11094,7 +10940,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/share_wish_list.jmx + tool/fragments/ce/account_management/share_wish_list.jmx @@ -11148,7 +10994,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/send_wish_list.jmx + tool/fragments/ce/account_management/send_wish_list.jmx @@ -11180,7 +11026,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -11200,7 +11046,7 @@ vars.put("customer_email", customerUser); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -11221,14 +11067,14 @@ customerUserList.add(vars.get("customer_email")); false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx 1 false 1 ${adminCMSManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -11244,7 +11090,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -11278,7 +11124,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -11305,21 +11151,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -11450,7 +11297,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -11460,17 +11307,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_cms_management/admin_cms_management.jmx + tool/fragments/ce/admin_cms_management/admin_cms_management.jmx @@ -11683,7 +11530,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -11697,7 +11544,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -11708,7 +11555,7 @@ vars.put("admin_user", adminUser); false 1 ${browseProductGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -11724,7 +11571,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -11758,7 +11605,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -11785,21 +11632,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -11930,7 +11778,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -11940,7 +11788,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -11963,11 +11811,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_products_grid/setup.jmx + tool/fragments/ce/admin_browse_products_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -12053,7 +11901,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -12170,7 +12018,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -12212,7 +12060,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -12298,7 +12146,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -12319,11 +12167,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -12460,7 +12308,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -12474,7 +12322,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -12485,7 +12333,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${browseOrderGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -12501,7 +12349,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -12535,7 +12383,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -12562,21 +12410,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -12707,7 +12556,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -12717,7 +12566,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -12740,11 +12589,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_orders_grid/setup.jmx + tool/fragments/ce/admin_browse_orders_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -12830,7 +12679,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -12947,7 +12796,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -12989,7 +12838,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -13075,7 +12924,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -13096,11 +12945,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -13237,7 +13086,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -13251,7 +13100,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -13262,7 +13111,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${adminProductCreationPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -13278,7 +13127,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -13312,7 +13161,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -13339,21 +13188,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -13484,7 +13334,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -13494,17 +13344,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/once_only_controller.jmx + tool/fragments/ce/once_only_controller.jmx - mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx + tool/fragments/ce/admin_create_product/get_related_product_id.jmx 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 - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -13534,7 +13384,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -13562,7 +13412,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -13592,7 +13442,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -13642,7 +13492,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx + tool/fragments/ce/admin_create_product/get_product_attributes.jmx product_attributes @@ -13710,7 +13560,7 @@ vars.putObject("product_attributes", attributes); false false - mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx + tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx @@ -13737,17 +13587,20 @@ vars.put("attribute_set_filter", new String(encodedBytes)); - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx 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 true - mpaf/tool/fragments/ce/admin_create_product/setup.jmx + tool/fragments/ce/admin_create_product/setup.jmx - mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx + tool/fragments/ce/admin_create_product/create_bundle_product.jmx @@ -15692,7 +15545,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -15713,7 +15566,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/open_catalog_grid.jmx + tool/fragments/ce/admin_create_product/open_catalog_grid.jmx @@ -15744,7 +15597,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/new_configurable.jmx + tool/fragments/ce/admin_create_product/new_configurable.jmx @@ -16274,7 +16127,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/configurable_validate.jmx + tool/fragments/ce/admin_create_product/configurable_validate.jmx @@ -16365,7 +16218,7 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } - mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx + tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx @@ -16886,7 +16739,7 @@ function addConfigurableMatrix(attributes) { false false - mpaf/tool/fragments/ce/admin_create_product/configurable_save.jmx + tool/fragments/ce/admin_create_product/configurable_save.jmx @@ -16995,13 +16848,13 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } - mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx + tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - mpaf/tool/fragments/ce/admin_create_product/create_downloadable_product.jmx + tool/fragments/ce/admin_create_product/create_downloadable_product.jmx @@ -18626,7 +18479,7 @@ function addConfigurableMatrix(attributes) { - mpaf/tool/fragments/ce/admin_create_product/create_simple_product.jmx + tool/fragments/ce/admin_create_product/create_simple_product.jmx @@ -20159,7 +20012,7 @@ function addConfigurableMatrix(attributes) { false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -20173,7 +20026,7 @@ function addConfigurableMatrix(attributes) { adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -20184,7 +20037,7 @@ function addConfigurableMatrix(attributes) { false 1 ${adminProductEditingPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -20200,7 +20053,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -20234,7 +20087,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -20261,21 +20114,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -20406,7 +20260,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -20416,23 +20270,24 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx + tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx 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); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -22668,7 +22524,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -22689,14 +22545,14 @@ vars.put("admin_user", adminUser); false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx 1 false 1 ${adminReturnsManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -22712,7 +22568,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -22746,7 +22602,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -22773,21 +22629,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -22918,7 +22775,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -22928,13 +22785,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -22955,7 +22812,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx + tool/fragments/ce/admin_create_process_returns/orders_page.jmx @@ -23066,7 +22923,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx + tool/fragments/ce/admin_create_process_returns/open_orders.jmx @@ -23183,7 +23040,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx + tool/fragments/ce/admin_create_process_returns/search_orders.jmx @@ -23217,7 +23074,7 @@ vars.put("admin_user", adminUser); - mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx + tool/fragments/ce/admin_create_process_returns/setup.jmx import java.util.ArrayList; import java.util.HashMap; @@ -23285,7 +23142,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx + tool/fragments/ce/admin_create_process_returns/open_order.jmx @@ -23311,7 +23168,7 @@ vars.put("admin_user", adminUser); "${order_status}" == "Pending" false - mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx + tool/fragments/ce/admin_edit_order/if_controller.jmx @@ -23331,7 +23188,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx + tool/fragments/ce/admin_create_process_returns/invoice_start.jmx @@ -23402,7 +23259,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx + tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx @@ -23433,7 +23290,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx + tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx @@ -23522,7 +23379,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx + tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx @@ -23539,7 +23396,7 @@ vars.put("admin_user", adminUser); 1 0 ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - mpaf/tool/fragments/ce/admin_create_process_returns/pause.jmx + tool/fragments/ce/admin_create_process_returns/pause.jmx @@ -23562,7 +23419,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -23576,7 +23433,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -23587,7 +23444,7 @@ vars.put("admin_user", adminUser); false 1 ${browseCustomerGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -23603,7 +23460,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -23637,7 +23494,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -23664,21 +23521,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -23809,7 +23667,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -23819,7 +23677,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -23842,11 +23700,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_customers_grid/setup.jmx + tool/fragments/ce/admin_browse_customers_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -23932,7 +23790,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -24049,7 +23907,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -24091,7 +23949,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -24177,7 +24035,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -24198,11 +24056,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -24339,7 +24197,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -24353,7 +24211,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -24364,7 +24222,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${adminCreateOrderPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -24380,7 +24238,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -24414,7 +24272,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -24441,21 +24299,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -24586,7 +24445,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -24596,13 +24455,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx - mpaf/tool/fragments/ce/admin_create_order/admin_create_order.jmx + tool/fragments/ce/admin_create_order/admin_create_order.jmx 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) { false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -25671,7 +25534,7 @@ catch (java.lang.Exception e) { adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -25692,14 +25555,14 @@ catch (java.lang.Exception e) { false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx 1 false 1 ${apiBasePercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -25715,7 +25578,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -25736,7 +25599,7 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -25764,7 +25627,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -25794,7 +25657,7 @@ if (testLabel Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -25802,7 +25665,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -25818,7 +25681,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -25861,7 +25724,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_customer.jmx + tool/fragments/ce/api/create_customer.jmx customer_id @@ -25902,7 +25765,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/check_customer.jmx + tool/fragments/ce/api/check_customer.jmx $.id @@ -25921,7 +25784,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -25937,7 +25800,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -25965,7 +25828,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/get_categories.jmx + tool/fragments/ce/api/get_categories.jmx @@ -26017,7 +25880,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/get_category.jmx + tool/fragments/ce/api/get_category.jmx @@ -26067,7 +25930,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/get_products.jmx + tool/fragments/ce/api/get_products.jmx @@ -26089,7 +25952,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -26105,7 +25968,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -26169,7 +26032,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/search_for_product_frontend.jmx + tool/fragments/ce/api/search_for_product_frontend.jmx $.total_count @@ -26207,7 +26070,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -26223,7 +26086,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -26280,7 +26143,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -26301,7 +26164,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/create_quote.jmx + tool/fragments/ce/api/create_quote.jmx quote_id @@ -26356,7 +26219,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/add_product_to_quote_hardwired_sku.jmx + tool/fragments/ce/api/add_product_to_quote_hardwired_sku.jmx @@ -26387,7 +26250,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/check_product_in_quote_hardwired_sku.jmx + tool/fragments/ce/api/check_product_in_quote_hardwired_sku.jmx $[0].sku @@ -26426,7 +26289,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/create_guest_cart.jmx + tool/fragments/ce/api/create_guest_cart.jmx cart_id @@ -26481,7 +26344,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/add_product_to_guest_cart_hardwired_sku.jmx + tool/fragments/ce/api/add_product_to_guest_cart_hardwired_sku.jmx $.quote_id @@ -26523,7 +26386,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/add_gift_message_to_guest_cart.jmx + tool/fragments/ce/api/add_gift_message_to_guest_cart.jmx $ @@ -26560,7 +26423,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx + tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx @@ -26619,7 +26482,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx + tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx @@ -26678,7 +26541,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/api/checkout_payment_info_place_order.jmx + tool/fragments/ce/api/checkout_payment_info_place_order.jmx @@ -26738,7 +26601,7 @@ vars.put("product_sku", product.get("sku")); false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -26754,7 +26617,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -26795,7 +26658,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_product_no_custom_attributes.jmx + tool/fragments/ce/api/create_product_no_custom_attributes.jmx simple_product_id @@ -26887,7 +26750,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/update_product_stock_info.jmx + tool/fragments/ce/api/update_product_stock_info.jmx $ @@ -26924,7 +26787,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/check_product.jmx + tool/fragments/ce/api/check_product.jmx $.sku @@ -27027,7 +26890,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx simple_product_id @@ -27113,7 +26976,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/check_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/check_product_with_extensible_data_objects.jmx $.sku @@ -27168,14 +27031,14 @@ if (testLabel false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx 1 false 1 ${importProductsPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -27191,7 +27054,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -27225,7 +27088,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -27252,21 +27115,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -27397,7 +27261,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -27407,13 +27271,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -27425,7 +27289,7 @@ vars.put("adminImportFilePath", filepath); true - mpaf/tool/fragments/ce/import_products/setup.jmx + tool/fragments/ce/import_products/setup.jmx @@ -27446,7 +27310,7 @@ vars.put("adminImportFilePath", filepath); false false - mpaf/tool/fragments/ce/common/import.jmx + tool/fragments/ce/common/import.jmx @@ -27538,7 +27402,7 @@ vars.put("adminImportFilePath", filepath); false - mpaf/tool/fragments/ce/common/import_validate.jmx + tool/fragments/ce/common/import_validate.jmx @@ -27634,7 +27498,7 @@ vars.put("adminImportFilePath", filepath); false - mpaf/tool/fragments/ce/common/import_save.jmx + tool/fragments/ce/common/import_save.jmx @@ -27666,7 +27530,7 @@ vars.put("adminImportFilePath", filepath); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -27680,7 +27544,7 @@ vars.put("adminImportFilePath", filepath); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -27691,7 +27555,7 @@ vars.put("adminImportFilePath", filepath); false 1 ${importCustomersPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -27707,7 +27571,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -27741,7 +27605,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -27768,21 +27632,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -27913,7 +27778,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -27923,7 +27788,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -27937,11 +27802,11 @@ vars.put("adminImportFilePath", filepath); true - mpaf/tool/fragments/ce/import_customers/setup.jmx + tool/fragments/ce/import_customers/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -27962,7 +27827,7 @@ vars.put("adminImportFilePath", filepath); false false - mpaf/tool/fragments/ce/common/import.jmx + tool/fragments/ce/common/import.jmx @@ -28054,7 +27919,7 @@ vars.put("adminImportFilePath", filepath); false - mpaf/tool/fragments/ce/common/import_validate.jmx + tool/fragments/ce/common/import_validate.jmx @@ -28150,7 +28015,7 @@ vars.put("adminImportFilePath", filepath); false - mpaf/tool/fragments/ce/common/import_save.jmx + tool/fragments/ce/common/import_save.jmx @@ -28182,7 +28047,7 @@ vars.put("adminImportFilePath", filepath); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -28196,7 +28061,7 @@ vars.put("adminImportFilePath", filepath); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -28207,7 +28072,7 @@ vars.put("adminImportFilePath", filepath); false 1 ${apiSinglePercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -28223,7 +28088,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -28244,7 +28109,7 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -28272,7 +28137,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -28302,7 +28167,7 @@ if (testLabel Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -28310,7 +28175,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -28326,7 +28191,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -28339,14 +28204,12 @@ if (testLabel // 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 false - mpaf/tool/fragments/ce/api/process_orders/setup.jmx + tool/fragments/ce/api/process_orders/setup.jmx @@ -28405,7 +28268,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/process_orders/get_orders.jmx + tool/fragments/ce/api/process_orders/get_orders.jmx entity_ids @@ -28421,7 +28284,7 @@ if (testLabel entity_ids order_id true - mpaf/tool/fragments/ce/api/process_orders/for_each_order.jmx + tool/fragments/ce/api/process_orders/for_each_order.jmx @@ -28441,7 +28304,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/process_orders/create_invoice.jmx + tool/fragments/ce/api/process_orders/create_invoice.jmx @@ -28472,7 +28335,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/process_orders/create_shipment.jmx + tool/fragments/ce/api/process_orders/create_shipment.jmx @@ -28493,7 +28356,7 @@ if (testLabel false 1 100 - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -28509,7 +28372,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -28550,7 +28413,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_attribute_set.jmx + tool/fragments/ce/api/create_attribute_set.jmx attribute_set_id @@ -28603,7 +28466,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_attribute_group.jmx + tool/fragments/ce/api/create_attribute_group.jmx attribute_group_id @@ -28664,7 +28527,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/create_attribute.jmx + tool/fragments/ce/api/create_attribute.jmx attribute_id @@ -28736,7 +28599,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/api/add_attribute_to_attribute_set.jmx + tool/fragments/ce/api/add_attribute_to_attribute_set.jmx $ @@ -28757,7 +28620,7 @@ if (testLabel false 1 ${adminCategoryManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -28773,7 +28636,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -28807,7 +28670,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -28834,21 +28697,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -28979,7 +28843,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -28989,17 +28853,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_category_management/admin_category_management.jmx + tool/fragments/ce/admin_category_management/admin_category_management.jmx @@ -29776,7 +29640,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -29790,7 +29654,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -29801,7 +29665,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate false 1 ${adminPromotionRulesPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -29817,7 +29681,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -29851,7 +29715,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -29878,21 +29742,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -30023,7 +29888,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -30033,17 +29898,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx + tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx @@ -30460,7 +30325,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -30474,7 +30339,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -30485,7 +30350,7 @@ vars.put("admin_user", adminUser); false 1 ${adminCustomerManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -30501,7 +30366,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -30535,7 +30400,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -30562,21 +30427,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -30707,7 +30573,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -30717,17 +30583,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_customer_management/admin_customer_management.jmx + tool/fragments/ce/admin_customer_management/admin_customer_management.jmx @@ -32609,7 +32475,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -32623,7 +32489,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -32634,7 +32500,7 @@ vars.put("admin_user", adminUser); false 1 ${adminEditOrderPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -32650,7 +32516,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -32684,7 +32550,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -32711,21 +32577,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -32856,7 +32723,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -32866,13 +32733,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -32893,7 +32760,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx + tool/fragments/ce/admin_create_process_returns/orders_page.jmx @@ -33004,7 +32871,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx + tool/fragments/ce/admin_create_process_returns/open_orders.jmx @@ -33121,7 +32988,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx + tool/fragments/ce/admin_create_process_returns/search_orders.jmx @@ -33155,7 +33022,7 @@ vars.put("admin_user", adminUser); - mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx + tool/fragments/ce/admin_create_process_returns/setup.jmx import java.util.ArrayList; import java.util.HashMap; @@ -33223,7 +33090,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx + tool/fragments/ce/admin_create_process_returns/open_order.jmx @@ -33249,7 +33116,7 @@ vars.put("admin_user", adminUser); "${order_status}" == "Pending" false - mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx + tool/fragments/ce/admin_edit_order/if_controller.jmx @@ -33293,7 +33160,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/add_comment.jmx + tool/fragments/ce/admin_edit_order/add_comment.jmx @@ -33324,7 +33191,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx + tool/fragments/ce/admin_create_process_returns/invoice_start.jmx @@ -33395,7 +33262,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx + tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx @@ -33426,7 +33293,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/shipment_start.jmx + tool/fragments/ce/admin_edit_order/shipment_start.jmx @@ -33487,7 +33354,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/shipment_submit.jmx + tool/fragments/ce/admin_edit_order/shipment_submit.jmx @@ -33520,7 +33387,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -33534,7 +33401,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -33545,7 +33412,7 @@ vars.put("admin_user", adminUser); false 1 ${catalogGraphQLPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -33561,7 +33428,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -33572,7 +33439,7 @@ if (testLabel - mpaf/tool/fragments/ce/once_only_controller.jmx + tool/fragments/ce/once_only_controller.jmx @@ -33599,7 +33466,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -33626,21 +33493,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -33771,7 +33639,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -33781,17 +33649,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx + tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx @@ -33891,7 +33759,7 @@ vars.put("admin_user", adminUser); - mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx + tool/fragments/ce/admin_create_product/get_related_product_id.jmx 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 - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -33921,7 +33789,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -33949,7 +33817,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -33979,7 +33847,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -34029,7 +33897,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx + tool/fragments/ce/admin_create_product/get_product_attributes.jmx product_attributes @@ -34097,7 +33965,7 @@ vars.putObject("product_attributes", attributes); false false - mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx + tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx @@ -34126,10 +33994,13 @@ vars.put("attribute_set_filter", new String(encodedBytes)); 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 true - mpaf/tool/fragments/ce/admin_create_product/setup.jmx + tool/fragments/ce/admin_create_product/setup.jmx - mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx + tool/fragments/ce/admin_create_product/create_bundle_product.jmx @@ -36076,7 +35947,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx + tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx @@ -36273,7 +36144,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -36287,12 +36158,12 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -36306,7 +36177,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -36334,7 +36205,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -36364,7 +36235,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -36434,7 +36305,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx simple_product_id @@ -36496,7 +36367,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx @@ -37275,7 +37146,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx @@ -37717,7 +37588,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx @@ -38232,7 +38103,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx @@ -38295,7 +38166,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx + tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx @@ -38505,7 +38376,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -38519,7 +38390,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -38547,7 +38418,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -38577,7 +38448,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -38605,7 +38476,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx @@ -38662,7 +38533,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx @@ -38738,7 +38609,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx @@ -38807,7 +38678,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx @@ -38875,7 +38746,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx @@ -38935,7 +38806,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx @@ -38995,7 +38866,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx @@ -39055,7 +38926,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx + tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx @@ -39112,7 +38983,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx @@ -39181,7 +39052,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx @@ -39268,7 +39139,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx @@ -39335,7 +39206,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx + tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx @@ -39414,7 +39285,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_frontend_customer.jmx + tool/fragments/ce/graphql/query_frontend_customer.jmx @@ -39455,7 +39326,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/api/check_customer.jmx + tool/fragments/ce/api/check_customer.jmx @@ -39505,7 +39376,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/api/create_customer.jmx + tool/fragments/ce/api/create_customer.jmx @@ -39542,7 +39413,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_frontend_customer.jmx + tool/fragments/ce/graphql/query_frontend_customer.jmx @@ -39593,7 +39464,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/query_root_category.jmx + tool/fragments/ce/graphql/query_root_category.jmx @@ -39650,7 +39521,7 @@ if (name == null) { false false - mpaf/tool/fragments/ce/graphql/query_root_category_list.jmx + tool/fragments/ce/graphql/query_root_category_list.jmx @@ -39710,7 +39581,7 @@ if (name == null) { false false - mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx + tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx $.data.cmsPage.url_key @@ -39741,14 +39612,14 @@ if (name == null) { false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx 1 false 1 ${graphqlGetListOfProductsByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -39764,7 +39635,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -39785,11 +39656,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -39849,7 +39720,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx + tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx @@ -39870,7 +39741,7 @@ vars.putObject("category", categories[number]); false 1 ${graphqlGetSimpleProductDetailsByProductUrlKeyPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -39886,7 +39757,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -39907,11 +39778,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -39945,7 +39816,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -39973,7 +39844,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx + tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx @@ -39994,7 +39865,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlGetSimpleProductDetailsByNamePercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40010,7 +39881,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40031,11 +39902,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -40069,7 +39940,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -40097,7 +39968,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx + tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx @@ -40118,7 +39989,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40134,7 +40005,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40155,11 +40026,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -40193,7 +40064,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -40221,7 +40092,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx @@ -40242,7 +40113,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlGetConfigurableProductDetailsByNamePercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40258,7 +40129,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40279,11 +40150,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -40317,7 +40188,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -40345,7 +40216,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -40366,7 +40237,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlGetProductSearchByTextAndCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40382,7 +40253,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40403,11 +40274,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -40467,7 +40338,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx + tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx @@ -40509,7 +40380,7 @@ if (totalCount == null) { false 1 ${graphqlGetCategoryListByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40525,7 +40396,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40546,11 +40417,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -40612,7 +40483,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_category_list_by_category_id.jmx + tool/fragments/ce/graphql/get_category_list_by_category_id.jmx javascript @@ -40657,7 +40528,7 @@ function assertCategoryChildren(category, response) { false 1 ${graphqlGetCategoryListByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40673,7 +40544,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40694,11 +40565,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -40758,7 +40629,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx + tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx @@ -40804,7 +40675,7 @@ function assertCategoryChildren(category, response) { false 1 ${graphqlGetCategoryListByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40820,7 +40691,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40841,11 +40712,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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); - mpaf/tool/fragments/ce/common/extract_multiple_categories_setup.jmx + tool/fragments/ce/common/extract_multiple_categories_setup.jmx @@ -40921,7 +40792,7 @@ vars.put("category_id_4", categories[numbers[3]].id); false false - mpaf/tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx + tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx @@ -40952,7 +40823,7 @@ if(response.data.categoryList.length !== 4){ false 1 ${graphqlGetCategoryListByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -40968,7 +40839,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -40989,11 +40860,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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); - mpaf/tool/fragments/ce/common/extract_multiple_categories_setup.jmx + tool/fragments/ce/common/extract_multiple_categories_setup.jmx @@ -41069,7 +40940,7 @@ vars.put("category_id_4", categories[numbers[3]].id); false false - mpaf/tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx + tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx @@ -41100,7 +40971,7 @@ if(response.data.categories.items.length !== 4){ false 1 ${graphqlGetCategoryListByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41116,7 +40987,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41137,7 +41008,7 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -41165,7 +41036,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx + tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx @@ -41196,7 +41067,7 @@ if(response.data.categories.items.length != 20){ false 1 ${graphqlUrlInfoByUrlKeyPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41212,7 +41083,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41233,11 +41104,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -41299,7 +41170,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_url_info_by_url_key.jmx + tool/fragments/ce/graphql/get_url_info_by_url_key.jmx @@ -41319,7 +41190,7 @@ vars.putObject("category", categories[number]); false 1 ${graphqlGetCmsPageByIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41335,7 +41206,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41356,11 +41227,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -41389,7 +41260,7 @@ var number = random.nextInt(cmsPages.length); vars.put("cms_page_id", cmsPages[number].id); - mpaf/tool/fragments/ce/setup/prepare_cms_page.jmx + tool/fragments/ce/setup/prepare_cms_page.jmx @@ -41419,7 +41290,7 @@ vars.put("cms_page_id", cmsPages[number].id); false false - mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx + tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx $.data.cmsPage.url_key @@ -41439,7 +41310,7 @@ vars.put("cms_page_id", cmsPages[number].id); false 1 ${graphqlGetNavigationMenuByCategoryIdPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41455,7 +41326,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41476,11 +41347,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -41540,7 +41411,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx + tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx @@ -41561,7 +41432,7 @@ vars.putObject("category", categories[number]); false 1 ${graphqlCreateEmptyCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41577,7 +41448,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41598,11 +41469,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -41644,7 +41515,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -41673,7 +41544,7 @@ vars.putObject("randomIntGenerator", random); false 1 ${graphqlGetEmptyCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41689,7 +41560,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41710,11 +41581,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -41756,7 +41627,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -41803,7 +41674,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx + tool/fragments/ce/graphql/get_empty_cart.jmx @@ -41824,7 +41695,7 @@ vars.putObject("randomIntGenerator", random); false 1 ${graphqlSetShippingAddressOnCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -41840,7 +41711,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -41861,11 +41732,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -41907,7 +41778,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -41954,7 +41825,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx + tool/fragments/ce/graphql/get_empty_cart.jmx @@ -41993,7 +41864,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx + tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx @@ -42014,7 +41885,7 @@ vars.putObject("randomIntGenerator", random); false 1 ${graphqlSetBillingAddressOnCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -42030,7 +41901,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -42051,11 +41922,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -42097,7 +41968,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -42144,7 +42015,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx + tool/fragments/ce/graphql/get_empty_cart.jmx @@ -42183,7 +42054,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/set_billing_address_on_cart.jmx + tool/fragments/ce/graphql/set_billing_address_on_cart.jmx @@ -42204,7 +42075,7 @@ vars.putObject("randomIntGenerator", random); false 1 ${graphqlAddSimpleProductToCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -42220,7 +42091,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -42241,11 +42112,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -42287,7 +42158,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -42326,7 +42197,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -42354,7 +42225,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -42376,7 +42247,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlAddConfigurableProductToCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -42392,7 +42263,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -42413,11 +42284,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -42459,7 +42330,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -42498,7 +42369,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -42526,7 +42397,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -42545,7 +42416,7 @@ vars.put("product_sku", product.get("sku")); BODY - mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx + tool/fragments/ce/graphql/extract_configurable_product_option.jmx @@ -42574,7 +42445,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx + tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx @@ -42596,7 +42467,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlUpdateSimpleProductQtyInCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -42612,7 +42483,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -42633,11 +42504,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -42679,7 +42550,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -42718,7 +42589,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -42746,7 +42617,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -42786,7 +42657,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart.jmx + tool/fragments/ce/graphql/get_cart.jmx @@ -42833,7 +42704,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx + tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx @@ -42854,7 +42725,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlUpdateConfigurableProductQtyInCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -42870,7 +42741,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -42891,11 +42762,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -42937,7 +42808,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -42976,7 +42847,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -43004,7 +42875,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -43023,7 +42894,7 @@ vars.put("product_sku", product.get("sku")); BODY - mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx + tool/fragments/ce/graphql/extract_configurable_product_option.jmx @@ -43052,7 +42923,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx + tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx @@ -43092,7 +42963,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart.jmx + tool/fragments/ce/graphql/get_cart.jmx @@ -43139,7 +43010,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx + tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx @@ -43160,7 +43031,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlUpdateSimpleProductQtyInCartWithPricesPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -43176,7 +43047,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -43197,11 +43068,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -43243,7 +43114,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -43282,7 +43153,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -43310,7 +43181,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx @@ -43350,7 +43221,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart_with_prices.jmx + tool/fragments/ce/graphql/get_cart_with_prices.jmx @@ -43397,7 +43268,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx + tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx @@ -43419,7 +43290,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -43435,7 +43306,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -43456,11 +43327,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -43502,7 +43373,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -43541,7 +43412,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -43569,7 +43440,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -43588,7 +43459,7 @@ vars.put("product_sku", product.get("sku")); BODY - mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx + tool/fragments/ce/graphql/extract_configurable_product_option.jmx @@ -43617,7 +43488,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx + tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx @@ -43657,7 +43528,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart_with_prices.jmx + tool/fragments/ce/graphql/get_cart_with_prices.jmx @@ -43704,7 +43575,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx + tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx @@ -43726,7 +43597,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlRemoveSimpleProductFromCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -43742,7 +43613,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -43763,11 +43634,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -43809,7 +43680,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -43848,7 +43719,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -43876,7 +43747,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -43916,7 +43787,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart.jmx + tool/fragments/ce/graphql/get_cart.jmx @@ -43963,7 +43834,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx + tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx @@ -43984,7 +43855,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlRemoveConfigurableProductFromCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -44000,7 +43871,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -44021,11 +43892,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -44067,7 +43938,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -44106,7 +43977,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -44134,7 +44005,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -44153,7 +44024,7 @@ vars.put("product_sku", product.get("sku")); BODY - mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx + tool/fragments/ce/graphql/extract_configurable_product_option.jmx @@ -44182,7 +44053,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx + tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx @@ -44222,7 +44093,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_cart.jmx + tool/fragments/ce/graphql/get_cart.jmx @@ -44269,7 +44140,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx + tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx @@ -44290,7 +44161,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${graphqlApplyCouponToCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -44306,7 +44177,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -44327,11 +44198,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -44373,7 +44244,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -44412,7 +44283,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -44440,7 +44311,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -44467,7 +44338,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); - mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx + tool/fragments/ce/common/extract_coupon_code_setup.jmx @@ -44496,7 +44367,7 @@ vars.put("coupon_code", coupons[number].code); false false - mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx + tool/fragments/ce/graphql/apply_coupon_to_cart.jmx @@ -44517,7 +44388,7 @@ vars.put("coupon_code", coupons[number].code); false 1 ${graphqlRemoveCouponFromCartPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -44533,7 +44404,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -44554,11 +44425,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -44600,7 +44471,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -44639,7 +44510,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -44667,7 +44538,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -44694,7 +44565,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); - mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx + tool/fragments/ce/common/extract_coupon_code_setup.jmx @@ -44723,7 +44594,7 @@ vars.put("coupon_code", coupons[number].code); false false - mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx + tool/fragments/ce/graphql/apply_coupon_to_cart.jmx @@ -44762,7 +44633,7 @@ vars.put("coupon_code", coupons[number].code); false false - mpaf/tool/fragments/ce/graphql/remove_coupon_from_cart.jmx + tool/fragments/ce/graphql/remove_coupon_from_cart.jmx @@ -44783,7 +44654,7 @@ vars.put("coupon_code", coupons[number].code); false 1 ${graphqlCatalogBrowsingByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -44799,7 +44670,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -44820,11 +44691,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -44884,7 +44755,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx + tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx @@ -44923,7 +44794,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx + tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx @@ -44985,7 +44856,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/get_url_info_by_url_key.jmx + tool/fragments/ce/graphql/get_url_info_by_url_key.jmx @@ -45023,7 +44894,7 @@ if (totalCount == null) { false false - mpaf/tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx + tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx @@ -45054,7 +44925,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -45082,7 +44953,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -45121,7 +44992,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx @@ -45152,7 +45023,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -45180,7 +45051,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx + tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx @@ -45219,7 +45090,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx + tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx @@ -45245,7 +45116,7 @@ var number = random.nextInt(cmsPages.length); vars.put("cms_page_id", cmsPages[number].id); - mpaf/tool/fragments/ce/setup/prepare_cms_page.jmx + tool/fragments/ce/setup/prepare_cms_page.jmx @@ -45275,7 +45146,7 @@ vars.put("cms_page_id", cmsPages[number].id); false false - mpaf/tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx + tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx $.data.cmsPage.url_key @@ -45295,7 +45166,7 @@ vars.put("cms_page_id", cmsPages[number].id); false 1 ${graphqlCheckoutByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -45311,7 +45182,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -45332,11 +45203,11 @@ if (testLabel */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -45378,7 +45249,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/create_empty_cart.jmx + tool/fragments/ce/graphql/create_empty_cart.jmx @@ -45425,7 +45296,7 @@ vars.putObject("randomIntGenerator", random); false false - mpaf/tool/fragments/ce/graphql/get_empty_cart.jmx + tool/fragments/ce/graphql/get_empty_cart.jmx @@ -45456,7 +45327,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -45484,7 +45355,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx + tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx @@ -45503,7 +45374,7 @@ vars.put("product_sku", product.get("sku")); BODY - mpaf/tool/fragments/ce/graphql/extract_configurable_product_option.jmx + tool/fragments/ce/graphql/extract_configurable_product_option.jmx @@ -45532,7 +45403,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx + tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx @@ -45564,7 +45435,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -45592,7 +45463,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/add_simple_product_to_cart.jmx + tool/fragments/ce/graphql/add_simple_product_to_cart.jmx @@ -45632,7 +45503,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/set_billing_address_on_cart.jmx + tool/fragments/ce/graphql/set_billing_address_on_cart.jmx @@ -45671,7 +45542,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx + tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx @@ -45710,7 +45581,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/set_payment_method_on_cart.jmx + tool/fragments/ce/graphql/set_payment_method_on_cart.jmx @@ -45749,7 +45620,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/get_current_shipping_address.jmx + tool/fragments/ce/graphql/get_current_shipping_address.jmx @@ -45778,7 +45649,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx + tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx @@ -45804,7 +45675,7 @@ number = random.nextInt(coupons.length); vars.put("coupon_code", coupons[number].code); - mpaf/tool/fragments/ce/common/extract_coupon_code_setup.jmx + tool/fragments/ce/common/extract_coupon_code_setup.jmx @@ -45833,7 +45704,7 @@ vars.put("coupon_code", coupons[number].code); false false - mpaf/tool/fragments/ce/graphql/apply_coupon_to_cart.jmx + tool/fragments/ce/graphql/apply_coupon_to_cart.jmx @@ -45872,7 +45743,7 @@ vars.put("coupon_code", coupons[number].code); false false - mpaf/tool/fragments/ce/graphql/remove_coupon_from_cart.jmx + tool/fragments/ce/graphql/remove_coupon_from_cart.jmx @@ -45903,7 +45774,7 @@ vars.put("coupon_code", coupons[number].code); false - mpaf/tool/fragments/_system/thread_group.jmx + tool/fragments/_system/thread_group.jmx javascript @@ -45926,7 +45797,7 @@ function doCache(){ } } - mpaf/tool/fragments/ce/common/cache_hit_miss.jmx + tool/fragments/ce/common/cache_hit_miss.jmx @@ -45934,7 +45805,7 @@ function doCache(){ false 1 ${cBrowseCatalogByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -45950,7 +45821,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -45982,11 +45853,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx 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]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -46039,7 +45910,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -46070,7 +45941,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -46107,7 +45978,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -46137,7 +46008,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -46158,7 +46029,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -46175,7 +46046,7 @@ vars.put("product_sku", product.get("sku")); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -46205,7 +46076,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx @@ -46226,7 +46097,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -46247,7 +46118,7 @@ vars.put("product_sku", product.get("sku")); false 1 ${cSiteSearchPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -46263,7 +46134,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -46282,7 +46153,7 @@ if (testLabel true false shareMode.thread - mpaf/tool/fragments/ce/search/search_terms.jmx + tool/fragments/ce/search/search_terms.jmx @@ -46306,7 +46177,7 @@ function doCache(){ } } - mpaf/tool/fragments/ce/common/cache_hit_miss.jmx + tool/fragments/ce/common/cache_hit_miss.jmx @@ -46314,7 +46185,7 @@ function doCache(){ false 1 ${searchQuickPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -46330,7 +46201,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -46362,7 +46233,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -46383,7 +46254,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -46422,7 +46293,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_quick.jmx + tool/fragments/ce/search/search_quick.jmx @@ -46457,7 +46328,7 @@ if (testLabel "${isPageCacheable}" != "0" false - mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx + tool/fragments/ce/search/if_page_cacheable_controller.jmx @@ -46485,7 +46356,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_terms_log_save.jmx + tool/fragments/ce/search/search_terms_log_save.jmx @@ -46513,13 +46384,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -46533,7 +46404,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -46564,7 +46435,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -46585,7 +46456,7 @@ vars.put("product_url_key", product); false 1 ${searchQuickFilterPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -46601,7 +46472,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -46633,7 +46504,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -46654,7 +46525,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -46693,7 +46564,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_quick_filter.jmx + tool/fragments/ce/search/search_quick_filter.jmx @@ -46755,7 +46626,7 @@ if (testLabel "${isPageCacheable}" != "0" false - mpaf/tool/fragments/ce/search/if_page_cacheable_controller.jmx + tool/fragments/ce/search/if_page_cacheable_controller.jmx @@ -46783,7 +46654,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_terms_log_save.jmx + tool/fragments/ce/search/search_terms_log_save.jmx @@ -46801,7 +46672,7 @@ if (testLabel ${attribute_1_options_count} > 0 false - mpaf/tool/fragments/ce/search/search_quick_filter-first-attribute.jmx + tool/fragments/ce/search/search_quick_filter-first-attribute.jmx vars.put("search_url", vars.get("attribute_1_filter_url")); @@ -46873,7 +46744,7 @@ if (testLabel ${attribute_2_options_count} > 0 false - mpaf/tool/fragments/ce/search/search_quick_filter-second-attribute.jmx + tool/fragments/ce/search/search_quick_filter-second-attribute.jmx vars.put("search_url", vars.get("attribute_2_filter_url")); @@ -46937,13 +46808,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -46957,7 +46828,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -46988,7 +46859,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -47009,7 +46880,7 @@ vars.put("product_url_key", product); false 1 ${searchAdvancedPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -47025,7 +46896,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -47057,7 +46928,7 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx @@ -47078,7 +46949,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -47110,7 +46981,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/open_advanced_search_page.jmx + tool/fragments/ce/search/open_advanced_search_page.jmx @@ -47221,7 +47092,7 @@ if (testLabel false false - mpaf/tool/fragments/ce/search/search_advanced.jmx + tool/fragments/ce/search/search_advanced.jmx @@ -47256,13 +47127,13 @@ vars.put("foundProducts", String.valueOf(foundProducts)); true - mpaf/tool/fragments/ce/search/set_found_items.jmx + tool/fragments/ce/search/set_found_items.jmx true ${foundProducts} - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -47276,7 +47147,7 @@ vars.put("foundProducts", String.valueOf(foundProducts)); - mpaf/tool/fragments/ce/search/searched_products_setup.jmx + tool/fragments/ce/search/searched_products_setup.jmx number = vars.get("_counter"); product = vars.get("product_url_keys_"+number); @@ -47307,7 +47178,7 @@ vars.put("product_url_key", product); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -47330,7 +47201,7 @@ vars.put("product_url_key", product); false 1 ${cAddToCartByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -47346,7 +47217,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -47378,11 +47249,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -47400,7 +47271,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -47425,7 +47296,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -47446,7 +47317,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -47477,7 +47348,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -47514,7 +47385,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -47544,11 +47415,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -47579,7 +47450,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -47639,7 +47510,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -47648,7 +47519,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -47692,7 +47563,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -47729,7 +47600,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -47737,7 +47608,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -47767,11 +47638,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -47802,7 +47673,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -47818,7 +47689,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -47975,7 +47846,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -48004,7 +47875,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -48014,7 +47885,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -48058,7 +47929,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -48095,7 +47966,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -48107,7 +47978,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${cAddToWishlistPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -48123,7 +47994,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -48155,11 +48026,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -48178,11 +48049,11 @@ vars.putObject("randomIntGenerator", random); get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -48220,7 +48091,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -48280,7 +48151,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -48358,7 +48229,7 @@ vars.put("customer_email", customerUser); true 5 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -48388,7 +48259,7 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx @@ -48409,7 +48280,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -48463,7 +48334,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/wishlist/add_to_wishlist.jmx + tool/fragments/ce/wishlist/add_to_wishlist.jmx @@ -48525,7 +48396,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/wishlist/load_wishlist_section.jmx + tool/fragments/ce/wishlist/load_wishlist_section.jmx @@ -48547,7 +48418,7 @@ vars.put("product_sku", product.get("sku")); wishListItems wishListItem true - mpaf/tool/fragments/ce/wishlist/clear_wishlist.jmx + tool/fragments/ce/wishlist/clear_wishlist.jmx 1 @@ -48615,7 +48486,7 @@ vars.put("product_sku", product.get("sku")); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -48635,7 +48506,7 @@ vars.put("product_sku", product.get("sku")); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -48646,7 +48517,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${cCompareProductsPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -48662,7 +48533,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -48694,11 +48565,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -48716,7 +48587,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -48741,7 +48612,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -48762,7 +48633,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/product_compare/open_category.jmx + tool/fragments/ce/product_compare/open_category.jmx @@ -48798,7 +48669,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -48828,11 +48699,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -48863,7 +48734,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -48916,7 +48787,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx + tool/fragments/ce/product_compare/product_compare_add.jmx @@ -48959,7 +48830,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx + tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx @@ -48976,7 +48847,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -49006,11 +48877,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49041,7 +48912,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -49094,7 +48965,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/product_compare_add.jmx + tool/fragments/ce/product_compare/product_compare_add.jmx @@ -49137,7 +49008,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx + tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx @@ -49169,14 +49040,14 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/compare_products.jmx + tool/fragments/ce/product_compare/compare_products.jmx 1 0 ${__javaScript(Math.round(${productCompareDelay}*1000))} - mpaf/tool/fragments/ce/product_compare/compare_products_pause.jmx + tool/fragments/ce/product_compare/compare_products_pause.jmx @@ -49205,7 +49076,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_compare/compare_products_clear.jmx + tool/fragments/ce/product_compare/compare_products_clear.jmx @@ -49215,7 +49086,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${cCheckoutByGuestPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -49231,7 +49102,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -49263,11 +49134,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -49285,7 +49156,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -49310,7 +49181,7 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx @@ -49331,7 +49202,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -49362,7 +49233,7 @@ vars.putObject("category", categories[number]); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -49399,7 +49270,7 @@ vars.putObject("category", categories[number]); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -49429,11 +49300,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49464,7 +49335,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -49524,7 +49395,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -49533,7 +49404,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -49577,7 +49448,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -49614,7 +49485,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -49622,7 +49493,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -49652,11 +49523,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -49687,7 +49558,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -49703,7 +49574,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -49860,7 +49731,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -49889,7 +49760,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -49899,7 +49770,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -49943,7 +49814,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -49980,13 +49851,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx @@ -50019,7 +49890,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_start.jmx + tool/fragments/ce/guest_checkout/checkout_start.jmx @@ -50086,7 +49957,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_email_available.jmx + tool/fragments/ce/guest_checkout/checkout_email_available.jmx @@ -50145,7 +50016,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx + tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx @@ -50204,7 +50075,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx + tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx @@ -50263,7 +50134,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx + tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx @@ -50334,7 +50205,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/guest_checkout/checkout_success.jmx + tool/fragments/ce/guest_checkout/checkout_success.jmx @@ -50356,7 +50227,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false 1 ${cCheckoutByCustomerPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -50372,7 +50243,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -50404,11 +50275,11 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx - mpaf/tool/fragments/ce/common/init_random_generator_setup.jmx + tool/fragments/ce/common/init_random_generator_setup.jmx import java.util.Random; @@ -50426,7 +50297,7 @@ vars.putObject("randomIntGenerator", random); - mpaf/tool/fragments/ce/common/init_total_products_in_cart_setup.jmx + tool/fragments/ce/common/init_total_products_in_cart_setup.jmx vars.put("totalProductsAdded", "0"); @@ -50451,16 +50322,16 @@ vars.put("category_name", categories[number].name); vars.put("category_id", categories[number].id); vars.putObject("category", categories[number]); - mpaf/tool/fragments/ce/common/extract_category_setup.jmx + tool/fragments/ce/common/extract_category_setup.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -50498,7 +50369,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -50529,7 +50400,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -50589,7 +50460,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -50682,7 +50553,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_category.jmx + tool/fragments/ce/common/open_category.jmx @@ -50719,7 +50590,7 @@ vars.put("customer_email", customerUser); true 2 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -50749,11 +50620,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -50784,7 +50655,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -50844,7 +50715,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx @@ -50853,7 +50724,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -50897,7 +50768,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -50934,7 +50805,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -50942,7 +50813,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/loop_controller.jmx + tool/fragments/ce/loop_controller.jmx 1 @@ -50972,11 +50843,11 @@ vars.put("product_sku", product.get("sku")); true - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - mpaf/tool/fragments/ce/loops/update_products_added_counter.jmx + tool/fragments/ce/loops/update_products_added_counter.jmx productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); productsAdded = productsAdded + 1; @@ -51007,7 +50878,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx @@ -51023,7 +50894,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); true 1 - mpaf/tool/fragments/ce/common/get_configurable_product_options.jmx + tool/fragments/ce/common/get_configurable_product_options.jmx @@ -51180,7 +51051,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx + tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx false @@ -51209,7 +51080,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); log.error("eror…", e); } - mpaf/tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx + tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx @@ -51219,7 +51090,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx @@ -51263,7 +51134,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/load_cart_section.jmx + tool/fragments/ce/load_cart_section.jmx @@ -51300,13 +51171,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); XMLHttpRequest - mpaf/tool/fragments/ce/common/http_header_manager_ajax.jmx + tool/fragments/ce/common/http_header_manager_ajax.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx @@ -51339,7 +51210,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_start.jmx + tool/fragments/ce/customer_checkout/checkout_start.jmx @@ -51446,7 +51317,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx + tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx @@ -51505,7 +51376,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx + tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx @@ -51564,7 +51435,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx + tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx @@ -51616,7 +51487,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/customer_checkout/checkout_success.jmx + tool/fragments/ce/customer_checkout/checkout_success.jmx @@ -51649,7 +51520,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -51671,7 +51542,7 @@ if(curSampler.getName().contains("Checkout success")) { manager.clear(); } - mpaf/tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx + tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx @@ -51682,7 +51553,7 @@ if(curSampler.getName().contains("Checkout success")) { customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -51693,7 +51564,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${cAccountManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -51709,7 +51580,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -51741,16 +51612,16 @@ if (testLabel true - mpaf/tool/fragments/ce/http_cookie_manager.jmx + tool/fragments/ce/http_cookie_manager.jmx get-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_customer_email.jmx + tool/fragments/ce/get_customer_email.jmx customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); @@ -51788,7 +51659,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_home_page.jmx + tool/fragments/ce/common/open_home_page.jmx @@ -51819,7 +51690,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/open_login_page.jmx + tool/fragments/ce/common/open_login_page.jmx @@ -51879,7 +51750,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/login.jmx + tool/fragments/ce/common/login.jmx @@ -51972,7 +51843,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/my_orders.jmx + tool/fragments/ce/account_management/my_orders.jmx @@ -51995,7 +51866,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_orders.jmx + tool/fragments/ce/account_management/if_orders.jmx "${orderId}" != "NOT_FOUND" false @@ -52135,7 +52006,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/my_downloadable_products.jmx + tool/fragments/ce/account_management/my_downloadable_products.jmx @@ -52167,7 +52038,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_downloadables.jmx + tool/fragments/ce/account_management/if_downloadables.jmx "${orderId}" != "NOT_FOUND" false @@ -52190,7 +52061,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/view_downloadable_products.jmx + tool/fragments/ce/account_management/view_downloadable_products.jmx @@ -52221,7 +52092,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/download_product.jmx + tool/fragments/ce/account_management/download_product.jmx @@ -52261,7 +52132,7 @@ vars.put("customer_email", customerUser); $1$ 1 - mpaf/tool/fragments/ce/account_management/my_wish_list.jmx + tool/fragments/ce/account_management/my_wish_list.jmx @@ -52276,7 +52147,7 @@ vars.put("customer_email", customerUser); - mpaf/tool/fragments/ce/account_management/if_wishlist.jmx + tool/fragments/ce/account_management/if_wishlist.jmx "${buttonTitle}" === "FOUND" false @@ -52299,7 +52170,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/share_wish_list.jmx + tool/fragments/ce/account_management/share_wish_list.jmx @@ -52353,7 +52224,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/account_management/send_wish_list.jmx + tool/fragments/ce/account_management/send_wish_list.jmx @@ -52385,7 +52256,7 @@ vars.put("customer_email", customerUser); false false - mpaf/tool/fragments/ce/common/logout.jmx + tool/fragments/ce/common/logout.jmx @@ -52405,7 +52276,7 @@ vars.put("customer_email", customerUser); customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - mpaf/tool/fragments/ce/common/return_email_to_pool.jmx + tool/fragments/ce/common/return_email_to_pool.jmx @@ -52416,7 +52287,7 @@ customerUserList.add(vars.get("customer_email")); false 1 ${cAdminCMSManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -52432,7 +52303,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -52466,7 +52337,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -52493,21 +52364,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -52638,7 +52510,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -52648,17 +52520,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_cms_management/admin_cms_management.jmx + tool/fragments/ce/admin_cms_management/admin_cms_management.jmx @@ -52871,7 +52743,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -52885,7 +52757,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -52896,7 +52768,7 @@ vars.put("admin_user", adminUser); false 1 ${cAdminBrowseProductGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -52912,7 +52784,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -52946,7 +52818,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -52973,21 +52845,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -53118,7 +52991,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -53128,7 +53001,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -53151,11 +53024,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_products_grid/setup.jmx + tool/fragments/ce/admin_browse_products_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -53241,7 +53114,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -53358,7 +53231,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -53400,7 +53273,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -53486,7 +53359,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -53507,11 +53380,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -53648,7 +53521,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -53662,7 +53535,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -53673,7 +53546,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${cAdminBrowseOrderGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -53689,7 +53562,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -53723,7 +53596,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -53750,21 +53623,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -53895,7 +53769,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -53905,7 +53779,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -53928,11 +53802,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_orders_grid/setup.jmx + tool/fragments/ce/admin_browse_orders_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -54018,7 +53892,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -54135,7 +54009,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -54177,7 +54051,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -54263,7 +54137,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -54284,11 +54158,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -54425,7 +54299,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -54439,7 +54313,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -54450,7 +54324,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${cAdminProductCreationPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -54466,7 +54340,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -54500,7 +54374,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -54527,21 +54401,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -54672,7 +54547,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -54682,17 +54557,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/once_only_controller.jmx + tool/fragments/ce/once_only_controller.jmx - mpaf/tool/fragments/ce/admin_create_product/get_related_product_id.jmx + tool/fragments/ce/admin_create_product/get_related_product_id.jmx 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 - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -54722,7 +54597,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde */* - mpaf/tool/fragments/ce/api/header_manager_before_token.jmx + tool/fragments/ce/api/header_manager_before_token.jmx @@ -54750,7 +54625,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/api/admin_token_retrieval.jmx + tool/fragments/ce/api/admin_token_retrieval.jmx admin_token @@ -54780,7 +54655,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde Bearer ${admin_token} - mpaf/tool/fragments/ce/api/header_manager.jmx + tool/fragments/ce/api/header_manager.jmx @@ -54830,7 +54705,7 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde false false - mpaf/tool/fragments/ce/admin_create_product/get_product_attributes.jmx + tool/fragments/ce/admin_create_product/get_product_attributes.jmx product_attributes @@ -54898,7 +54773,7 @@ vars.putObject("product_attributes", attributes); false false - mpaf/tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx + tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx @@ -54925,17 +54800,20 @@ vars.put("attribute_set_filter", new String(encodedBytes)); - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx 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 true - mpaf/tool/fragments/ce/admin_create_product/setup.jmx + tool/fragments/ce/admin_create_product/setup.jmx - mpaf/tool/fragments/ce/admin_create_product/create_bundle_product.jmx + tool/fragments/ce/admin_create_product/create_bundle_product.jmx @@ -56880,7 +56758,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -56901,7 +56779,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/open_catalog_grid.jmx + tool/fragments/ce/admin_create_product/open_catalog_grid.jmx @@ -56932,7 +56810,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/new_configurable.jmx + tool/fragments/ce/admin_create_product/new_configurable.jmx @@ -57462,7 +57340,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu false false - mpaf/tool/fragments/ce/admin_create_product/configurable_validate.jmx + tool/fragments/ce/admin_create_product/configurable_validate.jmx @@ -57553,7 +57431,7 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } - mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx + tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx @@ -58074,7 +57952,7 @@ function addConfigurableMatrix(attributes) { false false - mpaf/tool/fragments/ce/admin_create_product/configurable_save.jmx + tool/fragments/ce/admin_create_product/configurable_save.jmx @@ -58183,13 +58061,13 @@ function addConfigurableMatrix(attributes) { vars.putObject("configurable_variations_assertion", variationNames); } - mpaf/tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx + tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - mpaf/tool/fragments/ce/admin_create_product/create_downloadable_product.jmx + tool/fragments/ce/admin_create_product/create_downloadable_product.jmx @@ -59814,7 +59692,7 @@ function addConfigurableMatrix(attributes) { - mpaf/tool/fragments/ce/admin_create_product/create_simple_product.jmx + tool/fragments/ce/admin_create_product/create_simple_product.jmx @@ -61347,7 +61225,7 @@ function addConfigurableMatrix(attributes) { false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -61361,7 +61239,7 @@ function addConfigurableMatrix(attributes) { adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -61372,7 +61250,7 @@ function addConfigurableMatrix(attributes) { false 1 ${cAdminProductEditingPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -61388,7 +61266,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -61422,7 +61300,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -61449,21 +61327,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -61594,7 +61473,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -61604,23 +61483,24 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx + tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx 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); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -63856,7 +63737,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -63867,7 +63748,7 @@ vars.put("admin_user", adminUser); false 1 ${cAdminReturnsManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -63883,7 +63764,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -63917,7 +63798,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -63944,21 +63825,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -64089,7 +63971,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -64099,13 +63981,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -64126,7 +64008,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx + tool/fragments/ce/admin_create_process_returns/orders_page.jmx @@ -64237,7 +64119,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx + tool/fragments/ce/admin_create_process_returns/open_orders.jmx @@ -64354,7 +64236,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx + tool/fragments/ce/admin_create_process_returns/search_orders.jmx @@ -64388,7 +64270,7 @@ vars.put("admin_user", adminUser); - mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx + tool/fragments/ce/admin_create_process_returns/setup.jmx import java.util.ArrayList; import java.util.HashMap; @@ -64456,7 +64338,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx + tool/fragments/ce/admin_create_process_returns/open_order.jmx @@ -64482,7 +64364,7 @@ vars.put("admin_user", adminUser); "${order_status}" == "Pending" false - mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx + tool/fragments/ce/admin_edit_order/if_controller.jmx @@ -64502,7 +64384,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx + tool/fragments/ce/admin_create_process_returns/invoice_start.jmx @@ -64573,7 +64455,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx + tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx @@ -64604,7 +64486,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx + tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx @@ -64693,7 +64575,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx + tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx @@ -64710,7 +64592,7 @@ vars.put("admin_user", adminUser); 1 0 ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - mpaf/tool/fragments/ce/admin_create_process_returns/pause.jmx + tool/fragments/ce/admin_create_process_returns/pause.jmx @@ -64733,7 +64615,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -64747,7 +64629,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -64758,7 +64640,7 @@ vars.put("admin_user", adminUser); false 1 ${cAdminBrowseCustomerGridPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -64774,7 +64656,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -64808,7 +64690,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -64835,21 +64717,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -64980,7 +64863,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -64990,7 +64873,7 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx @@ -65013,11 +64896,11 @@ vars.put("admin_user", adminUser); vars.put("grid_sort_order_2", "desc"); javascript - mpaf/tool/fragments/ce/admin_browse_customers_grid/setup.jmx + tool/fragments/ce/admin_browse_customers_grid/setup.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -65103,7 +64986,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx $.totalRecords @@ -65220,7 +65103,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx + tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx $.totalRecords @@ -65262,7 +65145,7 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_page_number.jmx @@ -65348,7 +65231,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx @@ -65369,11 +65252,11 @@ vars.put("grid_pages_count_filtered", pageCount); true false - mpaf/tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx + tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - mpaf/tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx + tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx @@ -65510,7 +65393,7 @@ vars.put("grid_pages_count_filtered", pageCount); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -65524,7 +65407,7 @@ vars.put("grid_pages_count_filtered", pageCount); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -65535,7 +65418,7 @@ vars.put("grid_pages_count_filtered", pageCount); false 1 ${cAdminCreateOrderPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -65551,7 +65434,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -65585,7 +65468,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -65612,21 +65495,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -65757,7 +65641,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -65767,13 +65651,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -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")); - mpaf/tool/fragments/ce/common/get_region_data.jmx + tool/fragments/ce/common/get_region_data.jmx - mpaf/tool/fragments/ce/admin_create_order/admin_create_order.jmx + tool/fragments/ce/admin_create_order/admin_create_order.jmx 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) { false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -66842,7 +66730,7 @@ catch (java.lang.Exception e) { adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -66853,7 +66741,7 @@ catch (java.lang.Exception e) { false 1 ${cAdminCategoryManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -66869,7 +66757,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -66903,7 +66791,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -66930,21 +66818,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -67075,7 +66964,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -67085,17 +66974,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_category_management/admin_category_management.jmx + tool/fragments/ce/admin_category_management/admin_category_management.jmx @@ -67872,7 +67761,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -67886,7 +67775,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -67897,7 +67786,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate false 1 ${cAdminPromotionRulesPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -67913,7 +67802,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -67947,7 +67836,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -67974,21 +67863,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -68119,7 +68009,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -68129,17 +68019,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx + tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx @@ -68556,7 +68446,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -68570,7 +68460,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -68581,7 +68471,7 @@ vars.put("admin_user", adminUser); false 1 ${cAdminCustomerManagementPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -68597,7 +68487,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -68631,7 +68521,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -68658,21 +68548,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -68803,7 +68694,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -68813,17 +68704,17 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx - mpaf/tool/fragments/ce/admin_customer_management/admin_customer_management.jmx + tool/fragments/ce/admin_customer_management/admin_customer_management.jmx @@ -70705,7 +70596,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -70719,7 +70610,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -70730,7 +70621,7 @@ vars.put("admin_user", adminUser); false 1 ${cAdminEditOrderPercentage} - mpaf/tool/fragments/_system/scenario_controller_tmpl.jmx + tool/fragments/_system/scenario_controller_tmpl.jmx @@ -70746,7 +70637,7 @@ if (testLabel } javascript - mpaf/tool/fragments/_system/setup_label.jmx + tool/fragments/_system/setup_label.jmx @@ -70780,7 +70671,7 @@ if (testLabel } javascript - mpaf/tool/fragments/ce/admin/handle_admin_form_key.jmx + tool/fragments/ce/admin/handle_admin_form_key.jmx @@ -70807,21 +70698,22 @@ if (testLabel false - mpaf/tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx + tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx get-admin-email - mpaf/tool/fragments/ce/lock_controller.jmx + tool/fragments/ce/lock_controller.jmx - mpaf/tool/fragments/ce/get_admin_email.jmx + tool/fragments/ce/get_admin_email.jmx +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); false false - mpaf/tool/fragments/ce/admin_login/admin_login.jmx + tool/fragments/ce/admin_login/admin_login.jmx @@ -70952,7 +70844,7 @@ vars.put("admin_user", adminUser); Java false - mpaf/tool/fragments/ce/admin_login/admin_login_submit_form.jmx + tool/fragments/ce/admin_login/admin_login_submit_form.jmx @@ -70962,13 +70854,13 @@ vars.put("admin_user", adminUser); $1$ 1 - mpaf/tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx + tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - mpaf/tool/fragments/ce/simple_controller.jmx + tool/fragments/ce/simple_controller.jmx @@ -70989,7 +70881,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/orders_page.jmx + tool/fragments/ce/admin_create_process_returns/orders_page.jmx @@ -71100,7 +70992,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_orders.jmx + tool/fragments/ce/admin_create_process_returns/open_orders.jmx @@ -71217,7 +71109,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/search_orders.jmx + tool/fragments/ce/admin_create_process_returns/search_orders.jmx @@ -71251,7 +71143,7 @@ vars.put("admin_user", adminUser); - mpaf/tool/fragments/ce/admin_create_process_returns/setup.jmx + tool/fragments/ce/admin_create_process_returns/setup.jmx import java.util.ArrayList; import java.util.HashMap; @@ -71319,7 +71211,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/open_order.jmx + tool/fragments/ce/admin_create_process_returns/open_order.jmx @@ -71345,7 +71237,7 @@ vars.put("admin_user", adminUser); "${order_status}" == "Pending" false - mpaf/tool/fragments/ce/admin_edit_order/if_controller.jmx + tool/fragments/ce/admin_edit_order/if_controller.jmx @@ -71389,7 +71281,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/add_comment.jmx + tool/fragments/ce/admin_edit_order/add_comment.jmx @@ -71420,7 +71312,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_start.jmx + tool/fragments/ce/admin_create_process_returns/invoice_start.jmx @@ -71491,7 +71383,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx + tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx @@ -71522,7 +71414,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/shipment_start.jmx + tool/fragments/ce/admin_edit_order/shipment_start.jmx @@ -71583,7 +71475,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/admin_edit_order/shipment_submit.jmx + tool/fragments/ce/admin_edit_order/shipment_submit.jmx @@ -71616,7 +71508,7 @@ vars.put("admin_user", adminUser); false false - mpaf/tool/fragments/ce/setup/admin_logout.jmx + tool/fragments/ce/setup/admin_logout.jmx @@ -71630,7 +71522,7 @@ vars.put("admin_user", adminUser); adminUserList.add(vars.get("admin_user")); } - mpaf/tool/fragments/ce/common/return_admin_email_to_pool.jmx + tool/fragments/ce/common/return_admin_email_to_pool.jmx @@ -71651,7 +71543,7 @@ vars.put("admin_user", adminUser); false - mpaf/tool/fragments/ce/tear_down.jmx + tool/fragments/ce/tear_down.jmx "${dashboard_enabled}" == "1" @@ -71767,7 +71659,7 @@ vars.put("admin_user", adminUser); ${response_time_file_name} - mpaf/tool/fragments/ce/common/aggregate_graph.jmx + tool/fragments/ce/common/aggregate_graph.jmx @@ -71775,7 +71667,7 @@ vars.put("admin_user", adminUser); true true false - mpaf/tool/fragments/_system/debug.jmx + tool/fragments/_system/debug.jmx From 92b8ca6f084f3bae1678ac6e3b839b957dd61199 Mon Sep 17 00:00:00 2001 From: Dan Mooney Date: Tue, 17 Nov 2020 08:08:10 -0600 Subject: [PATCH 050/155] 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 @@ + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + Clicks the New Address button on the storefront Checkout Shipping page + + + + + 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 @@ + + + + + + + Clicks the save button on the storefront new address form + + + + + 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 @@ + + + + + + + Selects the provided Option in the provided Customer Address Attribute drop down menu on store front. + + + + + + + + + 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 @@ + 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 @@ + + + + + + + + + + <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 051/155] 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 052/155] 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 053/155] 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 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 054/155] 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 055/155] 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 056/155] 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 057/155] 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 058/155] 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 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 059/155] 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 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 060/155] 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 061/155] 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 062/155] 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 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 063/155] 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 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 064/155] 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 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 065/155] 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 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 066/155] 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 067/155] 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 068/155] 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 069/155] 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 070/155] 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 071/155] 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 673edbeef402cdce35888dcc105261be24184337 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Fri, 20 Nov 2020 16:36:03 +0200 Subject: [PATCH 072/155] 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 ed41a6200b3517b49e9b64d5c44dc096294796bc Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Fri, 20 Nov 2020 12:25:59 -0600 Subject: [PATCH 073/155] 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 Date: Fri, 20 Nov 2020 14:43:52 -0600 Subject: [PATCH 074/155] 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 @@ +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 @@ Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext + Magento\CustomerGraphQl\Model\Context\AddCustomerGroupToContext From 72d4cd76ada26777ae3733d46c3e46d1ec482cac Mon Sep 17 00:00:00 2001 From: Roman Flowers Date: Fri, 20 Nov 2020 16:27:41 -0600 Subject: [PATCH 075/155] 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 @@ + + + + + + + Searches the Admin Products grid by string without clearing filters. + + + + + + + + + + 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 @@ + + + + + + + + + + + <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 076/155] 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 077/155] 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 078/155] 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 079/155] 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 080/155] 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 081/155] 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 082/155] 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 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 083/155] 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 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 084/155] 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 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 085/155] 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 086/155] 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 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 087/155] 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 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 088/155] 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 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 089/155] 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 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 090/155] 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 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 091/155] 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 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 092/155] 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 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 093/155] 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 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 094/155] 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 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 095/155] 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 096/155] 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 097/155] 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 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 098/155] 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 099/155] 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 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 100/155] 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 101/155] 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 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 102/155] 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 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 103/155] 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 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 104/155] 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 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 105/155] 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 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 106/155] 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 107/155] 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 108/155] 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 109/155] 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 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 110/155] 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 111/155] 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 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 112/155] 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 113/155] 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 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 114/155] 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 115/155] 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 116/155] 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 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 117/155] 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 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 118/155] 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 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 119/155] 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 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 120/155] 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 121/155] 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 122/155] 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 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 123/155] 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 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 124/155] 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 125/155] 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 126/155] 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 127/155] 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 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 128/155] 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 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 129/155] 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 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 130/155] 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 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 131/155] 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 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 132/155] 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 133/155] 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 134/155] 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 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 135/155] 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 136/155] 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 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 137/155] 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 138/155] 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 139/155] 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 140/155] 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 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 141/155] 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 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 142/155] 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 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 143/155] 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 144/155] 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 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 145/155] 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 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 146/155] 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 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 147/155] 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 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 148/155] 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 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 149/155] 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 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 150/155] 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 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 151/155] 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 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 152/155] 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 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 153/155] =?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 154/155] =?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 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 155/155] 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) );